| 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); |
| 11 } | 11 } |
| 12 | 12 |
| 13 function test() | 13 function test() |
| 14 { | 14 { |
| 15 WebInspector.inspectorView.showPanel("elements"); | 15 WebInspector.inspectorView.showPanel("elements"); |
| 16 InspectorTest.evaluateInPage("addStyle()", step0); | 16 WebInspector.cssModel.addEventListener(WebInspector.CSSStyleModel.Events.Sty
leSheetAdded, stylesheetAdded); |
| 17 InspectorTest.evaluateInPage("addStyle()"); |
| 17 | 18 |
| 18 function step0() | 19 function stylesheetAdded() |
| 19 { | 20 { |
| 21 WebInspector.cssModel.removeEventListener(WebInspector.CSSStyleModel.Eve
nts.StyleSheetAdded, stylesheetAdded); |
| 20 InspectorTest.selectNodeAndWaitForStyles("inspected", step1); | 22 InspectorTest.selectNodeAndWaitForStyles("inspected", step1); |
| 21 } | 23 } |
| 22 | 24 |
| 23 var treeElement; | 25 var treeElement; |
| 24 var hasResourceChanged; | 26 var hasResourceChanged; |
| 25 | 27 |
| 26 function step1() | 28 function step1() |
| 27 { | 29 { |
| 28 // Click "Add new rule". | 30 // Click "Add new rule". |
| 29 document.getElementById("add-style-button-test-id").click(); | 31 document.getElementById("add-style-button-test-id").click(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 58 | 60 |
| 59 <body onload="runTest()"> | 61 <body onload="runTest()"> |
| 60 <p> | 62 <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> | 63 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> | 64 </p> |
| 63 | 65 |
| 64 <div id="inspected" style="font-size: 12px">Text</div> | 66 <div id="inspected" style="font-size: 12px">Text</div> |
| 65 | 67 |
| 66 </body> | 68 </body> |
| 67 </html> | 69 </html> |
| OLD | NEW |