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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/execCommand/transpose-backslash-with-euc.html

Issue 2686663004: Selection API: Selection.extend() should throw if rangeCount is 0. (Closed)
Patch Set: focus() -> collapse() Created 3 years, 10 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 3
4 <head> 4 <head>
5 <meta charset="EUC-JP"> 5 <meta charset="EUC-JP">
6 <script> 6 <script>
7 7
8 if (window.testRunner) 8 if (window.testRunner)
9 testRunner.dumpAsText(); 9 testRunner.dumpAsText();
10 10
11 function test() 11 function test()
12 { 12 {
13 var backslashDivElement = document.getElementById("backslash"); 13 var backslashDivElement = document.getElementById("backslash");
14 getSelection().collapse(backslashDivElement, 0);
14 getSelection().extend(backslashDivElement, 1); 15 getSelection().extend(backslashDivElement, 1);
15 document.execCommand("Transpose"); 16 document.execCommand("Transpose");
16 17
17 // 92 is the char code of a backslash. 18 // 92 is the char code of a backslash.
18 var backslash = 92; 19 var backslash = 92;
19 if (backslash == backslashDivElement.innerHTML.charCodeAt(0) && backslash == backslashDivElement.innerHTML.charCodeAt(1)) 20 if (backslash == backslashDivElement.innerHTML.charCodeAt(0) && backslash == backslashDivElement.innerHTML.charCodeAt(1))
20 document.getElementById("result").innerHTML = "PASS"; 21 document.getElementById("result").innerHTML = "PASS";
21 } 22 }
22 23
23 </script> 24 </script>
24 </head> 25 </head>
25 26
26 <body onload="test()"> 27 <body onload="test()">
27 28
28 <div id="backslash" contentEditable="true">\\</div> 29 <div id="backslash" contentEditable="true">\\</div>
29 30
30 <div id="result">FAIL</div> 31 <div id="result">FAIL</div>
31 32
32 </body> 33 </body>
33 34
34 </html> 35 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698