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

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

Issue 1463713002: Use w3c test harness in editing/selection/vertical-*.html tests 1/3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2015-11-20T16:47:13 Created 5 years, 1 month 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. "ある。" and "名前は まだ" must be selected.</p> 5 <p>This tests horizontal caret movement in vertical writing mode. "ある。" and "名前は まだ" must be selected.</p>
9 <div id="test" style="height: 30ex; -webkit-writing-mode: vertical-rl; outline: none;" contenteditable> 6 <div style="height: 30ex; -webkit-writing-mode: vertical-rl; outline: none;" con tenteditable>
10 <p>吾輩は猫である。</p> 7 <p id="p1">吾輩は猫である。</p>
11 <p>名前はまだ無い。</p> 8 <p id="p2">名前はまだ無い。</p>
12 </div> 9 </div>
13 <pre id="log"></pre> 10 <div id="log"></div>
14 <script> 11 <script>
12 test(function() {
13 var selection = window.getSelection();
14 var p1 = document.getElementById('p1');
15 var p2 = document.getElementById('p2');
16 selection.collapse(p2.firstChild, 5);
17 selection.modify('Extend', 'Backward', 'Line');
15 18
16 var test = document.getElementById('test'); 19 assert_false(selection.isCollapsed, 'isCollapsed');
17 window.getSelection().collapse(test.getElementsByTagName('p')[1].lastChild, 5); 20 assert_equals(selection.anchorNode, p2.firstChild, 'anchorNode');
18 window.getSelection().modify('Extend', 'Backward', 'Line'); 21 assert_equals(selection.anchorOffset, 5, 'anchorOffset');
19 22 assert_equals(selection.focusNode, p1.firstChild, 'focusNode');
23 assert_equals(selection.focusOffset, 5, 'focusOffset');
24 });
20 </script> 25 </script>
21 </body>
22 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698