summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/editing/text-iterator/rtl-selection-crash.html
blob: 6f961f949df9cba5c1fb1e8fb019a5e079f4b25f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<body>
<script>
if (window.testRunner)
    testRunner.dumpAsText();

var div = document.createElement('div');
div.contentEditable = 'true';
div.innerHTML = "אחת ש<a id='bar'>תיים </a>שלוש";
document.body.appendChild(div);
div.focus();

var sel = window.getSelection();
sel.selectAllChildren(bar);
var range = sel.getRangeAt(0);
range.insertNode(document.createElement('span'));
range.detach();

// This part can be any number of actions, e.g., clicking anywhere on the page also crashes.
sel.selectAllChildren(bar);
</script>
<p>This test passes if it doesn't crash.</p>
</body>