| 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.cssModel.addEventListener(WebInspector.CSSStyleModel.Events.Sty
leSheetAdded, stylesheetAdded); | 15 InspectorTest.cssModel.addEventListener(WebInspector.CSSStyleModel.Events.St
yleSheetAdded, stylesheetAdded); |
| 16 InspectorTest.evaluateInPage("addStyle()"); | 16 InspectorTest.evaluateInPage("addStyle()"); |
| 17 | 17 |
| 18 function stylesheetAdded() | 18 function stylesheetAdded() |
| 19 { | 19 { |
| 20 WebInspector.cssModel.removeEventListener(WebInspector.CSSStyleModel.Eve
nts.StyleSheetAdded, stylesheetAdded); | 20 InspectorTest.cssModel.removeEventListener(WebInspector.CSSStyleModel.Ev
ents.StyleSheetAdded, stylesheetAdded); |
| 21 InspectorTest.selectNodeAndWaitForStyles("inspected", step1); | 21 InspectorTest.selectNodeAndWaitForStyles("inspected", step1); |
| 22 } | 22 } |
| 23 | 23 |
| 24 var treeElement; | 24 var treeElement; |
| 25 var hasResourceChanged; | 25 var hasResourceChanged; |
| 26 | 26 |
| 27 function step1() | 27 function step1() |
| 28 { | 28 { |
| 29 InspectorTest.addNewRule("inspected", step2); | 29 InspectorTest.addNewRule("inspected", step2); |
| 30 } | 30 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 54 | 54 |
| 55 <body onload="runTest()"> | 55 <body onload="runTest()"> |
| 56 <p> | 56 <p> |
| 57 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> | 57 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> |
| 58 </p> | 58 </p> |
| 59 | 59 |
| 60 <div id="inspected" style="font-size: 12px">Text</div> | 60 <div id="inspected" style="font-size: 12px">Text</div> |
| 61 | 61 |
| 62 </body> | 62 </body> |
| 63 </html> | 63 </html> |
| OLD | NEW |