Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / css-generated-content / crash-selection-editing-removes-pseudo.html
1 <!DOCTYPE html>
2
3 <style>
4     #before:before {
5         /* must be an inline-block */
6         display: inline-block;
7         content: 'before';
8     }
9 </style>
10
11
12 <p>Passes if it doesn't crash and the pseudo exists.</p>
13
14 <div id="test">
15     <span id="before"><!-- no content can be here --></span>
16     <span>text</span>
17     <span id="start"><!-- no content can be here --></span>
18 </div>
19
20 <script>
21 if (window.testRunner)
22     testRunner.dumpAsText();
23
24 var before = document.getElementById('before');
25 var test = document.getElementById('test');
26
27 // Select from the #start backwards to the start of the line.
28 window.getSelection().setBaseAndExtent(document.getElementById('start'));
29 window.getSelection().modify('extend', 'backward', 'lineBoundary')
30
31 // Replace the selection with a break. This apparently puts two <br>'s before
32 // the #before and removes the span with "text" and the #start.
33 document.designMode = 'on';
34 document.execCommand('InsertLineBreak');
35
36 // Crash during tear down.
37 test.innerHTML = "Pseudo still exists: " + (before.offsetHeight > 0);
38 </script>