tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit e7f0af00dbe76b831d710e00e15a7b5631c0c984
parent d8c8dd249dc40a457dd62d87a342ace52f23bd80
Author: David Shin <dshin@mozilla.com>
Date:   Thu, 30 Oct 2025 22:27:10 +0000

Bug 1987961: Stop taking scroll offset into account during anchor positioning offset resolution. r=jwatt

Differential Revision: https://phabricator.services.mozilla.com/D266465

Diffstat:
Mlayout/base/AnchorPositioningUtils.cpp | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/layout/base/AnchorPositioningUtils.cpp b/layout/base/AnchorPositioningUtils.cpp @@ -434,7 +434,8 @@ Maybe<AnchorPosInfo> AnchorPositioningUtils::GetAnchorPosRect( if (aCBRectIsvalid) { const nsRect result = nsLayoutUtils::GetCombinedFragmentRects(aAnchor, true); - const auto offset = aAnchor->GetOffsetTo(aAbsoluteContainingBlock); + const auto offset = + aAnchor->GetOffsetToIgnoringScrolling(aAbsoluteContainingBlock); // Easy, just use the existing function. return Some(result + offset); } @@ -458,7 +459,7 @@ Maybe<AnchorPosInfo> AnchorPositioningUtils::GetAnchorPosRect( // going to do it again here, which feels a little wasteful. const nsRect rectToContainerChild = nsLayoutUtils::GetCombinedFragmentRects(aAnchor, true); - const auto offset = aAnchor->GetOffsetTo(containerChild); + const auto offset = aAnchor->GetOffsetToIgnoringScrolling(containerChild); return Some(rectToContainerChild + offset + containerChild->GetPosition()); }(); return rect.map([&](const nsRect& aRect) {