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 7fd36524368405e12bbf0d8879feeb2759b2cb2e..d0408b1c709a155d07d125a85c11c0f038051222 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/sources/CSSSourceFrame.js |
+++ b/third_party/WebKit/Source/devtools/front_end/sources/CSSSourceFrame.js |
@@ -141,7 +141,7 @@ WebInspector.CSSSourceFrame.prototype = { |
for (var i = 0; i < colorPositions.length; i++) { |
var colorPosition = colorPositions[i]; |
var swatch = WebInspector.ColorSwatch.create(); |
- swatch.setColorText(colorPosition.color.asString(WebInspector.Color.Format.Original)); |
+ swatch.setColor(colorPosition.color); |
swatch.iconElement().title = WebInspector.UIString("Open color picker."); |
swatch.hideText(true); |
var bookmark = this.textEditor.addBookmark(colorPosition.textRange.startLine, colorPosition.textRange.startColumn, swatch, WebInspector.CSSSourceFrame.SwatchBookmark); |
@@ -200,10 +200,13 @@ WebInspector.CSSSourceFrame.prototype = { |
*/ |
_spectrumChanged: function(event) |
{ |
+ var colorString = /** @type {string} */ (event.data); |
+ var color = WebInspector.Color.parse(colorString) |
dgozman
2016/09/02 22:08:01
style: missing semicolon
flandy
2016/09/02 23:09:18
Sorry, done.
|
+ if (!color) |
+ return; |
+ this._currentSwatch.setColor(color); |
this._muteColorProcessing = true; |
this._hadSpectrumChange = true; |
- var colorString = /** @type {string} */ (event.data); |
- this._currentSwatch.setColorText(colorString); |
this._textEditor.editRange(this._currentColorTextRange, colorString, "*color-text-changed"); |
this._currentColorTextRange.endColumn = this._currentColorTextRange.startColumn + colorString.length; |
}, |