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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/style/justify-left-crash.html

Issue 2680943004: Make FrameSelection to hold non-canonicalized positions (Closed)
Patch Set: 2014-02-14T23:34:22 Update TestExpectation to include extend-{0,2,4}0.html and selectAllChildren.html 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 hidden> 2 <html hidden>
3 <head> 3 <head>
4 <script src="../../resources/testharness.js"></script> 4 <script src="../../resources/testharness.js"></script>
5 <script src="../../resources/testharnessreport.js"></script> 5 <script src="../../resources/testharnessreport.js"></script>
6 <style> 6 <style>
7 html, head, style { 7 html, head, style {
8 display: block; 8 display: block;
9 } 9 }
10 </style> 10 </style>
11 </head> 11 </head>
12 <body> 12 <body>
13 <div id="sample">foo</div> 13 <div id="sample">foo</div>
14 <script> 14 <script>
15 document.designMode = 'on'; 15 document.designMode = 'on';
16 document.execCommand('selectAll'); 16 document.execCommand('selectAll');
17 document.execCommand('italic'); 17 document.execCommand('italic');
18 document.execCommand('justifyLeft'); 18 document.execCommand('justifyLeft');
19 document.documentElement.removeAttribute('hidden'); 19 document.documentElement.removeAttribute('hidden');
20 20
21 test(() => { 21 test(() => {
22 var sample = document.getElementById('sample'); 22 var sample = document.getElementById('sample');
23 assert_equals(sample.innerHTML, '<i>foo</i>'); 23 assert_equals(sample.innerHTML, '<i>foo</i>');
24 // TODO(yosin): Once we do lazy visible position canonicalization, 24 const selection = window.getSelection();
25 // we should have a caret. 25 assert_equals(selection.anchorNode, sample.firstChild.firstChild, 'ancho rNode');
26 assert_equals(getSelection().rangeCount, 0); 26 assert_equals(selection.anchorOffset, 0, 'anchorOffset');
27 assert_equals(selection.focusNode, sample.firstChild.firstChild, 'focusN ode');
28 assert_equals(selection.focusOffset, 3, 'focusOffset');
27 }, 'This is a crash test.'); 29 }, 'This is a crash test.');
28 </script> 30 </script>
29 </body> 31 </body>
30 </html> 32 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698