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