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

Unified Diff: LayoutTests/fast/css/invalidation/targeted-class-id.html

Issue 222643002: Support tag names as invalidation set features. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased. Created 6 years, 9 months 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 | LayoutTests/fast/css/invalidation/targeted-class-id-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/css/invalidation/targeted-class-id.html
diff --git a/LayoutTests/fast/css/invalidation/targeted-class-id.html b/LayoutTests/fast/css/invalidation/targeted-class-id.html
new file mode 100644
index 0000000000000000000000000000000000000000..0284da8fc5c9733354709ab50a1daca651bb180d
--- /dev/null
+++ b/LayoutTests/fast/css/invalidation/targeted-class-id.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<script src="../../../resources/js-test.js"></script>
+<style>
+.a1 #b1 { background-color: green }
+.a2 div + #b2 { background-color: green }
+</style>
+<div id="t1">
+ <div></div>
+ <div id="b1"></div>
+</div>
+<div id="t2">
+ <div></div>
+ <div id="b2"></div>
+</div>
+<script>
+description("Check that targeted class invalidation works for id selectors.");
+
+var transparent = "rgba(0, 0, 0, 0)";
+var green = "rgb(0, 128, 0)";
+
+var b1 = document.getElementById("b1");
+var b2 = document.getElementById("b2");
+
+shouldBe("getComputedStyle(b1, null).backgroundColor", "transparent");
+shouldBe("getComputedStyle(b2, null).backgroundColor", "transparent");
+
+document.body.offsetTop; // Force style recalc.
+
+document.getElementById("t1").className = "a1";
+if (window.internals)
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2");
+shouldBe("getComputedStyle(b1, null).backgroundColor", "green");
+
+document.body.offsetLeft; // force style recalc.
+
+document.getElementById("t2").className = "a2";
+if (window.internals)
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "3");
+shouldBe("getComputedStyle(b2, null).backgroundColor", "green");
+
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/css/invalidation/targeted-class-id-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698