On Friday 2015-11-06 07:16 -0800, Darin Adler wrote:
> > On Nov 5, 2015, at 11:24 PM, L. David Baron <dba...@dbaron.org> wrote:
> > 
> > For what it's worth, Gecko does have code to produce a
> > minimal-length alpha value.  nsStyleUtil::ColorComponentToFloat just
> > tries rounding to 2 decimal places, sees if the resulting float
> > round-trips back to the same 0-255 alpha value, and if it doesn't,
> > rounds to 3 places.
> Got it. Sounds like it does what I have in mind. Except that given what you 
> say it sounds like it doesn’t use a single decimal place even if that round 
> trips, so for 51 it uses 0.20 rather than 0.2.

The float -> string code handles that, though, so it does come out
as 0.2.


π„ž   L. David Baron                         http://dbaron.org/   𝄂
𝄒   Mozilla                          https://www.mozilla.org/   𝄂
             Before I built a wall I'd ask to know
             What I was walling in or walling out,
             And to whom I was like to give offense.
               - Robert Frost, Mending Wall (1914)

Attachment: signature.asc
Description: Digital signature

webkit-dev mailing list

Reply via email to