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

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

Issue 1458363003: Remove extraneous SubtreeStyleChange for min/maxlength changes. (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/valid-invalid-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/valid-invalid-pseudo.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/invalidation/valid-invalid-pseudo.html b/third_party/WebKit/LayoutTests/fast/css/invalidation/valid-invalid-pseudo.html
index b39c788043c72edfecdcecf782b93921c24897c1..b90b2aba6c3a69b5f4b4fb5b2dea9145004d6098 100644
--- a/third_party/WebKit/LayoutTests/fast/css/invalidation/valid-invalid-pseudo.html
+++ b/third_party/WebKit/LayoutTests/fast/css/invalidation/valid-invalid-pseudo.html
@@ -5,7 +5,9 @@ input { background-color: transparent }
#inputValid:valid,
#inputInvalid:invalid,
#formValid:valid,
-#formInvalid:invalid {
+#formInvalid:invalid,
+#maxlengthInvalid:invalid,
+#minlengthInvalid:invalid {
background-color: green
}
@@ -42,6 +44,16 @@ input + div {
<div></div>
<div></div>
</div>
+<input id="maxlengthInvalid" type="text"></input>
+<div>
+ <div></div>
+ <div></div>
+</div>
+<input id="minlengthInvalid" type="text"></input>
+<div>
+ <div></div>
+ <div></div>
+</div>
<script>
description("Use descendant invalidation sets for :valid and :invalid pseudo classes.")
@@ -77,4 +89,27 @@ if (window.internals)
shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2");
shouldBe("getComputedStyle(formInvalid, '').backgroundColor", "green");
+// Make sure the value is user input, otherwise setting maxlength/minlength
+// won't cause a validation.
+if (window.eventSender) {
+ maxlengthInvalid.focus();
+ eventSender.keyDown("x");
+ eventSender.keyDown("x");
+ minlengthInvalid.focus();
+ eventSender.keyDown("x");
+}
+
+shouldBe("getComputedStyle(maxlengthInvalid, '').backgroundColor", "transparent");
+document.body.offsetTop; // Force recalc.
+maxlengthInvalid.setAttribute("maxlength", "1");
+if (window.internals)
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1");
+shouldBe("getComputedStyle(maxlengthInvalid, '').backgroundColor", "green");
+
+shouldBe("getComputedStyle(minlengthInvalid, '').backgroundColor", "transparent");
+document.body.offsetTop; // Force recalc.
+minlengthInvalid.setAttribute("minlength", "2");
+if (window.internals)
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1");
+shouldBe("getComputedStyle(minlengthInvalid, '').backgroundColor", "green");
</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css/invalidation/valid-invalid-pseudo-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698