Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / elements / styles-3 / styles-add-new-rule-colon.html
blobabec10742df4fa0929d6f09ba967c61605e99296
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 InspectorTest.selectNodeAndWaitForStyles("inspected", step1);
10 InspectorTest.addSniffer(WebInspector.UISourceCode.prototype, "addRevision", onRevisionAdded);
12 var treeElement;
13 var hasResourceChanged;
15 var revisionAdded = false;
16 var testFinished = false;
17 var displayName = "";
19 function step1()
21 InspectorTest.addNewRule("foo, div#inspected, bar", step2);
24 function step2()
26 var section = InspectorTest.firstMatchedStyleSection();
27 var newProperty = section.addNewBlankProperty();
28 newProperty.startEditing();
29 textInputController.insertText("color");
30 eventSender.keyDown(":");
31 textInputController.insertText("maroon");
32 InspectorTest.waitForStyleApplied(step3);
33 eventSender.keyDown(";");
36 function step3() {
37 InspectorTest.selectNodeAndWaitForStyles("other", step4);
40 function step4()
42 InspectorTest.addNewRule(null, onRuleAdded);
44 function onRuleAdded()
46 InspectorTest.selectNodeAndWaitForStyles("inspected", step5);
50 function step5()
52 InspectorTest.addResult("After adding new rule (inspected):");
53 InspectorTest.dumpSelectedElementStyles(true, false, true, true);
54 InspectorTest.selectNodeAndWaitForStyles("other", step6);
57 function step6()
59 InspectorTest.addResult("After adding new rule (other):");
60 InspectorTest.dumpSelectedElementStyles(true, false, true);
61 testFinished = true;
62 maybeCompleteTest();
65 function maybeCompleteTest()
67 if (!testFinished || !revisionAdded)
68 return;
69 InspectorTest.addResult("Revision added: " + displayName);
70 InspectorTest.completeTest();
73 function onRevisionAdded(revision)
75 revisionAdded = true;
76 displayName = this.displayName();
77 maybeCompleteTest();
81 </script>
82 </head>
84 <body onload="runTest()">
85 <p>
86 Tests that adding a new rule works after switching nodes.
87 </p>
89 <div id="inspected" style="font-size: 12px">Text</div>
90 <div id="other" style="color:red"></div>
92 </body>
93 </html>