diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
commit | fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch) | |
tree | 4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /layout/generic/StickyScrollContainer.cpp | |
parent | Releasing progress-linux version 124.0.1-1~progress7.99u1. (diff) | |
download | firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip |
Merging upstream version 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( |