Closed
Bug 379316
Opened 18 years ago
Closed 18 years ago
[FIX]rgba(0,0,255,4.3) renders with alpha of 0.3 and triggers "ASSERTION: out of range"
Categories
(Core :: CSS Parsing and Computation, defect, P1)
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha5
People
(Reporter: jruderman, Assigned: bzbarsky)
References
(Blocks 1 open bug)
Details
(Keywords: assertion, testcase)
Attachments
(2 files)
(deleted),
text/html
|
Details | |
(deleted),
patch
|
dbaron
:
review+
dbaron
:
superreview+
|
Details | Diff | Splinter Review |
<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".)
Comment 1•18 years ago
|
||
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.
Updated•18 years ago
|
Flags: blocking1.9?
Assignee | ||
Comment 2•18 years ago
|
||
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.
Blocks: 372782
Assignee | ||
Comment 3•18 years ago
|
||
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Attachment #263322 -
Flags: superreview?(dbaron)
Attachment #263322 -
Flags: review?(dbaron)
Assignee | ||
Updated•18 years ago
|
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 4•18 years ago
|
||
Comment on attachment 263322 [details] [diff] [review]
Fix
r+sr=dbaron. Thanks for fixing this.
Attachment #263322 -
Flags: superreview?(dbaron)
Attachment #263322 -
Flags: superreview+
Attachment #263322 -
Flags: review?(dbaron)
Attachment #263322 -
Flags: review+
Assignee | ||
Comment 5•18 years ago
|
||
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 18 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?
Reporter | ||
Comment 7•18 years ago
|
||
How about changing the reftest for this bug to test opacity against opacity and rgba against rgba?
Assignee | ||
Comment 8•18 years ago
|
||
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.
Assignee | ||
Comment 9•18 years ago
|
||
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.
Description
•