Index: third_party/WebKit/LayoutTests/fast/css/invalidation/nth-pseudo.html |
diff --git a/third_party/WebKit/LayoutTests/fast/css/invalidation/nth-pseudo.html b/third_party/WebKit/LayoutTests/fast/css/invalidation/nth-pseudo.html |
index bcf504a1a783ba89ae960608d7158a09ac0db30c..9cffe1bc69afa870a8408646cf312fdf17a49e47 100644 |
--- a/third_party/WebKit/LayoutTests/fast/css/invalidation/nth-pseudo.html |
+++ b/third_party/WebKit/LayoutTests/fast/css/invalidation/nth-pseudo.html |
@@ -2,10 +2,13 @@ |
<script src="../../../resources/testharness.js"></script> |
<script src="../../../resources/testharnessreport.js"></script> |
<style> |
- #t1 > :nth-child(even) { |
+ #t1 > span:nth-child(even) { |
background-color: green |
} |
- #t2 > :nth-last-child(even) { |
+ #t2 > span:nth-last-child(even) { |
+ background-color: green |
+ } |
+ #t3 > .second:nth-child(2) { |
background-color: green |
} |
</style> |
@@ -15,6 +18,12 @@ |
<div id="t2"> |
<span></span> |
</div> |
+<div id="t3"> |
+ <div class="second"></div> |
+ <div></div> |
+ <div></div> |
+ <div></div> |
+</div> |
<script> |
function backgroundIsGreen(element) { |
@@ -40,4 +49,13 @@ |
assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 1); |
}, "Prepending an element sibling should not affect :nth-last-child of succeeding siblings."); |
+ test(() => { |
+ t3.offsetTop; |
+ let second = t3.querySelector(".second"); |
+ backgroundIsTransparent(second); |
+ t3.insertBefore(document.createElement("div"), t3.firstChild); |
+ assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 2); |
+ backgroundIsGreen(second); |
+ }, "Prepending an element sibling should not affect :nth-last-child of succeeding siblings."); |
+ |
</script> |