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