Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / elements / styles-4 / style-update-during-selector-edit.html
blob69f75307eaf07d405843bd7651cdbad7b9ca6423
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 addStyleClass()
9 document.getElementById("inspected").className = "new-class";
12 function test()
14 InspectorTest.selectNodeAndWaitForStyles("inspected", step1);
15 var treeOutline = InspectorTest.firstElementsTreeOutline();
16 var seenRebuildUpdate;
17 var seenAttrModified;
18 var modifiedAttrNodes = [];
20 function attributeChanged(event)
22 if (event.data.node === treeOutline.selectedDOMNode())
23 seenAttrModified = true;
26 function rebuildUpdate()
28 if (WebInspector.panels.elements.sidebarPanes.styles.node === treeOutline.selectedDOMNode())
29 seenRebuildUpdate = true;
32 function step1()
34 InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "doUpdate", rebuildUpdate);
35 InspectorTest.domModel.addEventListener(WebInspector.DOMModel.Events.AttrModified, attributeChanged, this);
36 // Click "Add new rule".
37 document.querySelector(".styles-pane-toolbar").shadowRoot.querySelector(".add-toolbar-item").click();
38 InspectorTest.evaluateInPage("addStyleClass()", step2);
41 function step2()
43 if (!seenAttrModified)
44 InspectorTest.addResult("FAIL: AttrModified event not received.");
45 else if (seenRebuildUpdate)
46 InspectorTest.addResult("FAIL: Styles pane updated while a selector editor was active.");
47 else
48 InspectorTest.addResult("SUCCESS: Styles pane not updated.");
49 InspectorTest.completeTest();
53 </script>
54 <style>
55 .new-class {
56 color: red;
58 </style>
59 </head>
61 <body onload="runTest()">
62 <p>
63 Tests that modification of element styles while editing a selector does not commit the editor.
64 </p>
66 <div id="inspected"></div>
68 </body>
69 </html>