Title: [158439] trunk/Source/WebInspectorUI
Revision
158439
Author
grao...@apple.com
Date
2013-11-01 11:06:08 -0700 (Fri, 01 Nov 2013)

Log Message

Error trying to serialize a color created without an alpha component to RGBA or HSLA
https://bugs.webkit.org/show_bug.cgi?id=123623

Reviewed by Joseph Pecoraro.

Check whether we have .rgba and .hsla ivars before trying to retrieve them to serialize
the color to RGBA or HSLA format.

* UserInterface/Color.js:
(WebInspector.Color.prototype.toString):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (158438 => 158439)


--- trunk/Source/WebInspectorUI/ChangeLog	2013-11-01 18:03:18 UTC (rev 158438)
+++ trunk/Source/WebInspectorUI/ChangeLog	2013-11-01 18:06:08 UTC (rev 158439)
@@ -1,5 +1,18 @@
 2013-11-01  Antoine Quint  <grao...@apple.com>
 
+        Error trying to serialize a color created without an alpha component to RGBA or HSLA
+        https://bugs.webkit.org/show_bug.cgi?id=123623
+
+        Reviewed by Joseph Pecoraro.
+
+        Check whether we have .rgba and .hsla ivars before trying to retrieve them to serialize
+        the color to RGBA or HSLA format.
+
+        * UserInterface/Color.js:
+        (WebInspector.Color.prototype.toString):
+
+2013-11-01  Antoine Quint  <grao...@apple.com>
+
         Remove custom Element.prototype.remove() in favor of native version
         https://bugs.webkit.org/show_bug.cgi?id=123607
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Color.js (158438 => 158439)


--- trunk/Source/WebInspectorUI/UserInterface/Color.js	2013-11-01 18:03:18 UTC (rev 158438)
+++ trunk/Source/WebInspectorUI/UserInterface/Color.js	2013-11-01 18:06:08 UTC (rev 158439)
@@ -241,12 +241,14 @@
             case WebInspector.Color.Format.RGB:
                 return "rgb(" + this.rgb.join(", ") + ")";
             case WebInspector.Color.Format.RGBA:
-                return "rgba(" + this.rgba.join(", ") + ")";
+                return "rgba(" + (this.rgba ? this.rgba : this.rgb.concat(1)).join(", ") + ")";
             case WebInspector.Color.Format.HSL:
                 var hsl = this.hsl;
                 return "hsl(" + hsl[0] + ", " + hsl[1] + "%, " + hsl[2] + "%)";
             case WebInspector.Color.Format.HSLA:
                 var hsla = this.hsla;
+                if (!hsla)
+                    return "hsla(" + hsl[0] + ", " + hsl[1] + "%, " + hsl[2] + "%, 1)";
                 return "hsla(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%, " + hsla[3] + ")";
             case WebInspector.Color.Format.HEX:
                 return "#" + this.hex;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to