OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/js-test.js"></script> |
| 3 <style> |
| 4 :lang(no), :lang(no) + div > span, |
| 5 :lang(en), :lang(en) + div > span { background-color: green } |
| 6 </style> |
| 7 <div id="norwegian"></div> |
| 8 <div> |
| 9 <div></div> |
| 10 <div></div> |
| 11 <div></div> |
| 12 <span id="nospan"></span> |
| 13 </div> |
| 14 <div id="english"></div> |
| 15 <div> |
| 16 <div></div> |
| 17 <div></div> |
| 18 <div></div> |
| 19 <span id="enspan"></span> |
| 20 </div> |
| 21 <script> |
| 22 description("Use descendant invalidation set for :lang pseudo class.") |
| 23 |
| 24 var transparent = "rgba(0, 0, 0, 0)"; |
| 25 var green = "rgb(0, 128, 0)"; |
| 26 |
| 27 shouldBe("getComputedStyle(norwegian).backgroundColor", "transparent"); |
| 28 shouldBe("getComputedStyle(nospan).backgroundColor", "transparent"); |
| 29 shouldBe("getComputedStyle(english).backgroundColor", "transparent"); |
| 30 shouldBe("getComputedStyle(enspan).backgroundColor", "transparent"); |
| 31 |
| 32 document.documentElement.offsetTop; // Force recalc. |
| 33 norwegian.lang = "no"; |
| 34 |
| 35 if (window.internals) |
| 36 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2"); |
| 37 |
| 38 shouldBe("getComputedStyle(norwegian).backgroundColor", "green"); |
| 39 shouldBe("getComputedStyle(nospan).backgroundColor", "green"); |
| 40 |
| 41 document.documentElement.offsetTop; // Force recalc. |
| 42 english.setAttributeNS("http://www.w3.org/XML/1998/namespace", "lang", "en"); |
| 43 |
| 44 if (window.internals) |
| 45 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2"); |
| 46 |
| 47 shouldBe("getComputedStyle(english).backgroundColor", "green"); |
| 48 shouldBe("getComputedStyle(enspan).backgroundColor", "green"); |
| 49 </script> |
OLD | NEW |