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

Side by Side 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: Addressing changes asked in previous patch Created 6 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <input id="val1" type="text" />
8 <input id="val2" type="text" />
9 <script type="text/javascript">
10 description('Test for BUG=367736: Blink does not respect input.selectionStart an d input.selectionEnd for some cases.');
11 var firstInput = document.getElementById('val1');
12 var secondInput = document.getElementById('val2');
13 firstInput.selectionStart = 2;
14 firstInput.selectionEnd = 3;
15 // Initially input field is empty so selectionStart and selectionEnd set above b ecomes 0
16 firstInput.value = 'Parsed';
17 shouldBe('firstInput.selectionStart', '0');
18 shouldBe('firstInput.selectionEnd', '0');
19 firstInput.selectionStart = 3;
20 firstInput.selectionEnd = 5;
21 shouldBe('firstInput.selectionStart', '3');
22 shouldBe('firstInput.selectionEnd', '5');
23 secondInput.value = 'P';
24 secondInput.selectionStart = 3;
25 secondInput.selectionEnd = 5;
26 shouldBe('secondInput.selectionStart', '1');
27 shouldBe('secondInput.selectionEnd', '1');
28 secondInput.value = 'Parsed';
29 shouldBe('secondInput.selectionStart', '1');
30 shouldBe('secondInput.selectionEnd', '1');
31 </script>
32 </body>
33 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698