summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/dom/Range/split-text-in-range.html
blob: 9b206c197dfaa8147dfe1259438bed3f96e269a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!DOCTYPE html>
<body>
<script src="../../js/resources/js-test-pre.js"></script>
<div id="parent1">text</div>
<script>
var parent = document.getElementById('parent1');
var target = parent.firstChild;

function handleInsertion() {
    document.removeEventListener('DOMNodeInserted', handleInsertion);
    target.nextSibling.remove();
}

document.addEventListener('DOMNodeInserted', handleInsertion, false);
var r = new Range();
//window.getSelection().addRange(r);
r.setStart(target, 0);
r.setEnd(target, 4);
target.splitText(2);
description('No assertion failures even if an DOM mutation event handler updates the new node created by Text::splitText.');
testPassed(' if the test wasn\'t terminated by an assertion.');
parent.remove();
</script>
<script src="../../js/resources/js-test-post.js"></script>
</body>