Chromium Code Reviews

Side by Side Diff: third_party/WebKit/LayoutTests/fast/css-generated-content/crash-selection-editing-removes-pseudo.html

Issue 1785663002: Make setBaseAndExtent's arguments non-optional (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 2
3 <style> 3 <style>
4 #before:before { 4 #before:before {
5 /* must be an inline-block */ 5 /* must be an inline-block */
6 display: inline-block; 6 display: inline-block;
7 content: 'before'; 7 content: 'before';
8 } 8 }
9 #start:after { 9 #start:after {
10 /* must be an inline-block */ 10 /* must be an inline-block */
(...skipping 13 matching lines...)
24 24
25 <script> 25 <script>
26 if (window.testRunner) 26 if (window.testRunner)
27 testRunner.dumpAsText(); 27 testRunner.dumpAsText();
28 28
29 var before = document.getElementById('before'); 29 var before = document.getElementById('before');
30 var start = document.getElementById('start'); 30 var start = document.getElementById('start');
31 var test = document.getElementById('test'); 31 var test = document.getElementById('test');
32 32
33 // Select from the #start backwards to the start of the line. 33 // Select from the #start backwards to the start of the line.
34 window.getSelection().setBaseAndExtent(document.getElementById('start')); 34 window.getSelection().setBaseAndExtent(document.getElementById('start'), 0, null , 0);
35 window.getSelection().modify('extend', 'backward', 'lineBoundary') 35 window.getSelection().modify('extend', 'backward', 'lineBoundary')
36 36
37 // Replace the selection with a break. This replaces #before, text, 37 // Replace the selection with a break. This replaces #before, text,
38 // #start with two <br>'s. 38 // #start with two <br>'s.
39 document.designMode = 'on'; 39 document.designMode = 'on';
40 document.execCommand('InsertLineBreak'); 40 document.execCommand('InsertLineBreak');
41 41
42 // Crash during tear down. 42 // Crash during tear down.
43 test.innerHTML = "Both pseudos have been removed: " + (before.offsetHeight == 0 && start.offsetHeight == 0); 43 test.innerHTML = "Both pseudos have been removed: " + (before.offsetHeight == 0 && start.offsetHeight == 0);
44 </script> 44 </script>
OLDNEW

Powered by Google App Engine