Closed
Bug 503814
Opened 15 years ago
Closed 15 years ago
iframe contents shifted slightly due to rounding issue
Categories
(Core :: Layout, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: tnikkel, Assigned: tnikkel)
References
Details
Attachments
(2 files)
(deleted),
patch
|
roc
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
(deleted),
text/html
|
Details |
The patch in bug 448830 replaced ScaleRoundPreservingCentersInverse with the seemingly functionally equivalent ToNearestPixels. Except ToNearestPixels uses NSToIntRound where ScaleRoundPreservingCentersInverse used NSToCoordRound. NSToIntRound rounds away from zero, whereas NSToCoordRound rounds towards positive infinity. Robert's blog describes the problem well http://weblogs.mozillazine.org/roc/archives/2008/02/rounding_toward.html . In this specific case nsView::CalcWidgetBounds takes the viewBounds with y = -30 and height = 9000 and gets pixel bounds with y = -1 and height = 151, which should be y = 0 and height = 150.
I did that safe thing and didn't use the fast NS_lroundup30 from NSToCoordRound since we are dealing with ints that may not be restricted to nscoord values.
I think bug 477236 is the same issue, but I can't reproduce so I can't tell.
I did a quick survey of the other users of NSToIntRound, it seems like a lot of them should be using NSToIntRoundUp. We should audit all uses of NSToIntRound as there is at least one similar bug (bug 428446) that predates the landing from bug 448830 that might be fixed by always rounding up.
Attachment #388176 -
Flags: superreview?(roc)
Attachment #388176 -
Flags: review?(roc)
Assignee | ||
Comment 1•15 years ago
|
||
Looks fine on Linux, but on Windows you can see the problem. The background colors aren't needed, but they make the problem easier to see.
Comment on attachment 388176 [details] [diff] [review]
patch
Mmmm ... thanks!
Attachment #388176 -
Flags: superreview?(roc)
Attachment #388176 -
Flags: superreview+
Attachment #388176 -
Flags: review?(roc)
Attachment #388176 -
Flags: review+
Assignee | ||
Updated•15 years ago
|
Keywords: checkin-needed
Whiteboard: [needs landing]
Assignee | ||
Updated•15 years ago
|
Flags: blocking1.9.2?
Comment 3•15 years ago
|
||
Status: NEW → RESOLVED
Closed: 15 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Assignee | ||
Updated•15 years ago
|
Keywords: checkin-needed
Whiteboard: [needs landing]
Flags: blocking1.9.2? → wanted1.9.2+
You need to log in
before you can comment on or make changes to this bug.
Description
•