[Webkit-unassigned] [Bug 38845] Canvas color property getters should serialize them according to spec

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 12 00:09:14 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=38845





--- Comment #13 from Andreas Kling <andreas.kling at nokia.com>  2010-05-12 00:09:13 PST ---
(In reply to comment #12)
> I'm sorry, I missread the spec. The spec talks about 1 _or more digits_ for fractional part. Nevertheless, if alpha is zero, you just use one digit after the point, if alpha is >0 but <1 you use 5? Shouldn't we have the same count of digits? What is FF and Opera doing here? Maybe we should aline to them here.
> In my opinion, the fractional part should allways have the same count of digits, this makes the parsing easier for the user. If you want, you can write a mail to whatwg at lists.whatwg.org for clarification.

I copied FF's logic here: "0.0" for transparent, 5 digits otherwise. Just tested on Opera and they return the least possible amount of digits.

The other reason I didn't want to use 5 digits for transparent is that some of the HTML5 Canvas tests check for "rgba(0, 0, 0, 0.0)" ;-)

> Another point is String::format(). This is not language aware on some posix-systems (point or comma on fractional numbers). See bug 18994. You can also ask Evan Martin for a better solution here.

So this will actually break on systems where %f is printed with a comma? Not good.

> ...
> the complete class shouldn't be indented, please also put serializedCanvasColor after the class definition.

I didn't want to mess up svn/git blame, but sure why not?

> The code looks much better. I would like to see Oliver to give some comments on this bug.

That'd be nice indeed.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list