Closed
Bug 372782
Opened 18 years ago
Closed 18 years ago
add alpha-component rounding to computed style code
Categories
(Core :: DOM: CSS Object Model, defect)
Core
DOM: CSS Object Model
Tracking
()
RESOLVED
FIXED
People
(Reporter: dbaron, Assigned: dbaron)
References
Details
Attachments
(1 file)
(deleted),
patch
|
bzbarsky
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
To the code from bug 347912 we should add rounding as done in the patch to bug 372770 so that we don't output over-precise alpha components.
Assignee | ||
Comment 1•18 years ago
|
||
Steps to reproduce:
1. load attachment 257575 [details].
2. look at the last cell of the last line
Expected results: rgba(128, 17, 41, 0.7)
Actual results: rgba(128, 17, 41, 0.701961)
Assignee | ||
Comment 2•18 years ago
|
||
This adds the functions going both directions to nsStyleUtil so that the relationship is clearer to future maintainers.
Attachment #257588 -
Flags: superreview?(bzbarsky)
Attachment #257588 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 3•18 years ago
|
||
Although, it occurs to me that perhaps people will want to do math more often on computed style output, and perhaps we should just leave the computed style code alone, take the rest of the patch, and wontfix this bug. Thoughts?
Comment 4•18 years ago
|
||
Comment on attachment 257588 [details] [diff] [review]
patch
>+nsStyleUtil::ColorComponentToFloat(PRUint8 aAlpha)
>+ if (NSToIntRound(rounded * 255.0f) != aAlpha) {
FloatToColorComponent() here?
I think this is reasonable to do... I doubt people are that much more likely to do math on the computed style, really.
Attachment #257588 -
Flags: superreview?(bzbarsky)
Attachment #257588 -
Flags: superreview+
Attachment #257588 -
Flags: review?(bzbarsky)
Attachment #257588 -
Flags: review+
Assignee | ||
Comment 5•18 years ago
|
||
Checked in to trunk with above change.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•18 years ago
|
Flags: in-testsuite?
You need to log in
before you can comment on or make changes to this bug.
Description
•