| <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> |