haikuwebkit/LayoutTests/fast/history/link-inside-any-expected.txt

19 lines
334 B
Plaintext
Raw Permalink Normal View History

CSS: Refactor :visited handling in SelectorChecker https://bugs.webkit.org/show_bug.cgi?id=135639 Reviewed by Benjamin Poulain. Source/WebCore: :visited is specially handled in the SelectorChecker and style resolution because of security issues. That is nested links and adjacent combinators. Since we propagate linkState from the ancestors, 1. linkStates of ancestors from the target node are only used to calculate the linkState of the current node. This is why adjacent combinators disable :visited. 2. linkState is overrides by the closest link element in the ancestors. This is why :visited is effective on the closest link element. In this patch, we fix 3 things. 1. Simplify SelectorChecker. Move m_mode to CheckingContext and it makes CheckingContext more similar to SelectorCompiler::CheckingContext in CSS JIT. And hide visitedMatchType parameter from the caller of SelectorChecker. 2. Disable :visited inside :-webkit-any. Currently, :-webkit-any provides MatchAll link match type. So considering visited match type in the matching phase of :visited provides inconsistency. In this patch, :-webkit-any(:visited) never matches. And :-webkit-any(:link) acts like a :-webkit-any(:any-link). This behavior represents that visited match type is always considered as disabled inside :-webkit-any. This behavior may be changed when Selector Level4 is implemented. 3. Fix the issue when traversing the descendant element, first encountered link check is missing. Tests: fast/history/link-inside-any.html fast/history/link-inside-not.html fast/history/nested-visited-test-override.html fast/history/visited-inside-any.html fast/history/visited-inside-not.html * css/ElementRuleCollector.cpp: (WebCore::ElementRuleCollector::ruleMatches): * css/SelectorChecker.cpp: (WebCore::SelectorChecker::SelectorChecker): (WebCore::SelectorChecker::match): (WebCore::hasScrollbarPseudoElement): (WebCore::checkingContextForParent): (WebCore::SelectorChecker::matchRecursively): (WebCore::SelectorChecker::checkOne): * css/SelectorChecker.h: (WebCore::SelectorChecker::SelectorCheckingContext::SelectorCheckingContext): * css/StyleResolver.h: (WebCore::checkRegionSelector): * dom/SelectorQuery.cpp: (WebCore::SelectorDataList::selectorMatches): LayoutTests: * fast/history/link-inside-any-expected.txt: Added. * fast/history/link-inside-any.html: Added. * fast/history/link-inside-not-expected.txt: Added. * fast/history/link-inside-not.html: Added. * fast/history/nested-visited-test-override-expected.txt: Added. * fast/history/nested-visited-test-override.html: Added. * fast/history/visited-inside-any-expected.txt: Added. * fast/history/visited-inside-any.html: Added. * fast/history/visited-inside-not-expected.txt: Added. * fast/history/visited-inside-not.html: Added. Canonical link: https://commits.webkit.org/154209@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173138 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-08-30 13:42:51 +00:00
:link inside :-webkit-any should behave like :any-link.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS oneStyle.color became "rgb(0, 128, 0)"
PASS twoStyle.color became "rgb(0, 128, 0)"
PASS successfullyParsed is true
TEST COMPLETE
One and Two links should be green:
One
and Two
Three