Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(670)

Unified Diff: third_party/WebKit/LayoutTests/fast/css/invalidation/lang-pseudo.html

Issue 1485363002: Use invalidation sets for :lang changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Another rebase Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css/invalidation/lang-pseudo-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css/invalidation/lang-pseudo-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698