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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/52776.html

Issue 2709983005: Selection API: Do not change focus by Selection functions. (Closed)
Patch Set: . 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 <head> 3 <head>
4 <META http-equiv="Content-Type" content="text/html; charset=utf-8"> 4 <META http-equiv="Content-Type" content="text/html; charset=utf-8">
5 </head> 5 </head>
6 <body> 6 <body>
7 <div dir=rtl> 7 <div dir=rtl>
8 <p>Right To Left 8 <p>Right To Left
9 9
10 <p>Well-formed pair of unicode bidi control characters. 10 <p>Well-formed pair of unicode bidi control characters.
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 function assertEqual(message, actual, expected) 103 function assertEqual(message, actual, expected)
104 { 104 {
105 if (actual != expected) 105 if (actual != expected)
106 log("\n" + message + ": Failure, actual: " + actual + "; expected: " + expected); 106 log("\n" + message + ": Failure, actual: " + actual + "; expected: " + expected);
107 else 107 else
108 log("\n" + message + ": Success"); 108 log("\n" + message + ": Success");
109 } 109 }
110 110
111 var test = document.getElementById('test'); 111 var test = document.getElementById('test');
112 var sel = getSelection(); 112 var sel = getSelection();
113 sel.collapse(test,0); 113 test.focus();
114 sel.collapse(test, 0);
114 sel.modify("move", "right", "lineBoundary"); 115 sel.modify("move", "right", "lineBoundary");
115 sel.modify("move", "left", "character"); 116 sel.modify("move", "left", "character");
116 sel.modify("extend", "left", "character"); 117 sel.modify("extend", "left", "character");
117 assertEqual("test id=test: the right-most character of rendering result of < PDF>abc<PDF> in RTL block should be c", sel.toString(), 'c'); 118 assertEqual("test id=test: the right-most character of rendering result of < PDF>abc<PDF> in RTL block should be c", sel.toString(), 'c');
118 </script> 119 </script>
119 </body> 120 </body>
120 </html> 121 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698