Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / insert-span-into-long-text-bug-28245.html
blobde18ad454f5c395af109de3cd5c95a29413e7fef
1 <html>
2 <head>
3 <style>
4 #highlighted
6 white-space: pre-wrap;
8 </style>
9 <script>
10 function debug(str) {
11 pre = document.getElementById('console');
12 pre.appendChild(document.createTextNode(str + '\n'));
15 function runTest() {
16 if (window.testRunner)
17 testRunner.dumpAsText()
19 var str = '____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________'
20 var div = document.getElementById('highlighted');
21 div.innerHTML = '<div>' + str + '\n</div>'
22 debug(div.innerHTML);
24 // Test crash
25 var sel = getSelection();
26 sel.collapse(div.firstChild, 0);
28 var range = sel.getRangeAt(0);
29 var span = document.createElement('SPAN');
30 range.insertNode(span);
31 debug(div.innerHTML);
33 </script>
34 </head>
35 <body onload="runTest()">
36 This tests that inserting a span into a selection of a div with lots of non-word-broken characters doesn't crash.
37 <div id="highlighted"></div>
38 <pre id="console"></pre>
39 </body>
40 </html>