Created attachment 96114 [details] Testcase BUILD: Current WebKit nightly (or current Chrome dev) STEPS TO REPRODUCE: 1) Load attached testcase. 2) Examine the sum of the "r" and "b" values in the printed rgb() triplets. EXPECTED RESULTS: Sum is always 255. ACTUAL RESULTS: Sum is 254 for most of them. ADDITIONAL NOTES: This is a regression from Safari 5. To see why the expected results are expected, note that at time t/5s in the range [0, 1] in the transition the computed color should be: rgb(255*(1-t), 0, 255*t); Now the color components will be rounded, but, for example, if 255*(1-t) is rounding to 254 then 255*t > 0.5. And therefore 255*t should be rounding to 1, not to 0. It looks like WebKit is just truncating the floating-point color values to get the interpolated color value instead of correctly rounding.
Color values are stored as unsigned bytes, so rounding is unsurprising.
Rounding is unsurprising, but my point is that your rounding is wrong. You're rounding down instead of rounding to nearest.
Created attachment 96187 [details] Better testcase
Created attachment 96190 [details] Patch
http://trac.webkit.org/changeset/88214