haikuwebkit/LayoutTests/fast/selectors/class-style-update-expected...

52 lines
3.9 KiB
Plaintext
Raw Permalink Normal View History

CSS Rule features are ignored for nested CSS Selector lists https://bugs.webkit.org/show_bug.cgi?id=137908 Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-10-21 Reviewed by Andreas Kling. Source/WebCore: When Rule feature sets were collected, any selector list nested inside an other selector list was ignored when collecting properties of the CSS Selector. As a result, style was not invalidated properly when any property listed in the nested selectors. This patch fixes the issue by make RuleFeatureSet::collectFeaturesFromSelector() recursive, evaluating every chain of every selector lists. Tests: fast/css/class-style-invalidation-optimization.html fast/css/direct-adjacent-style-sharing-1.html fast/css/direct-adjacent-style-sharing-2.html fast/css/direct-adjacent-style-sharing-3.html fast/css/id-style-invalidation-optimization.html fast/selectors/class-style-update-with-not.html fast/selectors/class-style-update-with-nth-child-of.html fast/selectors/class-style-update.html * css/RuleFeature.cpp: (WebCore::recursivelyCollectFeaturesFromSelector): (WebCore::RuleFeatureSet::collectFeaturesFromSelector): * css/RuleFeature.h: * css/RuleSet.cpp: (WebCore::collectFeaturesFromRuleData): LayoutTests: * fast/selectors/class-style-update-with-not-expected.txt: Added. * fast/selectors/class-style-update-with-not.html: Added. Parts of this test fail due to a bug with specificity. This will be addressed separately. * fast/css/class-style-invalidation-optimization-expected.txt: Added. * fast/css/class-style-invalidation-optimization.html: Added. * fast/css/direct-adjacent-style-sharing-1-expected.html: Added. * fast/css/direct-adjacent-style-sharing-1.html: Added. * fast/css/direct-adjacent-style-sharing-2-expected.html: Added. * fast/css/direct-adjacent-style-sharing-2.html: Added. * fast/css/direct-adjacent-style-sharing-3-expected.html: Added. * fast/css/direct-adjacent-style-sharing-3.html: Added. * fast/css/id-style-invalidation-optimization-expected.txt: Added. * fast/css/id-style-invalidation-optimization.html: Added. * fast/selectors/class-style-update-expected.txt: Added. * fast/selectors/class-style-update-with-nth-child-of-expected.txt: Added. * fast/selectors/class-style-update-with-nth-child-of.html: Added. * fast/selectors/class-style-update.html: Added. Canonical link: https://commits.webkit.org/155811@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@175018 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-22 03:28:29 +00:00
Test that the style of elements is invalidated correctly when class changes can affect its style. Elements are only invalidate if the class changed affects the style. It is important to account nested selector lists.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS getComputedStyle(document.querySelectorAll("target")[0]).color is "rgb(0, 0, 0)"
PASS getComputedStyle(document.querySelectorAll("target")[1]).color is "rgb(0, 0, 0)"
PASS getComputedStyle(document.querySelectorAll("target")[0]).color is "rgb(0, 1, 2)"
PASS getComputedStyle(document.querySelectorAll("target")[1]).color is "rgb(0, 1, 2)"
PASS getComputedStyle(document.querySelectorAll("target")[0]).color is "rgb(0, 0, 0)"
PASS getComputedStyle(document.querySelectorAll("target")[1]).color is "rgb(0, 0, 0)"
PASS getComputedStyle(document.querySelectorAll("target")[0]).color is "rgb(0, 0, 0)"
PASS getComputedStyle(document.querySelectorAll("target")[1]).color is "rgb(0, 0, 0)"
PASS getComputedStyle(document.querySelectorAll("target")[0]).color is "rgb(0, 0, 0)"
PASS getComputedStyle(document.querySelectorAll("target")[1]).color is "rgb(0, 0, 0)"
PASS getComputedStyle(document.querySelectorAll("target")[0]).color is "rgb(3, 4, 5)"
PASS getComputedStyle(document.querySelectorAll("target")[1]).color is "rgb(3, 4, 5)"
PASS getComputedStyle(document.querySelectorAll("target")[0]).color is "rgb(0, 0, 0)"
PASS getComputedStyle(document.querySelectorAll("target")[1]).color is "rgb(0, 0, 0)"
PASS getComputedStyle(document.querySelectorAll("target")[0]).color is "rgb(0, 0, 0)"
PASS getComputedStyle(document.querySelectorAll("target")[1]).color is "rgb(0, 0, 0)"
PASS getComputedStyle(document.querySelectorAll("target")[0]).color is "rgb(0, 0, 0)"
PASS getComputedStyle(document.querySelectorAll("target")[1]).color is "rgb(0, 0, 0)"
PASS getComputedStyle(document.querySelectorAll("target")[0]).color is "rgb(6, 7, 8)"
PASS getComputedStyle(document.querySelectorAll("target")[1]).color is "rgb(6, 7, 8)"
PASS getComputedStyle(document.querySelectorAll("target")[0]).color is "rgb(0, 0, 0)"
PASS getComputedStyle(document.querySelectorAll("target")[1]).color is "rgb(0, 0, 0)"
PASS getComputedStyle(document.querySelectorAll("target")[0]).color is "rgb(0, 0, 0)"
PASS getComputedStyle(document.querySelectorAll("target")[1]).color is "rgb(0, 0, 0)"
PASS getComputedStyle(document.querySelectorAll("target")[0]).color is "rgb(0, 0, 0)"
PASS getComputedStyle(document.querySelectorAll("target")[1]).color is "rgb(0, 0, 0)"
PASS getComputedStyle(document.querySelectorAll("target")[0]).color is "rgb(9, 10, 11)"
PASS getComputedStyle(document.querySelectorAll("target")[1]).color is "rgb(9, 10, 11)"
PASS getComputedStyle(document.querySelectorAll("target")[0]).color is "rgb(0, 0, 0)"
PASS getComputedStyle(document.querySelectorAll("target")[1]).color is "rgb(0, 0, 0)"
PASS getComputedStyle(document.querySelectorAll("target")[0]).color is "rgb(0, 0, 0)"
PASS getComputedStyle(document.querySelectorAll("target")[1]).color is "rgb(0, 0, 0)"
PASS getComputedStyle(document.querySelectorAll("target")[0]).color is "rgb(0, 0, 0)"
PASS getComputedStyle(document.querySelectorAll("target")[1]).color is "rgb(0, 0, 0)"
PASS getComputedStyle(document.querySelectorAll("target")[0]).color is "rgb(0, 1, 2)"
PASS getComputedStyle(document.querySelectorAll("target")[1]).color is "rgb(0, 1, 2)"
PASS getComputedStyle(document.querySelectorAll("target")[0]).color is "rgb(3, 4, 5)"
PASS getComputedStyle(document.querySelectorAll("target")[1]).color is "rgb(3, 4, 5)"
PASS getComputedStyle(document.querySelectorAll("target")[0]).color is "rgb(6, 7, 8)"
PASS getComputedStyle(document.querySelectorAll("target")[1]).color is "rgb(6, 7, 8)"
PASS getComputedStyle(document.querySelectorAll("target")[0]).color is "rgb(9, 10, 11)"
PASS getComputedStyle(document.querySelectorAll("target")[1]).color is "rgb(9, 10, 11)"
PASS successfullyParsed is true
TEST COMPLETE