diff --git a/layout/generic/ScrollAnchorContainer.cpp b/layout/generic/ScrollAnchorContainer.cpp index a62318c475b5..73ab05205832 100644 --- a/layout/generic/ScrollAnchorContainer.cpp +++ b/layout/generic/ScrollAnchorContainer.cpp @@ -345,15 +345,13 @@ void ScrollAnchorContainer::ApplyAdjustments() { break; } } - nsIntPoint physicalDevicePixels = physicalAdjustment.ToNearestPixels( - Frame()->PresContext()->AppUnitsPerDevPixel()); MOZ_ASSERT(!mApplyingAnchorAdjustment); // We should use AutoRestore here, but that doesn't work with bitfields mApplyingAnchorAdjustment = true; - mScrollFrame->ScrollBy( - physicalDevicePixels, nsIScrollableFrame::DEVICE_PIXELS, - nsIScrollableFrame::INSTANT, nullptr, nsGkAtoms::relative); + mScrollFrame->ScrollTo( + mScrollFrame->GetScrollPosition() + physicalAdjustment, + nsIScrollableFrame::INSTANT, nsGkAtoms::relative); mApplyingAnchorAdjustment = false; nsPresContext* pc = Frame()->PresContext();