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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/selection/extend-by-word-002.html

Issue 2541163003: Fix TextIterator's behavior with first-letter (Closed)
Patch Set: Change relevant bug number Created 4 years 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 <html> 1 <html>
2 <head> 2 <head>
3 3
4 <style> 4 <style>
5 .editing { 5 .editing {
6 border: 2px solid red; 6 border: 2px solid red;
7 padding: 12px; 7 padding: 12px;
8 font-size: 24px; 8 font-size: 24px;
9 } 9 }
10 .cell { 10 .cell {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 </ul> 45 </ul>
46 </div> 46 </div>
47 </div> 47 </div>
48 <!-- 48 <!--
49 Specifically checks test case in bug: 49 Specifically checks test case in bug:
50 <rdar://problem/4244976> reproducible hang at ocharleys.com in VisiblePositi on::initDownstream 50 <rdar://problem/4244976> reproducible hang at ocharleys.com in VisiblePositi on::initDownstream
51 --> 51 -->
52 <script src="../../resources/js-test.js"></script> 52 <script src="../../resources/js-test.js"></script>
53 <script> 53 <script>
54 function $(id) { return document.getElementById(id); } 54 function $(id) { return document.getElementById(id); }
55 if (window.internals) 55 if (window.internals)
yosin_UTC9 2016/12/01 09:41:42 Could you convert this test to assert_selection()
56 internals.settings.setEditingBehavior('mac'); 56 internals.settings.setEditingBehavior('mac');
57 var range = document.createRange(); 57 var range = document.createRange();
58 range.setStart($("test").querySelectorAll("li")[0], 0); 58 range.setStart($("test").querySelectorAll("li")[0], 0); // |Appetizers
59 var selection = window.getSelection(); 59 var selection = window.getSelection();
60 selection.removeAllRanges(); 60 selection.removeAllRanges();
61 selection.addRange(range); 61 selection.addRange(range);
62 for (var i = 0; i < 6; ++i) 62 for (var i = 0; i < 6; ++i)
63 selection.modify('extend', 'forward', 'word'); 63 selection.modify('extend', 'forward', 'word');
64 shouldBeEqualToString('selection.type', 'Range'); 64 shouldBeEqualToString('selection.type', 'Range');
65 shouldBe('selection.anchorNode', '$("test").querySelectorAll("li")[0].childNodes [0]'); 65 shouldBe('selection.anchorNode', '$("test").querySelectorAll("li")[0].childNodes [0]');
66 shouldBe('selection.anchorOffset', '0'); 66 shouldBe('selection.anchorOffset', '0');
67 shouldBe('selection.focusNode', '$("test").querySelectorAll("li a")[3].firstChil d'); 67 shouldBe('selection.focusNode', '$("test").querySelectorAll("li a")[3].firstChil d');
68 shouldBe('selection.focusOffset', '4'); 68 shouldBe('selection.focusOffset', '5'); // Steak| & Ribs.
69 // Note that Blink currently renders the focus at a wrong position (Steak |&)
70 // which is a known issue. See crbug.com/406218.
69 if (window.testRunner) 71 if (window.testRunner)
70 $('container').outerHTML = ''; 72 $('container').outerHTML = '';
71 </script> 73 </script>
72 </body> 74 </body>
73 </html> 75 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698