diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /layout/generic/StickyScrollContainer.cpp | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/generic/StickyScrollContainer.cpp')
-rw-r--r-- | layout/generic/StickyScrollContainer.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/layout/generic/StickyScrollContainer.cpp b/layout/generic/StickyScrollContainer.cpp index 2e9d32ab5f..416bbbf4c4 100644 --- a/layout/generic/StickyScrollContainer.cpp +++ b/layout/generic/StickyScrollContainer.cpp @@ -186,12 +186,17 @@ void StickyScrollContainer::ComputeStickyLimits(nsIFrame* aFrame, // Containing block limits for the position of aFrame relative to its parent. // The margin box of the sticky element stays within the content box of the - // contaning-block element. + // containing-block element. if (cbFrame == scrolledFrame) { // cbFrame is the scrolledFrame, and it won't have continuations. Unlike the - // else clause, we consider scrollable overflow rect because and the union - // of its in-flow rects doesn't include the scrollable overflow area. + // else clause, we consider scrollable overflow rect because the union of + // its in-flow rects doesn't include the scrollable overflow area. We need + // to subtract the padding however, which _is_ included in the scrollable + // area, since we want the content box. + MOZ_ASSERT(cbFrame->GetUsedBorder() == nsMargin(), + "How did the ::-moz-scrolled-frame end up with border?"); *aContain = cbFrame->ScrollableOverflowRectRelativeToSelf(); + aContain->Deflate(cbFrame->GetUsedPadding()); nsLayoutUtils::TransformRect(cbFrame, aFrame->GetParent(), *aContain); } else { *aContain = nsLayoutUtils::GetAllInFlowRectsUnion( |