3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/elements-test.js"></script>
9 WebInspector.showPanel("elements");
11 InspectorTest.runTestSuite([
14 InspectorTest.selectNodeAndWaitForStyles("inspected1", next);
17 function editKeywordAsOriginal(next)
19 startEditingAndDumpValue(WebInspector.Color.Format.Original, "border", next);
22 function editKeywordAsHex(next)
24 startEditingAndDumpValue(WebInspector.Color.Format.HEX, "border", next);
27 function editKeywordAsHSL(next)
29 startEditingAndDumpValue(WebInspector.Color.Format.HSL, "border", next);
32 function editKeywordAsRGB(next)
34 startEditingAndDumpValue(WebInspector.Color.Format.RGB, "border");
35 InspectorTest.selectNodeAndWaitForStyles("inspected2", next);
38 function editHexAsOriginal(next)
40 startEditingAndDumpValue(WebInspector.Color.Format.Original, "color", next);
43 function editHexAsHex(next)
45 startEditingAndDumpValue(WebInspector.Color.Format.HEX, "color", next);
48 function editHexAsHSL(next)
50 startEditingAndDumpValue(WebInspector.Color.Format.HSL, "color", next);
53 function editHexAsRGB(next)
55 startEditingAndDumpValue(WebInspector.Color.Format.RGB, "color", next);
58 function editNewProperty(next)
60 var section = WebInspector.panels.elements.sidebarPanes.styles.sections[0][1];
63 treeElement = section.addNewBlankProperty(0);
64 treeElement.startEditing();
65 treeElement.nameElement.textContent = "border-color";
66 treeElement.nameElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
67 InspectorTest.runAfterPendingDispatches(callbackName);
69 function callbackName()
71 treeElement.valueElement.dispatchEvent(InspectorTest.createKeyEvent("U+001B"));
72 treeElement.valueElement.textContent = "hsl(120, 100%, 25%)";
73 treeElement.kickFreeFlowStyleEditForTest();
74 InspectorTest.runAfterPendingDispatches(kicked);
79 treeElement.valueElement.dispatchEvent(InspectorTest.createKeyEvent("U+0009", false, false, true));
80 InspectorTest.runAfterPendingDispatches(callbackBack);
83 function callbackBack()
85 treeElement.nameElement.dispatchEvent(InspectorTest.createKeyEvent("U+0009"));
86 InspectorTest.runAfterPendingDispatches(callbackForward);
89 function callbackForward()
91 InspectorTest.addResult(treeElement.valueElement.textContent);
98 WebInspector.settings.colorFormat = {
105 function setFormat(newFormat)
108 WebInspector.panel("elements").sidebarPanes.styles._colorFormatSettingChanged();
111 function startEditingAndDumpValue(format, propertyName, next)
114 var treeElement = InspectorTest.getElementStylePropertyTreeItem(propertyName);
115 treeElement.startEditing(treeElement.valueElement);
116 InspectorTest.addResult(treeElement.valueElement.textContent);
117 treeElement.valueElement.dispatchEvent(InspectorTest.createKeyEvent("U+001B"));
126 <body onload="runTest()">
128 Tests that property value being edited uses the user-specified color format.
131 <div id="inspected1" style="border: 1px solid red">inspected1</div>
132 <div id="inspected2" style="color: #ffffee">inspected2</div>