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

Unified Diff: third_party/WebKit/LayoutTests/fast/forms/text-control-selection-after-blur.html

Issue 2882953002: Merge "INPUT/TEXTAREA elements: Fix incorrect selectionStart/selectionEnd values after blur." to M59 (Closed)
Patch Set: Created 3 years, 7 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/LayoutTests/fast/forms/text/text-selection-after-type-change.html » ('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-control-selection-after-blur.html
diff --git a/third_party/WebKit/LayoutTests/fast/forms/text-control-selection-after-blur.html b/third_party/WebKit/LayoutTests/fast/forms/text-control-selection-after-blur.html
new file mode 100644
index 0000000000000000000000000000000000000000..6c5a4c685f4895a431f2553665b2c1dfccc1f58c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/forms/text-control-selection-after-blur.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<title>Tests for crbug.com/714425</title>
+<body>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+
+<input>
+<textarea></textarea>
+
+<script>
+function testSelectionAfterBlur(element) {
+ test(() => {
+ assert_exists(window, 'eventSender');
+ element.value = '';
+ element.focus();
+ eventSender.keyDown('a');
+ eventSender.keyDown('b');
+ eventSender.keyDown('Backspace');
+ assert_equals(element.selectionStart, 1, 'selectionStart before blur');
+ assert_equals(element.selectionEnd, 1, 'selectionEnd before blur');
+ element.blur();
+ assert_equals(element.selectionStart, 1, 'selectionStart after blur');
+ assert_equals(element.selectionEnd, 1, 'selectionEnd after blur');
+ }, `${element.tagName}: selectionStart/selectionEnd should be correct after blur()`);
+}
+
+testSelectionAfterBlur(document.querySelector('input'));
+testSelectionAfterBlur(document.querySelector('textarea'));
+</script>
+</body>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/forms/text/text-selection-after-type-change.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698