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

Unified Diff: LayoutTests/fast/forms/tooLong-check-on-cloned-textcontrol.html

Issue 1134593004: Reapply the patch r191685 with fixing the regression issue. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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
Index: LayoutTests/fast/forms/tooLong-check-on-cloned-textcontrol.html
diff --git a/LayoutTests/fast/forms/tooLong-check-on-cloned-textcontrol.html b/LayoutTests/fast/forms/tooLong-check-on-cloned-textcontrol.html
new file mode 100644
index 0000000000000000000000000000000000000000..cace2db9975d5c8dd7a58a0f706cf6edc98d85b5
--- /dev/null
+++ b/LayoutTests/fast/forms/tooLong-check-on-cloned-textcontrol.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test.js"></script>
+<script>
+ function deleteChar(target) {
+ target.focus();
+ target.setSelectionRange(7, 7);
+ if (window.testRunner) {
+ eventSender.keyDown("backspace", []);
+ }
+ target.blur();
+ }
+
+ function validate(evt) {
+ var node = evt.target;
+ var cloneNode = node.cloneNode();
+ var result = node.validity.tooLong == cloneNode.validity.tooLong;
+ log(result, node.nodeName.toLowerCase());
+ }
+
+ function log(msg, consoleName) {
+ var console = document.getElementById(consoleName + "Console" );
+ console.innerHTML = console.innerHTML + msg + "<br>";
+ }
+
+ function startTest() {
+ deleteChar(document.getElementById("input"));
+ deleteChar(document.getElementById("textarea"));
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }
+
+ if (window.testRunner)
+ testRunner.waitUntilDone();
+
+</script>
+</head>
+<body onload="startTest()">
+
+<input type="text" id="input" maxlength=4 value="sampletext" onchange="validate(event)"/>
+<div id="inputConsole">Input : validity.tooLong is equal for node and cloned node=</div>
+
+<textarea id="textarea" maxlength=4 onchange="validate(event)">sampletext</textarea>
+<div id="textareaConsole">Textarea: validity.tooLong is equal for node and cloned node=</div>
+
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698