3 <script src=
"../../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"../../../http/tests/inspector/elements-test.js"></script>
7 function testSetNewValue()
9 document
.getElementById("node-set-new-value").style
.setProperty("color", "blue");
12 function testSetSameValue()
14 document
.getElementById("node-set-same-value").style
.setProperty("color", "red");
19 // Save time on style updates.
20 WebInspector
.StylesSidebarPane
.prototype.update = function() {};
21 WebInspector
.MetricsSidebarPane
.prototype.update = function() {};
23 InspectorTest
.runTestSuite([
24 function testSetUp(next
)
26 InspectorTest
.expandElementsTree(next
);
29 function testSetNewValue(next
)
31 InspectorTest
.evaluateInPage("testSetNewValue()");
33 InspectorTest
.domModel
.addEventListener(WebInspector
.DOMModel
.Events
.AttrModified
, listener
);
34 function listener(event
)
36 InspectorTest
.addResult("WebInspector.DOMModel.Events.AttrModified should be issued");
37 InspectorTest
.domModel
.removeEventListener(WebInspector
.DOMModel
.Events
.AttrModified
, listener
);
42 function testSetSameValue(next
)
44 InspectorTest
.evaluateInPage("testSetSameValue()", next
);
46 InspectorTest
.domModel
.addEventListener(WebInspector
.DOMModel
.Events
.AttrModified
, listener
);
47 function listener(event
)
49 InspectorTest
.addResult("WebInspector.DOMModel.Events.AttrModified should not be issued");
50 InspectorTest
.domModel
.removeEventListener(WebInspector
.DOMModel
.Events
.AttrModified
, listener
);
59 <body onload=
"runTest()">
61 Tests that style modification generates attribute updated event only when attribute is actually changed.
65 <div id=
"node-set-new-value" style=
"color:red"></div>
66 <div id=
"node-set-same-value" style=
"color:red"></div>