| Index: third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
|
| index da94dcc7ded3ed81af9008d31ac1751125d0717a..7f9efd639c1d822ef224146e427d75981371b618 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
|
| @@ -2018,6 +2018,26 @@ WebInspector.StylePropertyTreeElement.prototype = {
|
| return new WebInspector.BezierPopoverIcon(this, swatchPopoverHelper, text).element();
|
| },
|
|
|
| + /**
|
| + * @param {string} propertyValue
|
| + * @param {string} propertyName
|
| + * @return {!Node}
|
| + */
|
| + _processShadow: function(propertyValue, propertyName)
|
| + {
|
| + var shadows = WebInspector.ShadowEditor.Shadow.parse(propertyValue, propertyName);
|
| + if (!shadows || !this._editable())
|
| + return createTextNode(propertyValue);
|
| + var container = createDocumentFragment();
|
| + for (var i = 0; i < shadows.length; i++) {
|
| + if (i !== 0)
|
| + container.appendChild(createTextNode(", ")); // Add back commas and spaces between each shadow.
|
| + var shadowPopoverIcon = new WebInspector.ShadowPopoverIcon(this, this._parentPane._swatchPopoverHelper, shadows[i]);
|
| + container.appendChild(shadowPopoverIcon.element());
|
| + }
|
| + return container;
|
| + },
|
| +
|
| _updateState: function()
|
| {
|
| if (!this.listItemElement)
|
| @@ -2181,6 +2201,7 @@ WebInspector.StylePropertyTreeElement.prototype = {
|
| if (this.property.parsedOk) {
|
| propertyRenderer.setColorHandler(this._processColor.bind(this));
|
| propertyRenderer.setBezierHandler(this._processBezier.bind(this));
|
| + propertyRenderer.setShadowHandler(this._processShadow.bind(this));
|
| }
|
|
|
| this.listItemElement.removeChildren();
|
| @@ -2992,6 +3013,14 @@ WebInspector.StylesSidebarPropertyRenderer.prototype = {
|
| },
|
|
|
| /**
|
| + * @param {function(string, string):!Node} handler
|
| + */
|
| + setShadowHandler: function(handler)
|
| + {
|
| + this._shadowHandler = handler;
|
| + },
|
| +
|
| + /**
|
| * @return {!Element}
|
| */
|
| renderName: function()
|
| @@ -3013,6 +3042,13 @@ WebInspector.StylesSidebarPropertyRenderer.prototype = {
|
| if (!this._propertyValue)
|
| return valueElement;
|
|
|
| + if (this._shadowHandler && (this._propertyName === "box-shadow" || this._propertyName === "text-shadow")
|
| + && !WebInspector.CSSMetadata.VariableRegex.test(this._propertyValue) && Runtime.experiments.isEnabled("shadowEditor")) {
|
| + valueElement.appendChild(this._shadowHandler(this._propertyValue, this._propertyName));
|
| + valueElement.normalize();
|
| + return valueElement;
|
| + }
|
| +
|
| var regexes = [WebInspector.CSSMetadata.VariableRegex, WebInspector.CSSMetadata.URLRegex];
|
| var processors = [createTextNode, this._processURL.bind(this)];
|
| if (this._bezierHandler && WebInspector.cssMetadata().isBezierAwareProperty(this._propertyName)) {
|
|
|