Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / elements / styles / cancel-upon-invalid-property.html
blob4208a230e33a55720b16a54a15af2a7d316b2773
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 <style>
6 #inspected {
7 color: blue;
9 </style>
10 <script>
12 function test()
14 var treeElement;
15 InspectorTest.selectNodeAndWaitForStyles("inspected", editProperty);
17 function editProperty()
19 treeElement = InspectorTest.getMatchedStylePropertyTreeItem("color");
20 InspectorTest.dumpSelectedElementStyles(true, false, true);
21 treeElement.startEditing();
22 treeElement.nameElement.textContent = "color";
23 treeElement.nameElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
24 treeElement.valueElement.textContent = "red";
25 InspectorTest.waitForStyleApplied(commitInvalidProperty);
26 treeElement.kickFreeFlowStyleEditForTest();
29 function commitInvalidProperty()
31 treeElement.valueElement.textContent = "red/*";
32 treeElement.valueElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
33 InspectorTest.waitForStyleApplied(invalidCommitted);
36 function invalidCommitted()
38 InspectorTest.waitForStyleApplied(dumpAndExit);
41 function dumpAndExit()
43 InspectorTest.dumpSelectedElementStyles(true, false, true);
44 InspectorTest.completeTest();
48 </script>
49 </head>
51 <body onload="runTest()">
52 <p>
53 Verifies that entering poor property value restores original text.
54 </p>
56 <div id="inspected">Text</div>
58 </body>
59 </html>