3 <script type=
"text/javascript" src=
"../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
9 InspectorTest
.sendCommand("DOM.getDocument", {}, onGotDocument
);
11 function onGotDocument(msg
)
13 rootNodeId
= msg
.result
.root
.nodeId
;
17 function getMainNodeId(next
)
19 InspectorTest
.sendCommand("DOM.querySelector", { "nodeId": rootNodeId
, "selector": "#main" }, onMainNodeLoaded
);
22 function onMainNodeLoaded()
24 InspectorTest
.log("");
25 InspectorTest
.log("Changing attribute...");
26 InspectorTest
.eventHandler
["DOM.attributeModified"] = onAttributeModified
;
28 expression
+= "var element = document.getElementById('main');\n";
29 expression
+= "element.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', 'changed-url');\n";
30 InspectorTest
.sendCommand("Runtime.evaluate", { expression
: expression
});
33 function onAttributeModified(msg
)
35 var result
= msg
.params
;
36 InspectorTest
.log("Modified attribute: '" + result
.name
+ "'='" + result
.value
+ "'");
38 InspectorTest
.log("Removing attribute...");
39 InspectorTest
.eventHandler
["DOM.attributeRemoved"] = onAttributeRemoved
;
41 expression
+= "var element = document.getElementById('main');\n";
42 expression
+= "element.removeAttribute('xlink:href', 'changed-url');\n";
43 InspectorTest
.sendCommand("Runtime.evaluate", { expression
: expression
});
46 function onAttributeRemoved(msg
)
48 var result
= msg
.params
;
49 InspectorTest
.log("Removed attribute: '" + result
.name
+ "'");
50 InspectorTest
.completeTest();
55 <body onload=
"runTest()">
56 <p>Test that DOM events have correct parameters for attribute with namespace in XML document.
</p>
58 <a id=
"main" xlink:
href=
"http://localhost">link
</a>