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

Unified Diff: third_party/WebKit/LayoutTests/fast/forms/text/text-change-event-after-clear-in-submit.html

Issue 2756483005: Merge "INPUT element: Implicit form submission should reset setTextAsOfLastFormControlChangeEvent e… (Closed)
Patch Set: Created 3 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 | third_party/WebKit/Source/core/html/HTMLInputElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/forms/text/text-change-event-after-clear-in-submit.html
diff --git a/third_party/WebKit/LayoutTests/fast/forms/text/text-change-event-after-clear-in-submit.html b/third_party/WebKit/LayoutTests/fast/forms/text/text-change-event-after-clear-in-submit.html
index 29983153e64862e987c5acdc42281ed07e7aea5c..938a42f4f45e8780a91d351d02c7ce6f1655e266 100644
--- a/third_party/WebKit/LayoutTests/fast/forms/text/text-change-event-after-clear-in-submit.html
+++ b/third_party/WebKit/LayoutTests/fast/forms/text/text-change-event-after-clear-in-submit.html
@@ -3,6 +3,7 @@
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<form><input><input type=submit></form>
+<input id="target2">
<script>
test(() => {
assert_exists(window, 'eventSender');
@@ -29,5 +30,25 @@ test(() => {
assert_equals(lastChangeValue, 'f', 'The second submission should trigger change event.');
}, 'Clearing INPUT value in submit event handler should not prevent next change event. crbug.com/695349');
+
+test(() => {
+ assert_exists(window, 'eventSender');
+ let text = document.querySelector('#target2');
+ var lastChangeValue = '';
+ text.addEventListener('change', () => { lastChangeValue = text.value; text.value = ''; });
+
+ text.focus();
+ eventSender.keyDown('f');
+ eventSender.keyDown('Enter'); // Trigger implicit submission
+ assert_equals(lastChangeValue, 'f');
+ lastChangeValue = null;
+ assert_equals(document.activeElement, text);
+ assert_equals(text.value, '');
+
+ eventSender.keyDown('f');
+ eventSender.keyDown('Enter'); // Trigger implicit submission again.
+ assert_equals(lastChangeValue, 'f', 'The second submission should trigger change event.');
+
+}, 'Clearing INPUT value in change event handler triggered by implicit form submission should not prevent next change event. crbug.com/700842');
</script>
</body>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLInputElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698