OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/js-test.js"></script> |
| 3 <style> |
| 4 .b { color: red } |
| 5 .a + div .b { color: green } |
| 6 </style> |
| 7 <input type="text"></input> |
| 8 <div> |
| 9 <span class="b">Should be green</span> |
| 10 <span></span> |
| 11 <span></span> |
| 12 <span></span> |
| 13 </div> |
| 14 <script> |
| 15 description("A reattach should not discard a scheduled sibling invalidation.
"); |
| 16 |
| 17 var input = document.querySelector("input"); |
| 18 |
| 19 shouldBeEqualToString("getComputedStyle(document.querySelector('.b')).color"
, "rgb(255, 0, 0)"); |
| 20 |
| 21 // Force clean style+layout |
| 22 input.offsetTop; |
| 23 |
| 24 // Schedule sibling invalidation set to invalidate span.b |
| 25 input.className = "a"; |
| 26 |
| 27 // Trigger lazyReattachIfAttached() -> detach(). |
| 28 document.querySelector("input").type = "button"; |
| 29 |
| 30 // The expected count will be 2 when ContainerNode::checkForChildrenAdjacent
RuleChanges() |
| 31 // is removed. One for attaching the input, and one for the span.b recalc. |
| 32 if (window.internals) |
| 33 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "6"); |
| 34 |
| 35 shouldBeEqualToString("getComputedStyle(document.querySelector('.b')).color"
, "rgb(0, 128, 0)"); |
| 36 </script> |
OLD | NEW |