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 WebInspector.showPanel("elements");
16 InspectorTest.evaluateInPage("addStyle()", step0);
20 InspectorTest.selectNodeAndWaitForStyles("inspected", step1);
24 var hasResourceChanged;
28 // Click "Add new rule".
29 document.getElementById("add-style-button-test-id").click();
30 var section = WebInspector.panels.elements.sidebarPanes.styles.sections[0][2];
31 section._selectorElement.textContent = "inspected";
32 section._selectorElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
33 InspectorTest.runAfterPendingDispatches(step2);
38 var section = WebInspector.panels.elements.sidebarPanes.styles.sections[0][2];
39 var newProperty = section.addNewBlankProperty();
40 newProperty.startEditing();
41 newProperty.nameElement.textContent = "color";
42 newProperty.nameElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
43 newProperty.valueElement.textContent = "maroon";
44 newProperty.valueElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
45 InspectorTest.waitForStyles("inspected", step3);
50 InspectorTest.addResult("After adding new rule:");
51 InspectorTest.dumpSelectedElementStyles(true, false, true);
52 InspectorTest.completeTest();
59 <body onload="runTest()">
61 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>
64 <div id="inspected" style="font-size: 12px">Text</div>