3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/elements-test.js"></script>
9 var hidden = document.getElementById("hidden");
10 var child = document.createElement("div");
11 child.setAttribute("id", "appended");
12 hidden.appendChild(child);
15 function removeChild()
17 var child = document.getElementById("appended");
18 child.parentNode.removeChild(child);
21 function modifyAttribute()
23 var hidden = document.getElementById("hidden");
24 hidden.setAttribute("foo", "bar");
29 function listener(type, event)
31 node = event.data.node || event.data;
32 InspectorTest.addResult("DOMAgent event fired. Should only happen once for output node: " + type + " " + event.data.nodeName() + "#" + event.data.getAttribute("id"));
35 WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrModified, listener.bind(this, "DOMAttrModified"));
36 WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.CharacterDataModified, listener.bind(this, "DOMCharacterDataModified"));
37 WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.NodeInserted, listener.bind(this, "DOMNodeInserted"));
38 WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.NodeRemoved, listener.bind(this, "DOMNodeRemoved"));
40 WebInspector.domAgent.requestDocument(step0.bind(this));
44 InspectorTest.evaluateInPage("appendChild()", step1);
49 InspectorTest.addResult("Appended");
50 InspectorTest.evaluateInPage("removeChild()", step2);
55 InspectorTest.addResult("Removed");
56 InspectorTest.evaluateInPage("modifyAttribute()", step3);
61 InspectorTest.addResult("Attribute modified");
62 InspectorTest.evaluateInPage("true", step4);
67 InspectorTest.addResult("========= Result DOMAgent tree ========");
68 InspectorTest.dumpDOMAgentTree();
70 InspectorTest.completeTest();
77 <body onload="runTest()">
79 Tests that elements panel does not receive events upon changes to the undiscovered nodes.