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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/selection/vertical-rl-rtl-extend-line-backward-br.html

Issue 1466543003: Use w3c test harness in editing/selection/vertical-*.html tests 3/3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2015-11-24T15:09:03 Created 5 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 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <meta charset="utf-8">
3 <head> 3 <script src="../../resources/testharness.js"></script>
4 <meta http-equiv="content-type" content="text/html; charset=utf-8"> 4 <script src="../../resources/testharnessreport.js"></script>
5 <style> .selected { color: blue; } </style>
6 </head>
7 <body>
8 <p>This tests horizontal caret movement in vertical writing mode.</p> 5 <p>This tests horizontal caret movement in vertical writing mode.</p>
9 <div id="test" style="font-family: monospace; font-size: 20px; height: 15ex; -we bkit-writing-mode: vertical-rl;-webkit-text-orientation:sideways-right;text-rend ering:optimizeLegibility; outline: none;" contenteditable> 6 <div id="test" style="font-family: monospace; font-size: 20px; height: 15ex; -we bkit-writing-mode: vertical-rl;-webkit-text-orientation:sideways-right;text-rend ering:optimizeLegibility; outline: none;" contenteditable>
10 <p dir="rtl">אני חתול.<br>אין לי שם.</p> 7 <p id="p1" dir="rtl">אני חתול.<br>אין לי שם.</p>
11 </div> 8 </div>
12 <pre id="log"></pre> 9 <div id="log"></div>
13 <script> 10 <script>
11 test(function() {
12 var selection = window.getSelection();
13 var p1 = document.getElementById('p1');
14 selection.collapse(p1.lastChild, 5);
15 selection.modify('Extend', 'Backward', 'Line');
14 16
15 var test = document.getElementById('test'); 17 assert_false(selection.isCollapsed, 'isCollapsed');
16 window.getSelection().collapse(test.getElementsByTagName('p')[0].lastChild, 5); 18 assert_equals(selection.anchorNode, p1.lastChild, 'anchorNode');
17 window.getSelection().modify('Extend', 'Backward', 'Line'); 19 assert_equals(selection.anchorOffset, 5, 'anchorOffset');
18 20 assert_equals(selection.focusNode, p1.firstChild, 'focusNode');
21 assert_equals(selection.focusOffset, 5, 'focusOffset');
22 });
19 </script> 23 </script>
20 </body>
21 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698