Index: third_party/WebKit/Source/devtools/front_end/sources/CSSSourceFrame.js |
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/CSSSourceFrame.js b/third_party/WebKit/Source/devtools/front_end/sources/CSSSourceFrame.js |
index b05b027e29361ea41dbbb255169864db87e21ffa..4934e7b084785ca274f7a92a0620dd4dc85e4397 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/sources/CSSSourceFrame.js |
+++ b/third_party/WebKit/Source/devtools/front_end/sources/CSSSourceFrame.js |
@@ -166,10 +166,11 @@ WebInspector.CSSSourceFrame.prototype = { |
*/ |
_createColorSwatch: function(text) |
{ |
- if (!WebInspector.Color.parse(text)) |
+ var color = WebInspector.Color.parse(text); |
+ if (!color) |
return null; |
var swatch = WebInspector.ColorSwatch.create(); |
- swatch.setColorText(text); |
+ swatch.setColor(color); |
swatch.iconElement().title = WebInspector.UIString("Open color picker."); |
swatch.iconElement().addEventListener("click", this._swatchIconClicked.bind(this, swatch), false); |
swatch.hideText(true); |
@@ -241,7 +242,10 @@ WebInspector.CSSSourceFrame.prototype = { |
_spectrumChanged: function(event) |
{ |
var colorString = /** @type {string} */ (event.data); |
lushnikov
2016/09/09 00:16:42
spectrm should've fired a Color objects here, but
|
- this._currentSwatch.setColorText(colorString); |
+ var color = WebInspector.Color.parse(colorString); |
+ if (!color) |
+ return; |
+ this._currentSwatch.setColor(color); |
this._changeSwatchText(colorString); |
}, |