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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/selection/select_all/select_all_iframe_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 <script src="../../../resources/testharness.js"></script> 2 <script src="../../../resources/testharness.js"></script>
3 <script src="../../../resources/testharnessreport.js"></script> 3 <script src="../../../resources/testharnessreport.js"></script>
4 <div id="sample">foo</div> 4 <div id="sample">foo</div>
5 <div id="log"></div> 5 <div id="log"></div>
6 <script> 6 <script>
7 var test = async_test('Remove IFRAME in load event handler should not crash'); 7 var test = async_test('Remove IFRAME in load event handler should not crash');
8 var sample = document.getElementById('sample'); 8 var sample = document.getElementById('sample');
9 var iframe = document.createElement('iframe'); 9 var iframe = document.createElement('iframe');
10 iframe.srcdoc = 'foo'; 10 iframe.srcdoc = 'foo';
11 iframe.onload = function () { 11 iframe.onload = function () {
12 document.execCommand('selectAll'); 12 document.execCommand('selectAll');
13 iframe.remove(); 13 iframe.remove();
14 window.setTimeout(function() { 14 window.setTimeout(function() {
15 test.step(function() { 15 test.step(function() {
16 var selection = window.getSelection(); 16 var selection = window.getSelection();
17 assert_equals(selection.anchorNode, sample.firstChild, 'anchorNode') ; 17 assert_equals(selection.anchorNode, sample.firstChild, 'anchorNode') ;
18 assert_equals(selection.anchorOffset, 0, 'anchorOffset'); 18 assert_equals(selection.anchorOffset, 0, 'anchorOffset');
19 assert_equals(selection.focusNode, sample, 'focusNode'); 19 assert_equals(selection.focusNode, sample.firstChild, 'focusNode');
20 assert_equals(selection.focusOffset, 1, 'focusOffset'); 20 assert_equals(selection.focusOffset, 3, 'focusOffset');
21 }); 21 });
22 test.done(); 22 test.done();
23 }, 0); 23 }, 0);
24 }; 24 };
25 sample.appendChild(iframe); 25 sample.appendChild(iframe);
26 </script> 26 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698