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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/forms/selection-direction.html

Issue 2277903003: Fix selectionDirection after setting value of TEXTAREA/INPUT. (Closed)
Patch Set: Revert DCHECK_LE Created 4 years, 3 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/forms/selection-direction-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../resources/js-test.js"></script> 4 <script src="../../resources/js-test.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <p id="description"></p> 7 <p id="description"></p>
8 <div><input id="dummy"></div> 8 <div><input id="dummy"></div>
9 <div id="tests"><input value="hello"><textarea>hello</textarea></div> 9 <div id="tests"><input value="hello"><textarea>hello</textarea></div>
10 <div id="console"></div> 10 <div id="console"></div>
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 window.getSelection().modify('extend', 'forward', 'character'); 70 window.getSelection().modify('extend', 'forward', 'character');
71 assertDirection('forward', element, 'extending selection forward by characte r'); 71 assertDirection('forward', element, 'extending selection forward by characte r');
72 testCache('forward', element); 72 testCache('forward', element);
73 73
74 element.focus(); 74 element.focus();
75 element.setSelectionRange(1, 1); 75 element.setSelectionRange(1, 1);
76 window.getSelection().modify('extend', 'backward', 'character'); 76 window.getSelection().modify('extend', 'backward', 'character');
77 assertDirection('backward', element, 'extending selection backward by charac ter'); 77 assertDirection('backward', element, 'extending selection backward by charac ter');
78 testCache('backward', element); 78 testCache('backward', element);
79 79
80 element.blur();
81 element.value = element.value + 'foo';
82 assertDirection(noneOnMacAndForwardOnOthers, element, 'updating value');
80 } 83 }
81 84
82 function runTestFor(platform) { 85 function runTestFor(platform) {
83 if (window.internals) 86 if (window.internals)
84 internals.settings.setEditingBehavior(platform.toLowerCase()); 87 internals.settings.setEditingBehavior(platform.toLowerCase());
85 var tests = document.getElementById('tests'); 88 var tests = document.getElementById('tests');
86 for (var i = 0; i < tests.childNodes.length; i++) { 89 for (var i = 0; i < tests.childNodes.length; i++) {
87 runTest(tests.childNodes[i], platform); 90 runTest(tests.childNodes[i], platform);
88 debug(''); 91 debug('');
89 } 92 }
90 } 93 }
91 94
92 if (window.internals) { 95 if (window.internals) {
93 runTestFor('Mac'); 96 runTestFor('Mac');
94 runTestFor('Win'); 97 runTestFor('Win');
95 runTestFor('Unix'); 98 runTestFor('Unix');
96 } else 99 } else
97 runTestFor(navigator.platform.indexOf('Mac') >= 0 ? 'Mac' : 'Win'); 100 runTestFor(navigator.platform.indexOf('Mac') >= 0 ? 'Mac' : 'Win');
98 101
99 tests.style.display = 'none'; 102 tests.style.display = 'none';
100 dummy.parentNode.style.display = 'none'; 103 dummy.parentNode.style.display = 'none';
101 104
102 </script> 105 </script>
103 </body> 106 </body>
104 </html> 107 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/forms/selection-direction-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698