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

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

Issue 2310633002: DevTools: Reduce color parsing by passing in Color to ColorSwatch (Closed)
Patch Set: Created 4 years, 3 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/ColorSwatchPopoverIcon.js
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/ColorSwatchPopoverIcon.js b/third_party/WebKit/Source/devtools/front_end/elements/ColorSwatchPopoverIcon.js
index c5ab08aab504f4d3cd5db880bebaa8d7faee5277..13875c5dbc0913f40921c78a9a15cc7a48a52b31 100644
--- a/third_party/WebKit/Source/devtools/front_end/elements/ColorSwatchPopoverIcon.js
+++ b/third_party/WebKit/Source/devtools/front_end/elements/ColorSwatchPopoverIcon.js
@@ -192,8 +192,10 @@ WebInspector.ColorSwatchPopoverIcon.prototype = {
*/
_spectrumChanged: function(event)
{
- var colorString = /** @type {string} */ (event.data);
- this._swatch.setColorText(colorString);
+ var color = WebInspector.Color.parse(/** @type {string} */ (event.data));
+ if (!color)
+ return;
+ this._swatch.setColor(color);
this._treeElement.applyStyleText(this._treeElement.renderedPropertyText(), false);
},

Powered by Google App Engine
This is Rietveld 408576698