3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/elements-test.js"></script>
9 WebInspector.showPanel("elements");
10 InspectorTest.selectNodeAndWaitForStyles("inspected", step1);
18 InspectorTest.dumpSelectedElementStyles(true);
19 treeElement = InspectorTest.getElementStylePropertyTreeItem("color");
20 treeOutline = treeElement.treeOutline;
22 treeElement.startEditing();
23 treeElement.nameElement.textContent = "color";
24 treeElement.nameElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
26 // Update incrementally, do not commit.
27 treeElement.valueElement.textContent = "rgb(/*";
28 treeElement.kickFreeFlowStyleEditForTest();
31 treeElement.valueElement.textContent = "green";
32 treeElement.valueElement.firstChild.select();
33 treeElement.valueElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
34 InspectorTest.runAfterPendingDispatches(step2);
39 var blankTreeElement = treeOutline.children[1];
40 if (!WebInspector.isBeingEdited(blankTreeElement.nameElement)) {
41 InspectorTest.addResult("No new property editor active!");
42 InspectorTest.completeTest();
45 // Test Styles pane editor looping.
46 blankTreeElement.nameElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
47 if (!WebInspector.isBeingEdited(treeOutline.children[0].nameElement)) {
48 InspectorTest.addResult("Original property name editor not active!");
49 InspectorTest.completeTest();
52 InspectorTest.selectNodeWithId("other");
53 InspectorTest.runAfterPendingDispatches(step3);
58 InspectorTest.selectNodeAndWaitForStyles("inspected", step4);
63 InspectorTest.addResult("After append:");
64 InspectorTest.dumpSelectedElementStyles(true);
65 InspectorTest.completeTest();
72 <body onload="runTest()">
74 Tests that editing is canceled properly after incremental editing.
77 <div id="inspected" style="color: red">Text</div>
78 <div id="other"></div>