Index: LayoutTests/fast/css/invalidation/class-sibling-universal.html |
diff --git a/LayoutTests/fast/css/invalidation/class-sibling-universal.html b/LayoutTests/fast/css/invalidation/class-sibling-universal.html |
index f244230f3908937db5d0b973fafd6e7ea257d5f7..3e0b9cb569b0ac3a7a6a0f728c6aee5d56ba9b7c 100644 |
--- a/LayoutTests/fast/css/invalidation/class-sibling-universal.html |
+++ b/LayoutTests/fast/css/invalidation/class-sibling-universal.html |
@@ -7,7 +7,9 @@ |
.t3 .sibling + :hover, |
.t4 + .sibling, |
.t5 + *, |
-.t6 ~ .sibling { background-color: rgb(0, 128, 0); } |
+.t6 ~ .sibling, |
+.t7 + * + * .child, |
+.t8 + :-webkit-any(.sibling) * { background-color: rgb(0, 128, 0); } |
#r3 { width: 10px; height: 10px } |
</style> |
@@ -36,6 +38,7 @@ |
<div></div> |
<div></div> |
</div> |
+ <div class="sibling"></div> |
</div> |
<div> |
<div id="t5"></div> |
@@ -51,6 +54,25 @@ |
<div></div> |
<div></div> |
</div> |
+ <div></div> |
+</div> |
+<div> |
+ <div id="t7"></div> |
+ <div> |
+ <div class="child"></div> |
+ </div> |
+ <div> |
+ <div id="r7" class="child"></div> |
+ </div> |
+ <div> |
+ <div class="child"></div> |
+ </div> |
+</div> |
+<div> |
+ <div id="t8"></div> |
+ <div class="sibling"> |
+ <div id="r8"></div> |
+ </div> |
</div> |
<script> |
document.body.offsetTop; |
@@ -90,7 +112,7 @@ test(function() { |
assert_equals(getComputedStyle(r4).backgroundColor, "rgba(0, 0, 0, 0)", "Background color should initially be transparent"); |
t4.className = "t4"; |
- assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 4, "Subtree style recalc"); |
+ assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 1, "Subtree style recalc"); |
assert_equals(getComputedStyle(r4).backgroundColor, "rgb(0, 128, 0)", "Background color is green after class change"); |
}, "Class change affecting selector for sibling class"); |
@@ -99,7 +121,7 @@ test(function() { |
assert_equals(getComputedStyle(r5).backgroundColor, "rgba(0, 0, 0, 0)", "Background color should initially be transparent"); |
t5.className = "t5"; |
- assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 4, "Subtree style recalc"); |
+ assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 3, "Subtree style recalc"); |
assert_equals(getComputedStyle(r5).backgroundColor, "rgb(0, 128, 0)", "Background color is green after class change"); |
}, "Class change affecting all sibling subtrees through a universal selector"); |
@@ -108,7 +130,26 @@ test(function() { |
assert_equals(getComputedStyle(r6).backgroundColor, "rgba(0, 0, 0, 0)", "Background color should initially be transparent"); |
t6.className = "t6"; |
- assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 5, "Subtree style recalc"); |
+ assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 1, "Subtree style recalc"); |
assert_equals(getComputedStyle(r6).backgroundColor, "rgb(0, 128, 0)", "Background color is green after class change"); |
}, "Class change affecting all sibling subtrees through an indirect adjacent combinator"); |
+ |
+test(function() { |
+ assert_true(!!window.internals, "This test only works with internals exposed present"); |
+ assert_equals(getComputedStyle(r7).backgroundColor, "rgba(0, 0, 0, 0)", "Background color should initially be transparent"); |
+ |
+ t7.className = "t7"; |
+ assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 6, "Subtree style recalc"); |
+ assert_equals(getComputedStyle(r7).backgroundColor, "rgb(0, 128, 0)", "Background color is green after class change"); |
+}, "Class change affecting sibling descendants through a universal selector"); |
+ |
+test(function() { |
+ assert_true(!!window.internals, "This test only works with internals exposed present"); |
+ assert_equals(getComputedStyle(r8).backgroundColor, "rgba(0, 0, 0, 0)", "Background color should initially be transparent"); |
+ |
+ t8.className = "t8"; |
+ assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 2, "Subtree style recalc"); |
+ assert_equals(getComputedStyle(r8).backgroundColor, "rgb(0, 128, 0)", "Background color is green after class change"); |
+}, "Class change affecting universal descendants of webkit-any sibling"); |
+ |
</script> |