From 6bdc12be0132f3270cd37d426d9edf492512a9bb Mon Sep 17 00:00:00 2001 From: Ryan Hunt Date: Thu, 7 Feb 2019 20:39:49 -0600 Subject: [PATCH] Bug 1519553 - Don't round scroll anchor adjustments to device pixels. r=dholbert Differential Revision: https://phabricator.services.mozilla.com/D19107 --HG-- extra : source : 7f29bb7519563e3aaafa2e484a356409ce05aab7 extra : histedit_source : 3f1c287cc5984bf896ed43cccd7533d39cda40c9 --- layout/generic/ScrollAnchorContainer.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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();