3 <script src=
"../../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"../../../http/tests/inspector/elements-test.js"></script>
8 var style
= document
.createElement("style");
9 document
.documentElement
.appendChild(style
);
10 style
.sheet
.insertRule("foo {display: none;}", 0);
15 InspectorTest
.cssModel
.addEventListener(WebInspector
.CSSStyleModel
.Events
.StyleSheetAdded
, stylesheetAdded
);
16 InspectorTest
.evaluateInPage("addStyle()");
18 function stylesheetAdded()
20 InspectorTest
.cssModel
.removeEventListener(WebInspector
.CSSStyleModel
.Events
.StyleSheetAdded
, stylesheetAdded
);
21 InspectorTest
.selectNodeAndWaitForStyles("inspected", step1
);
25 var hasResourceChanged
;
29 InspectorTest
.addNewRule("inspected", step2
);
34 var section
= InspectorTest
.firstMatchedStyleSection();
35 var newProperty
= section
.addNewBlankProperty();
36 newProperty
.startEditing();
37 newProperty
.nameElement
.textContent
= "color";
38 newProperty
.nameElement
.dispatchEvent(InspectorTest
.createKeyEvent("Enter"));
39 newProperty
.valueElement
.textContent
= "maroon";
40 newProperty
.valueElement
.dispatchEvent(InspectorTest
.createKeyEvent("Enter"));
41 InspectorTest
.waitForStyles("inspected", step3
);
46 InspectorTest
.addResult("After adding new rule:");
47 InspectorTest
.dumpSelectedElementStyles(true, false, true);
48 InspectorTest
.completeTest();
55 <body onload=
"runTest()">
57 Tests that adding a new rule works when there is a STYLE element after BODY. TIMEOUT SHOULD NOT OCCUR!
<a href=
"https://bugs.webkit.org/show_bug.cgi?id=111299">Bug
111299</a>
60 <div id=
"inspected" style=
"font-size: 12px">Text
</div>