2011-05-12 Ryosuke Niwa <rniwa@webkit.org>
[WebKit-https.git] / LayoutTests / editing / text-iterator / rtl-selection-crash.html
1 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
2 <body>
3 <script>
4 if (window.layoutTestController)
5     layoutTestController.dumpAsText();
6
7 var div = document.createElement('div');
8 div.contentEditable = 'true';
9 div.innerHTML = "אחת ש<a id='bar'>תיים </a>שלוש";
10 document.body.appendChild(div);
11 div.focus();
12
13 var sel = window.getSelection();
14 sel.selectAllChildren(bar);
15 var range = sel.getRangeAt(0);
16 range.insertNode(document.createElement('span'));
17 range.detach();
18
19 // This part can be any number of actions, e.g., clicking anywhere on the page also crashes.
20 sel.selectAllChildren(bar);
21 </script>
22 <p>This test passes if it doesn't crash.</p>
23 </body>