Created attachment 263309 [details] testcase <div style="color: rgba(0,0,255,4.3)">alpha: 4.3 !?</div> triggers an assertion: ###!!! ASSERTION: out of range: '0.0 <= aAlpha && aAlpha <= 1.0', file /Users/jruderman/trunk/mozilla/layout/style/nsStyleUtil.h, line 87 I'm also not sure Firefox's rendering is correct. It renders as if alpha were 0.3, which seems wrong to me, but I don't see anything in http://www.w3.org/TR/css3-color/ that specifies how it should render. (Two reasonable answers would be "clamp the alpha value to 1" and "ignore the entire rgba as invalid".)
http://www.w3.org/TR/css3-color/#alphavaluedt says: # Any values outside the range 0.0 (fully transparent) to 1.0 (fully opaque) # will be clamped to this range.
This is a regression from bug 372782. We do the clamping too late, and nsStyleUtil::FloatToColorComponent automatically takes the remainder mod 255 on return, since the return value is a PRUint8.
Created attachment 263322 [details] [diff] [review] Fix
Priority: -- → P1
Summary: rgba(0,0,255,4.3) renders with alpha of 0.3 and triggers "ASSERTION: out of range" → [FIX]rgba(0,0,255,4.3) renders with alpha of 0.3 and triggers "ASSERTION: out of range"
Target Milestone: --- → mozilla1.9alpha5
Comment on attachment 263322 [details] [diff] [review] Fix r+sr=dbaron. Thanks for fixing this.
Status: ASSIGNED → RESOLVED
Last Resolved: 12 years ago
Flags: blocking1.9? → in-testsuite+
Resolution: --- → FIXED
Depends on: 379786
The last line of the testcase fails on Mac with subpixel anti-aliasing (see bug 379786). I'm not sure how to fix that bug; in the meantime what should we do? Mark the test random on Mac?
How about changing the reftest for this bug to test opacity against opacity and rgba against rgba?
The last line of the test is a control to test that rgba() works at all. It needs to be tested against opacity. So we should probably factor it out into a separate test and make that test random on Mac. I'll do that.
Did that. That one line is now marked as random on cocoa, pending bug 379786. Once thats fixed, we should undo it.
You need to log in before you can comment on or make changes to this bug.