Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(659)

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js

Issue 2252913002: DevTools: Box-shadow editor initial implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shadowIcon
Patch Set: Merge Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js b/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
index 4727bfb6c55fb0dece15360f2554258fcc24e6e6..c5714f56dc119e77f9722b7264ed33349b319af8 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
@@ -1371,6 +1371,20 @@ function createCheckboxLabel(title, checked, subtitle)
}
/**
+ * @return {!Element}
+ * @param {number} min
+ * @param {number} max
+ */
+function createSliderLabel(min, max)
+{
+ var element = createElement("label", "dt-slider");
+ element.sliderElement.min = min;
+ element.sliderElement.max = max;
+ element.sliderElement.step = 1;
+ return element;
+}
+
+/**
* @param {!Node} node
* @param {string} cssFile
* @suppressGlobalPropertiesCheck
@@ -1535,6 +1549,38 @@ WebInspector.appendStyle = function(node, cssFile)
__proto__: HTMLLabelElement.prototype
});
+ registerCustomElement("label", "dt-slider", {
+ /**
+ * @this {Element}
+ */
+ createdCallback: function()
+ {
+ var root = WebInspector.createShadowRootWithCoreStyles(this, "ui/slider.css");
+ this.sliderElement = createElementWithClass("input", "dt-range-input");
+ this.sliderElement.type = "range";
+ root.appendChild(this.sliderElement);
+ },
+
+ /**
+ * @param {number} amount
+ * @this {Element}
+ */
+ set value(amount)
+ {
+ this.sliderElement.value = amount;
+ },
+
+ /**
+ * @this {Element}
+ */
+ get value()
+ {
+ return this.sliderElement.value;
+ },
+
+ __proto__: HTMLLabelElement.prototype
+ });
+
registerCustomElement("label", "dt-small-bubble", {
/**
* @this {Element}

Powered by Google App Engine
This is Rietveld 408576698