Use non-rounded scroll position in nsHTMLScrollFrame::ScrollByCSSPixelsInternal behind layout.scroll.disable-pixel-alignment pref
Categories
(Core :: Layout: Scrolling and Overflow, task)
Tracking
()
People
(Reporter: hiro, Assigned: hiro)
References
Details
Attachments
(2 files)
We use rounded scroll positions in nsHTMLScrollFrame::ScrollByCSSPixelsInternal, it is the cause of 1px difference failure in the wpt added in bug 1874551.
| Assignee | ||
Comment 1•2 years ago
|
||
| Assignee | ||
Comment 2•2 years ago
|
||
Depends on D198766
| Assignee | ||
Comment 3•2 years ago
|
||
Note that nsHTMLScrollFrame::ScrollToCSSPixels also uses the rounded scroll position but I leave it as it is for now since it's entirely unclear to me about the following comparisons in the function;
// XXX I don't think the following blocks are needed anymore, now that
// ScrollToImpl simply tries to scroll an integer number of layer
// pixels from the current position
nsPoint current = GetScrollPosition();
if (currentCSSPixels.x == aScrollPosition.x) {
pt.x = current.x;
range.x = pt.x;
range.width = 0;
}
if (currentCSSPixels.y == aScrollPosition.y) {
pt.y = current.y;
range.y = pt.y;
range.height = 0;
}
As the comment said, I guess it's not necessary, but if it's still necessary, or if we leave the comparison here in this bug, comparing CSSPoint with CSSIntPoint would be problematic. If we round the CSSPoint value for the comparison, it would be identical to the current version in most cases.
Comment 5•2 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/8a492fe4ed55
https://hg.mozilla.org/mozilla-central/rev/e6395c398b89
Updated•2 years ago
|
Description
•