OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/js-test.js"></script> |
| 3 <style> |
| 4 #before::before, #after::after { content: attr(my-value); } |
| 5 </style> |
| 6 <div id="before"> |
| 7 <div></div> |
| 8 <div> |
| 9 <div></div> |
| 10 </div> |
| 11 </div> |
| 12 <div id="after"> |
| 13 <div></div> |
| 14 <div> |
| 15 <div></div> |
| 16 </div> |
| 17 </div> |
| 18 <script> |
| 19 description("No subtree recalc when changing attribute used in generated content
."); |
| 20 |
| 21 document.body.offsetTop; // force layout |
| 22 |
| 23 // Setting attribute neither used in attribute selectors nor content should not |
| 24 // cause a recalc. |
| 25 |
| 26 before.setAttribute("attr-unused", "unused"); |
| 27 if (window.internals) |
| 28 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "0"); |
| 29 |
| 30 document.body.offsetTop; // force layout |
| 31 |
| 32 before.setAttribute("my-value", "before"); |
| 33 if (window.internals) |
| 34 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2"); |
| 35 |
| 36 document.body.offsetTop; // force layout |
| 37 |
| 38 after.setAttribute("my-value", "after"); |
| 39 if (window.internals) |
| 40 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2"); |
| 41 </script> |
OLD | NEW |