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

Unified Diff: LayoutTests/fast/forms/input-set-selectionStart-set-selectionEnd.html

Issue 258063005: Blink does not respect input.selectionStart and input.selectionEnd for some cases (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: New patch fixing existing bug Created 6 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
Index: LayoutTests/fast/forms/input-set-selectionStart-set-selectionEnd.html
diff --git a/LayoutTests/fast/forms/input-set-selectionStart-set-selectionEnd.html b/LayoutTests/fast/forms/input-set-selectionStart-set-selectionEnd.html
new file mode 100644
index 0000000000000000000000000000000000000000..3ac88618d0fd1b0fc3ea601770a81b57e93d9458
--- /dev/null
+++ b/LayoutTests/fast/forms/input-set-selectionStart-set-selectionEnd.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test.js"></script>
+</head>
+<body>
+<input id="val1" type="text" />
+<input id="val2" type="text" />
+<script type="text/javascript">
+description('Test for BUG=367736: Blink does not respect input.selectionStart and input.selectionEnd for some cases.');
+var firstInput = document.getElementById('val1');
+var secondInput = document.getElementById('val2');
+firstInput.selectionStart = 3;
+firstInput.selectionEnd = 5;
+firstInput.value = 'Parsed';
+shouldBe('firstInput.selectionStart', '3');
+shouldBe('firstInput.selectionEnd', '5');
+secondInput.selectionStart = 3;
+secondInput.selectionEnd = 5;
+secondInput.value = 'P';
+shouldBe('secondInput.selectionStart', '1');
+shouldBe('secondInput.selectionEnd', '1');
+secondInput.value = 'Parsed';
+shouldBe('secondInput.selectionStart', '1');
+shouldBe('secondInput.selectionEnd', '1');
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698