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

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: Heavily updated 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 86f9ab857020a1087ab8763a849465b34a8a33c3..61219a52b0a83beff0898d83540e459d636b99d9 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,39 @@ 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.createChild("content");
dgozman 2016/08/24 19:18:31 You only need content if you append children (e.g.
flandy 2016/08/24 22:08:41 Removed.
+ 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("div", "dt-close-button", {
/**
* @this {Element}

Powered by Google App Engine
This is Rietveld 408576698