Index: third_party/WebKit/LayoutTests/fast/css/invalidation/lang-pseudo.html |
diff --git a/third_party/WebKit/LayoutTests/fast/css/invalidation/lang-pseudo.html b/third_party/WebKit/LayoutTests/fast/css/invalidation/lang-pseudo.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a2502576820f331420a1715efcde5ba40a7751da |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/css/invalidation/lang-pseudo.html |
@@ -0,0 +1,49 @@ |
+<!DOCTYPE html> |
+<script src="../../../resources/js-test.js"></script> |
+<style> |
+:lang(no), :lang(no) + div > span, |
+:lang(en), :lang(en) + div > span { background-color: green } |
+</style> |
+<div id="norwegian"></div> |
+<div> |
+ <div></div> |
+ <div></div> |
+ <div></div> |
+ <span id="nospan"></span> |
+</div> |
+<div id="english"></div> |
+<div> |
+ <div></div> |
+ <div></div> |
+ <div></div> |
+ <span id="enspan"></span> |
+</div> |
+<script> |
+description("Use descendant invalidation set for :lang pseudo class.") |
+ |
+var transparent = "rgba(0, 0, 0, 0)"; |
+var green = "rgb(0, 128, 0)"; |
+ |
+shouldBe("getComputedStyle(norwegian).backgroundColor", "transparent"); |
+shouldBe("getComputedStyle(nospan).backgroundColor", "transparent"); |
+shouldBe("getComputedStyle(english).backgroundColor", "transparent"); |
+shouldBe("getComputedStyle(enspan).backgroundColor", "transparent"); |
+ |
+document.documentElement.offsetTop; // Force recalc. |
+norwegian.lang = "no"; |
+ |
+if (window.internals) |
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2"); |
+ |
+shouldBe("getComputedStyle(norwegian).backgroundColor", "green"); |
+shouldBe("getComputedStyle(nospan).backgroundColor", "green"); |
+ |
+document.documentElement.offsetTop; // Force recalc. |
+english.setAttributeNS("http://www.w3.org/XML/1998/namespace", "lang", "en"); |
+ |
+if (window.internals) |
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2"); |
+ |
+shouldBe("getComputedStyle(english).backgroundColor", "green"); |
+shouldBe("getComputedStyle(enspan).backgroundColor", "green"); |
+</script> |