Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / invalidation / content-attr.html
blob19e76b72a51607900d74a7e0d07c352f7622a3ec
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.");
21 document.body.offsetTop; // force layout
23 // Setting attribute neither used in attribute selectors nor content should not
24 // cause a recalc.
26 before.setAttribute("attr-unused", "unused");
27 if (window.internals)
28 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "0");
30 document.body.offsetTop; // force layout
32 before.setAttribute("my-value", "before");
33 if (window.internals)
34 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2");
36 document.body.offsetTop; // force layout
38 after.setAttribute("my-value", "after");
39 if (window.internals)
40 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2");
41 </script>