3 <script type=
"text/javascript" src=
"../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
11 InspectorTest
.eventHandler
["DOM.attributeModified"] = onAttributeModified
;
13 InspectorTest
.sendCommand("DOM.getDocument", {}, onGotDocument
);
15 function onGotDocument(msg
)
18 InspectorTest
.log(msg
.error
.message
);
19 InspectorTest
.completeTest();
22 rootNodeId
= msg
.result
.root
.nodeId
;
26 function getMainNodeId(next
)
28 InspectorTest
.sendCommand("DOM.querySelector", { "nodeId": rootNodeId
, "selector": "#main" }, onQuery
);
33 nodeId
= msg
.result
.nodeId
;
38 function onGotMainNodeId()
40 InspectorTest
.log("Original attributes:");
41 dumpMainElementAttributes(onDumpedOriginal
);
44 function onDumpedOriginal()
46 InspectorTest
.sendCommand("DOM.setAttributesAsText", { "nodeId": nodeId
, "name": "viewBox", "text": "viewBox=\"0 0 120 120\"" });
49 function onAttributeModified(msg
) {
50 var result
= msg
.params
;
51 InspectorTest
.log("Modified attribute:");
52 InspectorTest
.log(result
.name
+ "=" + result
.value
);
53 InspectorTest
.completeTest();
56 function dumpMainElementAttributes(next
)
58 InspectorTest
.sendCommand("DOM.getAttributes", { "nodeId": nodeId
}, onAttributes
);
60 function onAttributes(msg
)
64 var array
= msg
.result
.attributes
;
65 for (var i
= 0; i
< array
.length
; i
+= 2)
66 InspectorTest
.log(array
[i
] + "=" + array
[i
+ 1]);
71 function checkError(msg
)
74 InspectorTest
.log(msg
.error
.message
);
75 InspectorTest
.completeTest();
83 <body onload=
"runTest()">
84 Test that DOM attribute case is preserved when modified in XML documents.
85 <svg id=
"main" xmlns=
"http://www.w3.org/2000/svg" width=
"600" height=
"500" viewBox=
"0 0 100 120" />