5 if (event
.type
== "DOMNodeInserted" && event
.target
.nodeType
== 3)
6 document
.body
.innerHTML
= "PASSED";
10 if (!window
.testRunner
)
13 window
.testRunner
.dumpAsText();
15 document
.addEventListener("DOMNodeInserted", function() { foo() }, true);
17 // Select the element 'dragSource'.
18 var selection
= window
.getSelection();
19 var range
= document
.createRange();
20 range
.selectNode(document
.getElementById("dragSource"));
21 selection
.addRange(range
);
23 // Drag the source text to the target text.
24 var source
= document
.getElementById('dragSource');
25 var target
= document
.getElementById('dragTarget');
26 eventSender
.mouseMoveTo(source
.offsetLeft
+ 2, source
.offsetTop
+ 2);
27 eventSender
.mouseDown();
28 eventSender
.leapForward(500);
29 eventSender
.mouseMoveTo(target
.offsetLeft
+ target
.offsetWidth
/ 2,
30 target
.offsetTop
+ target
.offsetHeight
/ 2);
31 eventSender
.mouseUp();
35 <body contenteditable=
"true" onload=
"runTest()">
36 <p>This test tests for a crash when a DOM mutation event listener
37 modifies the text during a drop. If the test doesn't crash, all is good.
38 <p id=
"dragSource">drag source text
39 <p id=
"dragTarget">drag dest text