blob: cac0d4d0496a652a69d2184e02ff2314f34fa618 [file] [log] [blame]
<html>
<head>
<style>
#inspected {
color: green;
}
</style>
<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/elements-test.js"></script>
<script>
function test()
{
WebInspector.showPanel("elements");
InspectorTest.selectNodeAndWaitForStyles("inspected", updateStyleText);
function updateStyleText()
{
InspectorTest.addResult("Before setStyleText:");
InspectorTest.dumpSelectedElementStyles(true);
var section = WebInspector.panels.elements.sidebarPanes.styles.sections[0][2];
section.rule.style.setText("color: red");
InspectorTest.runAfterPendingDispatches(textUpdated);
}
function textUpdated()
{
InspectorTest.addResult("After setStyleText:");
InspectorTest.dumpSelectedElementStyles(true);
InspectorTest.completeTest();
}
}
</script>
</head>
<body onload="runTest()">
<p>
Tests that CSSStyleDeclaration.setText() works.
</p>
<div id="inspected">Text</div>
</body>
</html>