| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../../http/tests/inspector/elements-test.js"></script> | 4 <script src="../../../http/tests/inspector/elements-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 function addStyle() | 6 function addStyle() |
| 7 { | 7 { |
| 8 var style = document.createElement("style"); | 8 var style = document.createElement("style"); |
| 9 document.documentElement.appendChild(style); | 9 document.documentElement.appendChild(style); |
| 10 style.sheet.insertRule("foo {display: none;}", 0); | 10 style.sheet.insertRule("foo {display: none;}", 0); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 function step2() | 36 function step2() |
| 37 { | 37 { |
| 38 var section = WebInspector.panels.elements.sidebarPanes.styles.sections[
0][2]; | 38 var section = WebInspector.panels.elements.sidebarPanes.styles.sections[
0][2]; |
| 39 var newProperty = section.addNewBlankProperty(); | 39 var newProperty = section.addNewBlankProperty(); |
| 40 newProperty.startEditing(); | 40 newProperty.startEditing(); |
| 41 newProperty.nameElement.textContent = "color"; | 41 newProperty.nameElement.textContent = "color"; |
| 42 newProperty.nameElement.dispatchEvent(InspectorTest.createKeyEvent("Ente
r")); | 42 newProperty.nameElement.dispatchEvent(InspectorTest.createKeyEvent("Ente
r")); |
| 43 newProperty.valueElement.textContent = "maroon"; | 43 newProperty.valueElement.textContent = "maroon"; |
| 44 newProperty.valueElement.dispatchEvent(InspectorTest.createKeyEvent("Ent
er")); | 44 newProperty.valueElement.dispatchEvent(InspectorTest.createKeyEvent("Ent
er")); |
| 45 InspectorTest.waitForStyles("inspected", step3); | 45 InspectorTest.runAfterPendingDispatches(step3); |
| 46 } | 46 } |
| 47 | 47 |
| 48 function step3() | 48 function step3() |
| 49 { | 49 { |
| 50 InspectorTest.addResult("After adding new rule:"); | 50 InspectorTest.addResult("After adding new rule:"); |
| 51 InspectorTest.dumpSelectedElementStyles(true, false, true); | 51 InspectorTest.dumpSelectedElementStyles(true, false, true); |
| 52 InspectorTest.completeTest(); | 52 InspectorTest.completeTest(); |
| 53 } | 53 } |
| 54 } | 54 } |
| 55 | 55 |
| 56 </script> | 56 </script> |
| 57 </head> | 57 </head> |
| 58 | 58 |
| 59 <body onload="runTest()"> | 59 <body onload="runTest()" id="inspected"> |
| 60 <p> | 60 <p> |
| 61 Tests that adding a new rule works when there is a STYLE element after BODY. TIM
EOUT SHOULD NOT OCCUR! <a href="https://bugs.webkit.org/show_bug.cgi?id=111299">
Bug 111299</a> | 61 Tests that adding a new rule works when there is a STYLE element after BODY. TIM
EOUT SHOULD NOT OCCUR! <a href="https://bugs.webkit.org/show_bug.cgi?id=111299">
Bug 111299</a> |
| 62 </p> | 62 </p> |
| 63 | 63 |
| 64 <div id="inspected" style="font-size: 12px">Text</div> | |
| 65 | |
| 66 </body> | 64 </body> |
| 67 </html> | 65 </html> |
| OLD | NEW |