3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/elements-test.js"></script>
9 InspectorTest.runTestSuite([
12 InspectorTest.selectNodeAndWaitForStyles("inspected1", next);
15 function editKeywordAsOriginal(next)
17 startEditingAndDumpValue(WebInspector.Color.Format.Original, "border", next);
20 function editKeywordAsHex(next)
22 startEditingAndDumpValue(WebInspector.Color.Format.HEX, "border", next);
25 function editKeywordAsHSL(next)
27 startEditingAndDumpValue(WebInspector.Color.Format.HSL, "border", next);
30 function editKeywordAsRGB(next)
32 startEditingAndDumpValue(WebInspector.Color.Format.RGB, "border");
33 InspectorTest.selectNodeAndWaitForStyles("inspected2", next);
36 function editHexAsOriginal(next)
38 startEditingAndDumpValue(WebInspector.Color.Format.Original, "color", next);
41 function editHexAsHex(next)
43 startEditingAndDumpValue(WebInspector.Color.Format.HEX, "color", next);
46 function editHexAsHSL(next)
48 startEditingAndDumpValue(WebInspector.Color.Format.HSL, "color", next);
51 function editHexAsRGB(next)
53 startEditingAndDumpValue(WebInspector.Color.Format.RGB, "color", next);
56 function editNewProperty(next)
58 var section = WebInspector.panels.elements.sidebarPanes.styles.sections[0][1];
61 treeElement = section.addNewBlankProperty(0);
62 treeElement.startEditing();
63 treeElement.nameElement.textContent = "border-color";
64 treeElement.nameElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
65 treeElement.valueElement.textContent = "hsl(120, 100%, 25%)";
66 treeElement.kickFreeFlowStyleEditForTest();
67 InspectorTest.waitForStyleApplied(kicked);
71 treeElement.valueElement.dispatchEvent(InspectorTest.createKeyEvent("U+0009", false, false, true));
72 treeElement.nameElement.dispatchEvent(InspectorTest.createKeyEvent("U+0009"));
73 InspectorTest.addResult(treeElement.valueElement.textContent);
80 WebInspector.settings.colorFormat = {
87 function setFormat(newFormat)
90 WebInspector.panels.elements.sidebarPanes.styles._colorFormatSettingChanged();
93 function startEditingAndDumpValue(format, propertyName, next)
96 var treeElement = InspectorTest.getElementStylePropertyTreeItem(propertyName);
97 treeElement.startEditing(treeElement.valueElement);
98 InspectorTest.addResult(treeElement.valueElement.textContent);
99 treeElement.valueElement.dispatchEvent(InspectorTest.createKeyEvent("U+001B"));
108 <body onload="runTest()">
110 Tests that property value being edited uses the user-specified color format.
113 <div id="inspected1" style="border: 1px solid red">inspected1</div>
114 <div id="inspected2" style="color: #ffffee">inspected2</div>