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

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

Issue 2285613002: Fix selectionDirection attribute value of INPUT/TEXTAREA just after creation (Closed)
Patch Set: 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 21 matching lines...) Expand all
32 assertDirection(expectedDirection, element, 'hiding the element'); 32 assertDirection(expectedDirection, element, 'hiding the element');
33 element.style.display = null; 33 element.style.display = null;
34 } 34 }
35 35
36 function runTest(element, platform) { 36 function runTest(element, platform) {
37 debug(element.localName + ' on ' + platform); 37 debug(element.localName + ' on ' + platform);
38 element.focus(); 38 element.focus();
39 39
40 var noneOnMacAndForwardOnOthers = (platform == 'Mac') ? 'none' : 'forward'; 40 var noneOnMacAndForwardOnOthers = (platform == 'Mac') ? 'none' : 'forward';
41 41
42 var newElement = document.createElement(element.tagName);
43 assertDirection(noneOnMacAndForwardOnOthers, newElement, 'just creating');
44
42 element.setSelectionRange(1, 2); 45 element.setSelectionRange(1, 2);
43 assertDirection(noneOnMacAndForwardOnOthers, element, 'focusing and setting selection by setSelectionRange(1, 2)'); 46 assertDirection(noneOnMacAndForwardOnOthers, element, 'focusing and setting selection by setSelectionRange(1, 2)');
44 testCache(noneOnMacAndForwardOnOthers, element); 47 testCache(noneOnMacAndForwardOnOthers, element);
45 48
46 element.focus(); 49 element.focus();
47 element.setSelectionRange(1, 2, 'forward'); 50 element.setSelectionRange(1, 2, 'forward');
48 assertDirection('forward', element, 'focusing and setting selection by setSe lectionRange(1, 2, "forward")'); 51 assertDirection('forward', element, 'focusing and setting selection by setSe lectionRange(1, 2, "forward")');
49 testCache('forward', element); 52 testCache('forward', element);
50 53
51 element.setSelectionRange(1, 2, 'backward'); 54 element.setSelectionRange(1, 2, 'backward');
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 runTestFor('Unix'); 101 runTestFor('Unix');
99 } else 102 } else
100 runTestFor(navigator.platform.indexOf('Mac') >= 0 ? 'Mac' : 'Win'); 103 runTestFor(navigator.platform.indexOf('Mac') >= 0 ? 'Mac' : 'Win');
101 104
102 tests.style.display = 'none'; 105 tests.style.display = 'none';
103 dummy.parentNode.style.display = 'none'; 106 dummy.parentNode.style.display = 'none';
104 107
105 </script> 108 </script>
106 </body> 109 </body>
107 </html> 110 </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