Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / Range / range-insertNode-assertion.html
blob309da7f5c08d8c87b1c184283a7d24d695d3757a
1 <!DOCTYPE html>
2 <body>
3 <script src="../../../resources/js-test.js"></script>
4 <div id="parent1">text</div>
5 <div id="parent2">text</div>
6 <script>
7 function handleInsertion() {
8 document.removeEventListener('DOMNodeInserted', handleInsertion);
9 parent.innerHTML = '';
11 document.addEventListener('DOMNodeInserted', handleInsertion);
12 var parent = document.getElementById('parent1');
13 var r = new Range();
14 window.getSelection().addRange(r);
15 r.setStart(parent, 0);
16 r.setEnd(parent, 0);
17 r.insertNode(document.createElement('span'));
18 parent.remove();
20 function handleInsertion2() {
21 if (parent.childNodes.length != 3)
22 return;
23 var textNodeCreatedBySplitText = parent.lastChild;
24 parent.removeChild(textNodeCreatedBySplitText);
25 document.removeEventListener('DOMNodeInserted', handleInsertion2);
27 document.addEventListener('DOMNodeInserted', handleInsertion2);
28 parent = document.getElementById('parent2');
29 r.setStart(parent2.firstChild, 2);
30 r.setEnd(parent2.firstChild, 2);
31 r.insertNode(document.createElement('span'));
33 description('No assertion failures even if a DOM mutation event handler updates nodes in a Range during Range::insertNode.');
34 testPassed('if this did not crash.');
35 parent.remove();
36 </script>
37 </body>