[Release] Webkit-EFL Ver. 2.0_beta_118996_0.6.22
[framework/web/webkit-efl.git] / LayoutTests / inspector / styles / styles-add-invalid-property.html
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>
6
7 function test()
8 {
9     WebInspector.showPanel("elements");
10     InspectorTest.selectNodeAndWaitForStyles("inspected", step1);
11
12     var treeElement;
13     var section;
14
15     function step1()
16     {
17         InspectorTest.addResult("Before append:");
18         InspectorTest.dumpSelectedElementStyles(true);
19         section = WebInspector.panels.elements.sidebarPanes.styles.sections[0][1];
20         section.expand();
21
22         // Create and increment.
23         treeElement = section.addNewBlankProperty();
24         treeElement.startEditing();
25         treeElement.nameElement.textContent = "color";
26         treeElement.nameElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
27
28         // Update incrementally to a valid value. 
29         treeElement.valueElement.textContent = "rgb(";
30         treeElement.kickFreeFlowStyleEditForTest();
31         InspectorTest.runAfterPendingDispatches(step2);
32     }
33
34     function step2()
35     {
36         // Commit invalid value. 
37         treeElement.valueElement.textContent = "rgb(1";
38         treeElement.valueElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
39         InspectorTest.runAfterPendingDispatches(step3);
40     }
41
42     function step3()
43     {
44         InspectorTest.selectNodeWithId("other");
45         InspectorTest.runAfterPendingDispatches(step4);
46     }
47
48     function step4()
49     {
50         InspectorTest.selectNodeAndWaitForStyles("inspected", step5);
51     }
52
53     function step5()
54     {
55         InspectorTest.addResult("After append:");
56         InspectorTest.dumpSelectedElementStyles(true);
57         InspectorTest.completeTest();
58     }
59 }
60
61 </script>
62 </head>
63
64 <body onload="runTest()">
65 <p>
66 Tests that adding an invalid property retains its syntax.
67 </p>
68
69 <div id="inspected" style="font-size: 12px">Text</div>
70 <div id="other"></div>
71
72 </body>
73 </html>