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

Unified Diff: third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js

Issue 2274223003: DevTools: [shadow-editor] Make color swatches clickable for shadow properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/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 ecce5577c5b26f8c001591d64c9801b97ae7414a..d5eaa017117ae3076bea2ba8b86def9a4359c8bb 100644
--- a/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
+++ b/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
@@ -1960,7 +1960,10 @@ WebInspector.StylePropertyTreeElement.prototype = {
}
var swatchPopoverHelper = this._parentPane._swatchPopoverHelper;
- var swatchIcon = new WebInspector.ColorSwatchPopoverIcon(this, swatchPopoverHelper, text);
+ var swatch = WebInspector.ColorSwatch.create();
+ swatch.setColorText(text);
+ swatch.setFormat(WebInspector.Color.detectColorFormat(swatch.color()));
+ var swatchIcon = new WebInspector.ColorSwatchPopoverIcon(this, swatchPopoverHelper, swatch);
/**
* @param {?Array<string>} backgroundColors
@@ -1994,7 +1997,7 @@ WebInspector.StylePropertyTreeElement.prototype = {
cssModel.backgroundColorsPromise(this.node().id).then(computedCallback);
}
- return swatchIcon.element();
+ return swatch;
},
/**
@@ -2042,6 +2045,8 @@ WebInspector.StylePropertyTreeElement.prototype = {
// TODO(flandy): editing the property value should use the original value with all spaces.
var cssShadowSwatch = WebInspector.CSSShadowSwatch.create();
cssShadowSwatch.setCSSShadow(shadows[i]);
+ if (cssShadowSwatch.colorSwatch())
+ var colorSwatchIcon = new WebInspector.ColorSwatchPopoverIcon(this, swatchPopoverHelper, cssShadowSwatch.colorSwatch());
container.appendChild(cssShadowSwatch);
}
return container;

Powered by Google App Engine
This is Rietveld 408576698