3 <script src=
"../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"../../http/tests/inspector/elements-test.js"></script>
9 var node
= document
.getElementById("node");
10 node
.firstChild
.textContent
= "Bar";
13 function modifyViaRange()
15 var range
= document
.createRange();
16 var referenceNode
= document
.getElementById("rangenode").firstChild
;
17 range
.selectNode(referenceNode
);
18 range
.setStart(referenceNode
, 9);
19 range
.setEnd(referenceNode
, 9 + 5);
20 range
.deleteContents();
21 var span
= range
.startContainer
.ownerDocument
.createElement("span");
22 span
.innerHTML
= "test";
23 range
.insertNode(span
);
30 InspectorTest
.runTestSuite([
31 function testDumpInitial(next
)
33 function callback(node
)
36 InspectorTest
.addResult("========= Original for normal mutation ========");
37 InspectorTest
.dumpElementsTree(targetNode
);
40 InspectorTest
.selectNodeWithId("node", callback
);
43 function testSetAttribute(next
)
47 InspectorTest
.addResult("===== Mutated text node =====");
48 InspectorTest
.dumpElementsTree(targetNode
);
51 InspectorTest
.evaluateInPage("modifyChars()", callback
);
54 function testModifyViaRange(next
)
58 InspectorTest
.addResult("===== Contents modified via Range =====");
59 InspectorTest
.dumpElementsTree(targetNode
);
62 function expandCallback()
64 InspectorTest
.expandElementsTree(callback
);
66 function selectCallback(node
)
69 InspectorTest
.addResult("========= Original for Range mutation ========");
70 InspectorTest
.dumpElementsTree(targetNode
);
71 InspectorTest
.evaluateInPage("modifyViaRange()", expandCallback
);
73 InspectorTest
.selectNodeWithId("rangenode", selectCallback
);
81 <body onload=
"runTest()">
83 Tests that elements panel updates dom tree structure upon changes to characters.
86 <div id=
"node">Foo
</div>
87 <div id=
"rangenode">Lorem ipsum dolor sit amet
</div>