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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/invalidation/read-only-write-pseudo.html

Issue 1454003002: Use invalidation sets for :read-only and :read-write. (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/read-only-write-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/read-only-write-pseudo.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/invalidation/read-only-write-pseudo.html b/third_party/WebKit/LayoutTests/fast/css/invalidation/read-only-write-pseudo.html
new file mode 100644
index 0000000000000000000000000000000000000000..77718a582b353c9b06f68fc4c0e6b3713876edac
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/invalidation/read-only-write-pseudo.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<script src="../../../resources/js-test.js"></script>
+<style>
+input { background: transparent }
+input + div { color: pink }
+#i1:read-only { background-color: green }
+#i2:read-write { background-color: green }
+</style>
+<input id="i1" type="text"></input>
+<div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+</div>
+<input id="i2" type="text" readonly></input>
+<div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+</div>
+<script>
+description("Use descendant invalidation sets for :read-only and :read-write pseudo classes.")
+
+var transparent = "rgba(0, 0, 0, 0)";
+var green = "rgb(0, 128, 0)";
+
+shouldBe("getComputedStyle(i1, '').backgroundColor", "transparent");
+shouldBe("getComputedStyle(i2, '').backgroundColor", "transparent");
+
+i1.offsetTop; // Force recalc.
+i1.setAttribute("readonly", "");
+
+if (window.internals)
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1");
+
+shouldBe("getComputedStyle(i1, '').backgroundColor", "green");
+
+i2.offsetTop; // Force recalc.
+i2.removeAttribute("readonly");
+
+if (window.internals)
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1");
+
+shouldBe("getComputedStyle(i2, '').backgroundColor", "green");
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css/invalidation/read-only-write-pseudo-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698