CSS general sibling selectors does not work without CSS JIT
authorbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Sep 2015 23:40:55 +0000 (23:40 +0000)
committerbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Sep 2015 23:40:55 +0000 (23:40 +0000)
https://bugs.webkit.org/show_bug.cgi?id=148987
rdar://problem/22559860

Patch by Benjamin Poulain <bpoulain@apple.com> on 2015-09-09
Reviewed by Andreas Kling.

Source/WebCore:

When traversing with the indirect adjacent combinator, SelectorChecker
was not setting the style invalidation flag on the right element.

Tests: fast/css/indirect-adjacent-style-invalidation-1.html
       fast/css/indirect-adjacent-style-invalidation-2.html
       fast/css/indirect-adjacent-style-invalidation-3.html

* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::matchRecursively):

LayoutTests:

There are multiple variations of the same tests to test
cases where we JIT and cases without JIT.

* fast/css/indirect-adjacent-style-invalidation-1-expected.txt: Added.
* fast/css/indirect-adjacent-style-invalidation-1.html: Added.
* fast/css/indirect-adjacent-style-invalidation-2-expected.txt: Added.
* fast/css/indirect-adjacent-style-invalidation-2.html: Added.
* fast/css/indirect-adjacent-style-invalidation-3-expected.txt: Added.
* fast/css/indirect-adjacent-style-invalidation-3.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189560 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/css/indirect-adjacent-style-invalidation-1-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/indirect-adjacent-style-invalidation-1.html [new file with mode: 0644]
LayoutTests/fast/css/indirect-adjacent-style-invalidation-2-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/indirect-adjacent-style-invalidation-2.html [new file with mode: 0644]
LayoutTests/fast/css/indirect-adjacent-style-invalidation-3-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/indirect-adjacent-style-invalidation-3.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/SelectorChecker.cpp

index 2e0846a..b86e767 100644 (file)
@@ -1,3 +1,21 @@
+2015-09-09  Benjamin Poulain  <bpoulain@apple.com>
+
+        CSS general sibling selectors does not work without CSS JIT
+        https://bugs.webkit.org/show_bug.cgi?id=148987
+        rdar://problem/22559860
+
+        Reviewed by Andreas Kling.
+
+        There are multiple variations of the same tests to test
+        cases where we JIT and cases without JIT. 
+
+        * fast/css/indirect-adjacent-style-invalidation-1-expected.txt: Added.
+        * fast/css/indirect-adjacent-style-invalidation-1.html: Added.
+        * fast/css/indirect-adjacent-style-invalidation-2-expected.txt: Added.
+        * fast/css/indirect-adjacent-style-invalidation-2.html: Added.
+        * fast/css/indirect-adjacent-style-invalidation-3-expected.txt: Added.
+        * fast/css/indirect-adjacent-style-invalidation-3.html: Added.
+
 2015-09-09  Myles C. Maxfield  <mmaxfield@apple.com>
 
         ASSERTION FAILED: typesettingFeatures & (Kerning | Ligatures) in WebCore::applyFontTransforms
diff --git a/LayoutTests/fast/css/indirect-adjacent-style-invalidation-1-expected.txt b/LayoutTests/fast/css/indirect-adjacent-style-invalidation-1-expected.txt
new file mode 100644 (file)
index 0000000..fc93d8b
--- /dev/null
@@ -0,0 +1,35 @@
+Test the style invalidation of elements affected by an indirect adjacent.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(".activator")[0]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(".activator")[1]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[0]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[1]) is false
+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 window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(".activator")[0]) is true
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(".activator")[1]) is true
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[0]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[1]) is false
+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 window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(".activator")[0]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(".activator")[1]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[0]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[1]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(".activator")[0]) is true
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(".activator")[1]) is true
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[0]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[1]) is false
+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 window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(".activator")[0]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(".activator")[1]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[0]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[1]) is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/css/indirect-adjacent-style-invalidation-1.html b/LayoutTests/fast/css/indirect-adjacent-style-invalidation-1.html
new file mode 100644 (file)
index 0000000..3e7a4ce
--- /dev/null
@@ -0,0 +1,94 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<style>
+* {
+    color: black;
+}
+:checked ~ target {
+    color: rgb(0, 1, 2);
+}
+</style>
+</head>
+<body>
+    <div>
+        <!-- With renderer -->
+        <input class="activator" type="checkbox">
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <target></target>
+    </div>
+    <div style="display:none;">
+        <!-- Without renderer -->
+        <input class="activator" type="radio">
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <target></target>
+    </div>
+</body>
+<script>
+
+description('Test the style invalidation of elements affected by an indirect adjacent.');
+
+function shouldNeedStyleRecalc(expected) {
+    var testFunction = expected ? shouldBeTrue : shouldBeFalse;
+    testFunction("window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(\".activator\")[0])");
+    testFunction("window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(\".activator\")[1])");
+    shouldBeFalse("window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(\"target\")[0])");
+    shouldBeFalse("window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(\"target\")[1])");
+}
+
+function setId(name) {
+    var allTargets = document.querySelectorAll("target");
+    allTargets[0].id = name;
+    allTargets[1].id = name;
+}
+
+function checkStyle(expectedColor) {
+    var allTargets = document.querySelectorAll("target");
+    shouldBeEqualToString('getComputedStyle(document.querySelectorAll("target")[0]).color', expectedColor);
+    shouldBeEqualToString('getComputedStyle(document.querySelectorAll("target")[1]).color', expectedColor);
+}
+// Force a layout to ensure we don't have dirty styles.
+var offsetTop = document.documentElement.offsetTop;
+
+// Initial state.
+shouldNeedStyleRecalc(false);
+checkStyle("rgb(0, 0, 0)");
+
+// Check the input fields.
+var allActivators = document.querySelectorAll("input.activator:matches([type=checkbox], [type=radio])");
+for (let i = 0; i < allActivators.length; ++i) {
+    allActivators[i].checked = true;
+}
+shouldNeedStyleRecalc(true);
+checkStyle("rgb(0, 1, 2)");
+shouldNeedStyleRecalc(false);
+
+// Uncheck the input fields.
+var allActivators = document.querySelectorAll("input.activator:matches([type=checkbox], [type=radio])");
+for (let i = 0; i < allActivators.length; ++i) {
+    allActivators[i].checked = false;
+}
+shouldNeedStyleRecalc(true);
+checkStyle("rgb(0, 0, 0)");
+shouldNeedStyleRecalc(false);
+
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</html>
diff --git a/LayoutTests/fast/css/indirect-adjacent-style-invalidation-2-expected.txt b/LayoutTests/fast/css/indirect-adjacent-style-invalidation-2-expected.txt
new file mode 100644 (file)
index 0000000..fc93d8b
--- /dev/null
@@ -0,0 +1,35 @@
+Test the style invalidation of elements affected by an indirect adjacent.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(".activator")[0]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(".activator")[1]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[0]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[1]) is false
+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 window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(".activator")[0]) is true
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(".activator")[1]) is true
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[0]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[1]) is false
+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 window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(".activator")[0]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(".activator")[1]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[0]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[1]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(".activator")[0]) is true
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(".activator")[1]) is true
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[0]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[1]) is false
+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 window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(".activator")[0]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(".activator")[1]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[0]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[1]) is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/css/indirect-adjacent-style-invalidation-2.html b/LayoutTests/fast/css/indirect-adjacent-style-invalidation-2.html
new file mode 100644 (file)
index 0000000..f949ff0
--- /dev/null
@@ -0,0 +1,94 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<style>
+* {
+    color: black;
+}
+:checked:first-of-type ~ target {
+    color: rgb(0, 1, 2);
+}
+</style>
+</head>
+<body>
+    <div>
+        <!-- With renderer -->
+        <input class="activator" type="checkbox">
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <target></target>
+    </div>
+    <div style="display:none;">
+        <!-- Without renderer -->
+        <input class="activator" type="radio">
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <target></target>
+    </div>
+</body>
+<script>
+
+description('Test the style invalidation of elements affected by an indirect adjacent.');
+
+function shouldNeedStyleRecalc(expected) {
+    var testFunction = expected ? shouldBeTrue : shouldBeFalse;
+    testFunction("window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(\".activator\")[0])");
+    testFunction("window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(\".activator\")[1])");
+    shouldBeFalse("window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(\"target\")[0])");
+    shouldBeFalse("window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(\"target\")[1])");
+}
+
+function setId(name) {
+    var allTargets = document.querySelectorAll("target");
+    allTargets[0].id = name;
+    allTargets[1].id = name;
+}
+
+function checkStyle(expectedColor) {
+    var allTargets = document.querySelectorAll("target");
+    shouldBeEqualToString('getComputedStyle(document.querySelectorAll("target")[0]).color', expectedColor);
+    shouldBeEqualToString('getComputedStyle(document.querySelectorAll("target")[1]).color', expectedColor);
+}
+// Force a layout to ensure we don't have dirty styles.
+var offsetTop = document.documentElement.offsetTop;
+
+// Initial state.
+shouldNeedStyleRecalc(false);
+checkStyle("rgb(0, 0, 0)");
+
+// Check the input fields.
+var allActivators = document.querySelectorAll("input.activator:matches([type=checkbox], [type=radio])");
+for (let i = 0; i < allActivators.length; ++i) {
+    allActivators[i].checked = true;
+}
+shouldNeedStyleRecalc(true);
+checkStyle("rgb(0, 1, 2)");
+shouldNeedStyleRecalc(false);
+
+// Uncheck the input fields.
+var allActivators = document.querySelectorAll("input.activator:matches([type=checkbox], [type=radio])");
+for (let i = 0; i < allActivators.length; ++i) {
+    allActivators[i].checked = false;
+}
+shouldNeedStyleRecalc(true);
+checkStyle("rgb(0, 0, 0)");
+shouldNeedStyleRecalc(false);
+
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</html>
diff --git a/LayoutTests/fast/css/indirect-adjacent-style-invalidation-3-expected.txt b/LayoutTests/fast/css/indirect-adjacent-style-invalidation-3-expected.txt
new file mode 100644 (file)
index 0000000..fc93d8b
--- /dev/null
@@ -0,0 +1,35 @@
+Test the style invalidation of elements affected by an indirect adjacent.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(".activator")[0]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(".activator")[1]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[0]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[1]) is false
+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 window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(".activator")[0]) is true
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(".activator")[1]) is true
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[0]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[1]) is false
+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 window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(".activator")[0]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(".activator")[1]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[0]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[1]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(".activator")[0]) is true
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(".activator")[1]) is true
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[0]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[1]) is false
+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 window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(".activator")[0]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(".activator")[1]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[0]) is false
+PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[1]) is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/css/indirect-adjacent-style-invalidation-3.html b/LayoutTests/fast/css/indirect-adjacent-style-invalidation-3.html
new file mode 100644 (file)
index 0000000..b32ab4c
--- /dev/null
@@ -0,0 +1,94 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<style>
+* {
+    color: black;
+}
+:checked:matches(*, :last-of-type, *) ~ target {
+    color: rgb(0, 1, 2);
+}
+</style>
+</head>
+<body>
+    <div>
+        <!-- With renderer -->
+        <input class="activator" type="checkbox">
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <target></target>
+    </div>
+    <div style="display:none;">
+        <!-- Without renderer -->
+        <input class="activator" type="radio">
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <padding></padding>
+        <target></target>
+    </div>
+</body>
+<script>
+
+description('Test the style invalidation of elements affected by an indirect adjacent.');
+
+function shouldNeedStyleRecalc(expected) {
+    var testFunction = expected ? shouldBeTrue : shouldBeFalse;
+    testFunction("window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(\".activator\")[0])");
+    testFunction("window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(\".activator\")[1])");
+    shouldBeFalse("window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(\"target\")[0])");
+    shouldBeFalse("window.internals.nodeNeedsStyleRecalc(document.querySelectorAll(\"target\")[1])");
+}
+
+function setId(name) {
+    var allTargets = document.querySelectorAll("target");
+    allTargets[0].id = name;
+    allTargets[1].id = name;
+}
+
+function checkStyle(expectedColor) {
+    var allTargets = document.querySelectorAll("target");
+    shouldBeEqualToString('getComputedStyle(document.querySelectorAll("target")[0]).color', expectedColor);
+    shouldBeEqualToString('getComputedStyle(document.querySelectorAll("target")[1]).color', expectedColor);
+}
+// Force a layout to ensure we don't have dirty styles.
+var offsetTop = document.documentElement.offsetTop;
+
+// Initial state.
+shouldNeedStyleRecalc(false);
+checkStyle("rgb(0, 0, 0)");
+
+// Check the input fields.
+var allActivators = document.querySelectorAll("input.activator:matches([type=checkbox], [type=radio])");
+for (let i = 0; i < allActivators.length; ++i) {
+    allActivators[i].checked = true;
+}
+shouldNeedStyleRecalc(true);
+checkStyle("rgb(0, 1, 2)");
+shouldNeedStyleRecalc(false);
+
+// Uncheck the input fields.
+var allActivators = document.querySelectorAll("input.activator:matches([type=checkbox], [type=radio])");
+for (let i = 0; i < allActivators.length; ++i) {
+    allActivators[i].checked = false;
+}
+shouldNeedStyleRecalc(true);
+checkStyle("rgb(0, 0, 0)");
+shouldNeedStyleRecalc(false);
+
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</html>
index 2f723e1..626f00a 100644 (file)
@@ -1,3 +1,21 @@
+2015-09-09  Benjamin Poulain  <bpoulain@apple.com>
+
+        CSS general sibling selectors does not work without CSS JIT
+        https://bugs.webkit.org/show_bug.cgi?id=148987
+        rdar://problem/22559860
+
+        Reviewed by Andreas Kling.
+
+        When traversing with the indirect adjacent combinator, SelectorChecker
+        was not setting the style invalidation flag on the right element.
+
+        Tests: fast/css/indirect-adjacent-style-invalidation-1.html
+               fast/css/indirect-adjacent-style-invalidation-2.html
+               fast/css/indirect-adjacent-style-invalidation-3.html
+
+        * css/SelectorChecker.cpp:
+        (WebCore::SelectorChecker::matchRecursively):
+
 2015-09-09  Joseph Pecoraro  <pecoraro@apple.com>
 
         Web Inspector: Remove unused InspectorFrontendHost methods
index 8bfe02b..d800132 100644 (file)
@@ -353,7 +353,7 @@ SelectorChecker::MatchResult SelectorChecker::matchRecursively(const CheckingCon
         nextContext.elementStyle = nullptr;
         for (; nextContext.element; nextContext.element = nextContext.element->previousElementSibling()) {
             if (context.resolvingMode == Mode::ResolvingStyle)
-                context.element->setAffectsNextSiblingElementStyle();
+                nextContext.element->setAffectsNextSiblingElementStyle();
 
             PseudoIdSet ignoreDynamicPseudo;
             unsigned indirectAdjacentSpecificity = 0;