Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / elements / styles-1 / commit-selector.html
blobf0405f70506d231322f3e87a4577b9586bdd264b
1 <html>
2 <head>
3 <style>
4 #inspected {
5 color: green;
7 </style>
8 <script src="../../../http/tests/inspector/inspector-test.js"></script>
9 <script src="../../../http/tests/inspector/elements-test.js"></script>
10 <script>
12 function test()
14 InspectorTest.selectNodeAndWaitForStyles("inspected", step1);
16 function step1()
18 InspectorTest.addResult("=== Before selector modification ===");
19 InspectorTest.dumpSelectedElementStyles(true);
20 var section = InspectorTest.firstMatchedStyleSection();
21 section.startEditingSelector();
22 section._selectorElement.textContent = "hr, #inspected ";
23 InspectorTest.waitForSelectorCommitted(step2);
24 section._selectorElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
27 function step2()
29 InspectorTest.addResult("=== After non-affecting selector modification ===");
30 InspectorTest.dumpSelectedElementStyles(true);
31 var section = InspectorTest.firstMatchedStyleSection();
32 section.startEditingSelector();
33 section._selectorElement.textContent = "#inspectedChanged";
34 InspectorTest.waitForSelectorCommitted(step3);
35 section._selectorElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
38 function step3()
40 InspectorTest.addResult("=== After affecting selector modification ===");
41 InspectorTest.dumpSelectedElementStyles(true);
42 InspectorTest.completeTest();
46 </script>
47 </head>
49 <body onload="runTest()">
50 <p>
51 Tests that renaming a selector updates element styles. <a href="https://bugs.webkit.org/show_bug.cgi?id=70018">Bug 70018</a>.
52 </p>
54 <div id="inspected" style="color: red">Text</div>
55 <div id="other"></div>
57 </body>
58 </html>