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

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

Issue 1461653002: Use invalidation sets for :unresolved. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/unresolved-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/unresolved-pseudo.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/invalidation/unresolved-pseudo.html b/third_party/WebKit/LayoutTests/fast/css/invalidation/unresolved-pseudo.html
new file mode 100644
index 0000000000000000000000000000000000000000..3fb26f92291622bde1f5d03e5589c1ae8293d2f7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/invalidation/unresolved-pseudo.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<script src="../../../resources/js-test.js"></script>
+<style>
+#sibling, #child { background-color: green }
+custom-one:unresolved #child, custom-two:unresolved + #sibling { background-color: red }
+</style>
+
+<custom-one>
+ <div></div>
+ <div id="child"></div>
+</custom-one>
+
+<custom-two>
+ <div></div>
+ <div></div>
+</custom-two>
+<div id="sibling"></div>
+
+<script>
+description("Use invalidation sets for :unresolved pseudo class.")
+
+var red = "rgb(255, 0, 0)";
+var green = "rgb(0, 128, 0)";
+
+// Initially :unresolved.
+shouldBe("getComputedStyle(child).backgroundColor", "red");
+shouldBe("getComputedStyle(sibling).backgroundColor", "red");
+
+document.body.offsetTop; // force recalc
+
+var CustomOne = document.registerElement("custom-one", { prototype: Object.create(HTMLElement.prototype) });
+document.head.appendChild(new CustomOne());
+
+if (window.internals)
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1");
+shouldBe("getComputedStyle(child).backgroundColor", "green");
+
+document.body.offsetTop; // force recalc
+
+var CustomTwo = document.registerElement("custom-two", { prototype: Object.create(HTMLElement.prototype) });
+document.head.appendChild(new CustomTwo());
+
+if (window.internals)
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1");
+shouldBe("getComputedStyle(sibling).backgroundColor", "green");
+
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css/invalidation/unresolved-pseudo-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698