[Webkit-unassigned] [Bug 26030] [Chromium] Chromium Linux ignores background color on <select>.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jun 5 17:34:30 PDT 2009


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





------- Comment #16 from agl at chromium.org  2009-06-05 17:34 PDT -------
> What is the purpose of the while loop?

The spec said "mod 360", which is most accurately turned into a while loop.

Considering the case where max == r (which looks most likely to overflow 720
since it has the largest constant).

We have
hue = (60.0 * ((g - b) / (max - min))) + 360.0

so (g - b) / (max - min) must be < 6 in order not to overflow.

We know that max > g and max > b (since max == r) and that min == g or min ==
b.

Consider g >= b, thus b == min and thus g - b < max - min so the whole fraction
is <= 1.
The alternative case leads, via similar reasoning to the fraction being >= -1.

So, we can change the while to an if. I'll do that.

The f's were a left over from when I wrote it with floats. I'll remove them,
thanks.


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



More information about the webkit-unassigned mailing list