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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/selection/programmatic-selection-on-mac-is-directionless.html

Issue 2270663002: Selection API of INPUT/TEXTAREA should not update FrameSelection without focusing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adjust more tests 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
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 <script src="resources/js-test-selection-shared.js"></script> 5 <script src="resources/js-test-selection-shared.js"></script>
6 </head> 6 </head>
7 <body> 7 <body>
8 <p id="description"></p> 8 <p id="description"></p>
9 <div id="console"></div> 9 <div id="console"></div>
10 10
(...skipping 22 matching lines...) Expand all
33 var selection = window.getSelection(); 33 var selection = window.getSelection();
34 selection.empty(); 34 selection.empty();
35 35
36 if (node.localName == 'div') { 36 if (node.localName == 'div') {
37 var container = node.childNodes[2]; 37 var container = node.childNodes[2];
38 var range = document.createRange(); 38 var range = document.createRange();
39 range.setStart(container, container.data.search('ine 2')); 39 range.setStart(container, container.data.search('ine 2'));
40 range.setEnd(container, range.startOffset + 'in'.length); 40 range.setEnd(container, range.startOffset + 'in'.length);
41 selection.addRange(range); 41 selection.addRange(range);
42 } else { 42 } else {
43 node.focus();
43 node.selectionDirection = 'none'; 44 node.selectionDirection = 'none';
44 node.selectionStart = node.value.search('ine 2'); 45 node.selectionStart = node.value.search('ine 2');
45 node.selectionEnd = node.selectionStart + 'in'.length; 46 node.selectionEnd = node.selectionStart + 'in'.length;
46 } 47 }
47 } 48 }
48 49
49 function runTestsAndVerify(name, selectionModifier, expectedDirection, expectedT ext) { 50 function runTestsAndVerify(name, selectionModifier, expectedDirection, expectedT ext) {
50 var currentTest = makeTest(name, selectionModifier, expectedDirection, expec tedText); 51 var currentTest = makeTest(name, selectionModifier, expectedDirection, expec tedText);
51 52
52 currentTest('no action'); 53 currentTest('no action');
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 runTestsFor('win'); 137 runTestsFor('win');
137 runTestsFor('unix'); 138 runTestsFor('unix');
138 runTestsFor('android'); 139 runTestsFor('android');
139 140
140 document.getElementById('test').innerHTML = ''; 141 document.getElementById('test').innerHTML = '';
141 } 142 }
142 143
143 </script> 144 </script>
144 </body> 145 </body>
145 </html> 146 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698