Bug 1875011 - Use non-rounded scroll position behind layout.scroll.disable-pixel-alignment in nsHTMLScrollFrame::ScrollByCSSPixelsInternal. r=botond

Depends on D198766

Differential Revision: https://phabricator.services.mozilla.com/D198767
This commit is contained in:
Hiroyuki Ikezoe 2024-01-17 06:27:05 +00:00
Родитель 0fcc48906c
Коммит d6384b20c1
2 изменённых файлов: 11 добавлений и 1 удалений

Просмотреть файл

@ -5006,7 +5006,12 @@ void nsHTMLScrollFrame::ScrollByCSSPixelsInternal(const CSSIntPoint& aDelta,
// the previous scrolling operation, but there may be some edge cases where
// the current position in CSS pixels differs from the given position, the
// cases should be fixed in bug 1556685.
CSSIntPoint currentCSSPixels = GetRoundedScrollPositionCSSPixels();
CSSPoint currentCSSPixels;
if (StaticPrefs::layout_scroll_disable_pixel_alignment()) {
currentCSSPixels = GetScrollPositionCSSPixels();
} else {
currentCSSPixels = GetRoundedScrollPositionCSSPixels();
}
nsPoint pt = CSSPoint::ToAppUnits(currentCSSPixels + aDelta);
nscoord halfPixel = nsPresContext::CSSPixelsToAppUnits(0.5f);

Просмотреть файл

@ -79,6 +79,7 @@ class nsHTMLScrollFrame : public nsContainerFrame,
using InScrollingGesture = nsIScrollableFrame::InScrollingGesture;
using CSSIntPoint = mozilla::CSSIntPoint;
using CSSPoint = mozilla::CSSPoint;
using ScrollReflowInput = mozilla::ScrollReflowInput;
using ScrollAnchorContainer = mozilla::layout::ScrollAnchorContainer;
friend nsHTMLScrollFrame* NS_NewHTMLScrollFrame(
@ -702,6 +703,10 @@ class nsHTMLScrollFrame : public nsContainerFrame,
mMayScheduleScrollAnimations = false;
}
CSSPoint GetScrollPositionCSSPixels() const {
return CSSPoint::FromAppUnits(GetScrollPosition());
}
public:
void UpdateSticky();