Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / elements / styles-1 / commit-selector-mark-matching.html
blobc77efdd4906bffda34ac2809d8d8775ce9c8d39f
1 <html>
2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/elements-test.js"></script>
5 <script>
7 function test()
9 var nodeId;
10 var stylesPane;
12 InspectorTest.runTestSuite([
13 function setUp(next) {
14 InspectorTest.selectNodeAndWaitForStyles("inspected", next);
17 function addRule(next)
19 InspectorTest.nodeWithId("inspected", nodeCallback);
21 function nodeCallback(node)
23 nodeId = node.id;
24 stylesPane = WebInspector.panels.elements.sidebarPanes.styles;
25 InspectorTest.addNewRule("foo, #inspected, .bar, #inspected", callback);
28 function callback()
30 InspectorTest.dumpSelectedElementStyles(true, false, false, true);
31 next();
35 function changeSelector(next)
37 var section = InspectorTest.firstMatchedStyleSection();
38 section.startEditingSelector();
39 var selectorElement = section._selectorElement;
40 selectorElement.textContent = "#inspected, a, hr";
41 InspectorTest.waitForSelectorCommitted(callback);
42 selectorElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
44 function callback()
46 InspectorTest.dumpSelectedElementStyles(true, false, false, true);
47 next();
50 ]);
53 </script>
54 </head>
56 <body onload="runTest()">
57 <p>
58 Tests that matching selectors are marked properly after new rule creation and selector change.
59 </p>
61 <div id="inspected"></div>
63 </body>
64 </html>