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

Unified Diff: LayoutTests/fast/css/nth-child-no-mutations.html

Issue 198783003: Recalc sibling styles for forward positional rules on mutations only. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed review issue. 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/nth-child-no-mutations-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/css/nth-child-no-mutations.html
diff --git a/LayoutTests/fast/css/nth-child-no-mutations.html b/LayoutTests/fast/css/nth-child-no-mutations.html
new file mode 100644
index 0000000000000000000000000000000000000000..f18919eaca3df4d3f30ef499e895d7a134dee899
--- /dev/null
+++ b/LayoutTests/fast/css/nth-child-no-mutations.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<script src="../../resources/js-test.js"></script>
+<style>
+ #test :nth-child(odd) { color: green; }
+ #test :not(.a) { color: rgb(200, 200, 200); }
+</style>
+<div id="test">
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+</div>
+<script>
+description("Not necessary to recalc sibling styles for :nth-child when no mutations have happened.");
+
+document.body.offsetTop;
+
+var testElm = document.querySelector("#test div");
+testElm.className = "a";
+
+if (window.internals)
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1");
+
+var green = "rgb(0, 128, 0)";
+shouldBe("getComputedStyle(testElm, null).color", "green");
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/css/nth-child-no-mutations-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698