OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../../resources/js-test.js"></script> | 2 <script src="../../../resources/js-test.js"></script> |
3 <style> | 3 <style> |
4 #sibling, #child { background-color: green } | 4 #sibling, #child { background-color: green } |
5 custom-one:unresolved #child, custom-two:unresolved + #sibling { background-colo
r: red } | 5 custom-one:unresolved #child, custom-two:unresolved + #sibling { background-colo
r: red } |
6 </style> | 6 </style> |
7 | 7 |
8 <custom-one> | 8 <custom-one> |
9 <div></div> | 9 <div></div> |
10 <div id="child"></div> | 10 <div id="child"></div> |
(...skipping 14 matching lines...) Expand all Loading... |
25 // Initially :unresolved. | 25 // Initially :unresolved. |
26 shouldBe("getComputedStyle(child).backgroundColor", "red"); | 26 shouldBe("getComputedStyle(child).backgroundColor", "red"); |
27 shouldBe("getComputedStyle(sibling).backgroundColor", "red"); | 27 shouldBe("getComputedStyle(sibling).backgroundColor", "red"); |
28 | 28 |
29 document.body.offsetTop; // force recalc | 29 document.body.offsetTop; // force recalc |
30 | 30 |
31 var CustomOne = document.registerElement("custom-one", { prototype: Object.creat
e(HTMLElement.prototype) }); | 31 var CustomOne = document.registerElement("custom-one", { prototype: Object.creat
e(HTMLElement.prototype) }); |
32 document.head.appendChild(new CustomOne()); | 32 document.head.appendChild(new CustomOne()); |
33 | 33 |
34 if (window.internals) | 34 if (window.internals) |
35 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); | 35 shouldBe("internals.updateStyleAndLayoutAndReturnAffectedElementCount()", "1
"); |
36 shouldBe("getComputedStyle(child).backgroundColor", "green"); | 36 shouldBe("getComputedStyle(child).backgroundColor", "green"); |
37 | 37 |
38 document.body.offsetTop; // force recalc | 38 document.body.offsetTop; // force recalc |
39 | 39 |
40 var CustomTwo = document.registerElement("custom-two", { prototype: Object.creat
e(HTMLElement.prototype) }); | 40 var CustomTwo = document.registerElement("custom-two", { prototype: Object.creat
e(HTMLElement.prototype) }); |
41 document.head.appendChild(new CustomTwo()); | 41 document.head.appendChild(new CustomTwo()); |
42 | 42 |
43 if (window.internals) | 43 if (window.internals) |
44 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); | 44 shouldBe("internals.updateStyleAndLayoutAndReturnAffectedElementCount()", "1
"); |
45 shouldBe("getComputedStyle(sibling).backgroundColor", "green"); | 45 shouldBe("getComputedStyle(sibling).backgroundColor", "green"); |
46 | 46 |
47 </script> | 47 </script> |
OLD | NEW |