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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/selection/move-left-right.html

Issue 2697313005: Selection API: collapse() should recreate an internal Range. (Closed)
Patch Set: Add NeedsRebaseline for platform-dependent tests 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 <head> 1 <head>
2 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 2 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
3 <style> 3 <style>
4 div.test { 4 div.test {
5 -webkit-user-modify: read-write; 5 -webkit-user-modify: read-write;
6 padding: 4px; 6 padding: 4px;
7 border: 1px dashed lightblue; 7 border: 1px dashed lightblue;
8 margin: 4px 4px 4px 24px; 8 margin: 4px 4px 4px 24px;
9 outline: none; 9 outline: none;
10 font-family: Lucida Grande; 10 font-family: Lucida Grande;
(...skipping 23 matching lines...) Expand all
34 if (!window.textInputController) 34 if (!window.textInputController)
35 return { x: 0, y :0 }; 35 return { x: 0, y :0 };
36 var caretRect = textInputController.firstRectForCharacterRange(textI nputController.selectedRange()[0], 0); 36 var caretRect = textInputController.firstRectForCharacterRange(textI nputController.selectedRange()[0], 0);
37 return { x: caretRect[0], y: caretRect[1] }; 37 return { x: caretRect[0], y: caretRect[1] };
38 } 38 }
39 39
40 function positionsMovingInDirection(sel, direction) 40 function positionsMovingInDirection(sel, direction)
41 { 41 {
42 var positions = []; 42 var positions = [];
43 while (true) { 43 while (true) {
44 positions.push({ node: sel.anchorNode, offset: sel.anchorOffset, point: caretCoordinates() }); 44 positions.push({ node: internals.visibleSelectionAnchorNode, off set: internals.visibleSelectionAnchorOffset, point: caretCoordinates() });
45 sel.modify("move", direction, "character"); 45 sel.modify("move", direction, "character");
46 if (positions[positions.length - 1].node == sel.anchorNode && po sitions[positions.length - 1].offset == sel.anchorOffset) 46 if (positions[positions.length - 1].node == internals.visibleSel ectionAnchorNode && positions[positions.length - 1].offset == internals.visibleS electionAnchorOffset)
47 break; 47 break;
48 }; 48 };
49 return positions; 49 return positions;
50 } 50 }
51 51
52 function fold(string) 52 function fold(string)
53 { 53 {
54 var result = ""; 54 var result = "";
55 for (var i = 0; i < string.length; ++i) { 55 for (var i = 0; i < string.length; ++i) {
56 var char = string.charCodeAt(i); 56 var char = string.charCodeAt(i);
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 <!-- -->דהו</div> 352 <!-- -->דהו</div>
353 353
354 <div class="test"> 354 <div class="test">
355 <span dir="rtl">abcקקק123נננdef</span> 355 <span dir="rtl">abcקקק123נננdef</span>
356 </div> 356 </div>
357 357
358 </div> 358 </div>
359 359
360 <pre id="console"></pre> 360 <pre id="console"></pre>
361 </body> 361 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698