W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2011

[whatwg] Inconsistency between canvas and CSS color serialization

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Thu, 03 Feb 2011 13:55:21 -0500
Message-ID: <4D4AFA19.3000708@mit.edu>
It looks like CSS rgba colors with an alpha value of 0 are serialized as 
rgba() with "0" as the alpha value. in at least Gecko, Webkit, and Presto.

It also looks like canvas style color with an alpha value of 0 are 
serialized as rgba() with "0.0" as the alpha value in Gecko 3.6, Webkit, 
and Presto.

In Gecko 2.0 we made a change to the canvas code to fix some bugs in the 
serialization by the simple expedient of reusing the well-tested code 
that CSS colors use.  This has the incidental benefit of more behavior 
consistency for authors.  Unfortunately, this makes us not do what these 
other UAs do, nor do what the current spec draft says.

While we can clearly special-case 0 in this code, it seems like an 
authoring pitfall to have the two different serialization styles, so I 
would prefer to have consistent behavior between the two.  What do other 
UA vendors think of standardizing on "0" as the serialization for canvas 
color alpha channels when they're transparent?  Alternately, what about 
using "0.0" for CSS colors?

Received on Thursday, 3 February 2011 10:55:21 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:30 UTC