diff --git a/gfx/layers/wr/WebRenderLayerManager.cpp b/gfx/layers/wr/WebRenderLayerManager.cpp index c29517c6966c..f32517f3e67a 100644 --- a/gfx/layers/wr/WebRenderLayerManager.cpp +++ b/gfx/layers/wr/WebRenderLayerManager.cpp @@ -366,7 +366,7 @@ void WebRenderLayerManager::EndTransactionWithoutLayer( *mDLBuilder, resourceUpdates, aDisplayList, aDisplayListBuilder, mScrollData, std::move(aFilters)); - aDisplayListBuilder->NotifyAndClearScrollFrames(); + aDisplayListBuilder->NotifyAndClearScrollContainerFrames(); builderDumpIndex = mWebRenderCommandBuilder.GetBuilderDumpIndex(); containsSVGGroup = mWebRenderCommandBuilder.GetContainsSVGGroup(); diff --git a/gfx/layers/wr/WebRenderScrollData.cpp b/gfx/layers/wr/WebRenderScrollData.cpp index b133d0c6bd2b..d3438ede7728 100644 --- a/gfx/layers/wr/WebRenderScrollData.cpp +++ b/gfx/layers/wr/WebRenderScrollData.cpp @@ -74,7 +74,8 @@ void WebRenderLayerScrollData::Initialize( Maybe metadata = asr->mScrollContainerFrame->ComputeScrollMetadata( aOwner.GetManager(), aItem->Frame(), aItem->ToReferenceFrame()); - aOwner.GetBuilder()->AddScrollFrameToNotify(asr->mScrollContainerFrame); + aOwner.GetBuilder()->AddScrollContainerFrameToNotify( + asr->mScrollContainerFrame); if (metadata) { MOZ_ASSERT(metadata->GetMetrics().GetScrollId() == scrollId); mScrollIds.AppendElement(aOwner.AddMetadata(metadata.ref())); diff --git a/layout/base/DisplayPortUtils.cpp b/layout/base/DisplayPortUtils.cpp index 008159baed44..f63a334a5918 100644 --- a/layout/base/DisplayPortUtils.cpp +++ b/layout/base/DisplayPortUtils.cpp @@ -73,7 +73,8 @@ DisplayPortMargins DisplayPortMargins::ForContent( } ScreenMargin DisplayPortMargins::GetRelativeToLayoutViewport( - ContentGeometryType aGeometryType, nsIScrollableFrame* aScrollableFrame, + ContentGeometryType aGeometryType, + ScrollContainerFrame* aScrollContainerFrame, const CSSToScreenScale2D& aDisplayportScale) const { // APZ wants |mMargins| applied relative to the visual viewport. // The main-thread painting code applies margins relative to @@ -82,7 +83,7 @@ ScreenMargin DisplayPortMargins::GetRelativeToLayoutViewport( // magnitude of the translation depends on whether we are // applying the displayport to scrolled or fixed content. CSSPoint scrollDeltaCss = - ComputeAsyncTranslation(aGeometryType, aScrollableFrame); + ComputeAsyncTranslation(aGeometryType, aScrollContainerFrame); ScreenPoint scrollDelta = scrollDeltaCss * aDisplayportScale; ScreenMargin margins = mMargins; margins.left -= scrollDelta.x; @@ -106,7 +107,7 @@ std::ostream& operator<<(std::ostream& aOs, CSSPoint DisplayPortMargins::ComputeAsyncTranslation( ContentGeometryType aGeometryType, - nsIScrollableFrame* aScrollableFrame) const { + ScrollContainerFrame* aScrollContainerFrame) const { // If we are applying the displayport to scrolled content, the // translation is the entire difference between the visual and // layout offsets. @@ -122,15 +123,14 @@ CSSPoint DisplayPortMargins::ComputeAsyncTranslation( // with it. We want only the remaining delta, i.e. the offset of // the visual viewport relative to the (async-scrolled) layout // viewport. - if (!aScrollableFrame) { + if (!aScrollContainerFrame) { // Displayport on a non-scrolling frame for some reason. // There will be no divergence between the two viewports. return CSSPoint(); } // Fixed content is always fixed to an RSF. - MOZ_ASSERT(aScrollableFrame->IsRootScrollFrameOfDocument()); - nsIFrame* scrollFrame = do_QueryFrame(aScrollableFrame); - if (!scrollFrame->PresShell()->IsVisualViewportSizeSet()) { + MOZ_ASSERT(aScrollContainerFrame->IsRootScrollFrameOfDocument()); + if (!aScrollContainerFrame->PresShell()->IsVisualViewportSizeSet()) { // Zooming is disabled, so the layout viewport tracks the // visual viewport completely. return CSSPoint(); @@ -145,12 +145,13 @@ CSSPoint DisplayPortMargins::ComputeAsyncTranslation( // mVisualOffset, and using it to adjust the visual viewport size here. // Note that any incorrectness caused by this will only occur transiently // during async zooming. - CSSSize::FromAppUnits(scrollFrame->PresShell()->GetVisualViewportSize())}; + CSSSize::FromAppUnits( + aScrollContainerFrame->PresShell()->GetVisualViewportSize())}; const CSSRect scrollableRect = CSSRect::FromAppUnits( - nsLayoutUtils::CalculateExpandedScrollableRect(scrollFrame)); + nsLayoutUtils::CalculateExpandedScrollableRect(aScrollContainerFrame)); CSSRect asyncLayoutViewport{ mLayoutOffset, - CSSSize::FromAppUnits(aScrollableFrame->GetScrollPortRect().Size())}; + CSSSize::FromAppUnits(aScrollContainerFrame->GetScrollPortRect().Size())}; FrameMetrics::KeepLayoutViewportEnclosingVisualViewport( visualViewport, scrollableRect, /* out */ asyncLayoutViewport); return mVisualOffset - asyncLayoutViewport.TopLeft(); @@ -744,7 +745,7 @@ bool DisplayPortUtils::FrameHasDisplayPort(nsIFrame* aFrame, if (!aFrame->GetContent() || !HasDisplayPort(aFrame->GetContent())) { return false; } - nsIScrollableFrame* sf = do_QueryFrame(aFrame); + ScrollContainerFrame* sf = do_QueryFrame(aFrame); if (sf) { if (aScrolledFrame && aScrolledFrame != sf->GetScrolledFrame()) { return false; @@ -900,12 +901,12 @@ void DisplayPortUtils::ExpireDisplayPortOnAsyncScrollableAncestor( if (!frame) { break; } - nsIScrollableFrame* scrollAncestor = + ScrollContainerFrame* scrollAncestor = nsLayoutUtils::GetAsyncScrollableAncestorFrame(frame); if (!scrollAncestor) { break; } - frame = do_QueryFrame(scrollAncestor); + frame = scrollAncestor; MOZ_ASSERT(frame); if (!frame) { break; diff --git a/layout/base/DisplayPortUtils.h b/layout/base/DisplayPortUtils.h index feeb7c1875d7..7ffabfbf154e 100644 --- a/layout/base/DisplayPortUtils.h +++ b/layout/base/DisplayPortUtils.h @@ -102,15 +102,17 @@ struct DisplayPortMargins { // applied to (or, in the case of fixed content), the scroll frame wrt. which // the content is fixed. ScreenMargin GetRelativeToLayoutViewport( - ContentGeometryType aGeometryType, nsIScrollableFrame* aScrollableFrame, + ContentGeometryType aGeometryType, + ScrollContainerFrame* aScrollContainerFrame, const CSSToScreenScale2D& aDisplayportScale) const; friend std::ostream& operator<<(std::ostream& aOs, const DisplayPortMargins& aMargins); private: - CSSPoint ComputeAsyncTranslation(ContentGeometryType aGeometryType, - nsIScrollableFrame* aScrollableFrame) const; + CSSPoint ComputeAsyncTranslation( + ContentGeometryType aGeometryType, + ScrollContainerFrame* aScrollContainerFrame) const; }; struct DisplayPortMarginsPropertyData { diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp index 3ded11dd1da9..ad7303e66652 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp @@ -2200,11 +2200,10 @@ void PresShell::NotifyDestroyingFrame(nsIFrame* aFrame) { mFramesToDirty.Remove(aFrame); - nsIScrollableFrame* scrollableFrame = do_QueryFrame(aFrame); - if (scrollableFrame) { - mPendingScrollAnchorSelection.Remove(scrollableFrame); - mPendingScrollAnchorAdjustment.Remove(scrollableFrame); - mPendingScrollResnap.Remove(scrollableFrame); + if (ScrollContainerFrame* scrollContainerFrame = do_QueryFrame(aFrame)) { + mPendingScrollAnchorSelection.Remove(scrollContainerFrame); + mPendingScrollAnchorAdjustment.Remove(scrollContainerFrame); + mPendingScrollResnap.Remove(scrollContainerFrame); } } } @@ -2358,7 +2357,7 @@ PresShell::ScrollPage(bool aForward) { scrollContainerFrame->ScrollBy(nsIntPoint(0, aForward ? 1 : -1), ScrollUnit::PAGES, scrollMode, nullptr, mozilla::ScrollOrigin::NotSpecified, - nsIScrollableFrame::NOT_MOMENTUM, + ScrollContainerFrame::NOT_MOMENTUM, ScrollSnapFlags::IntendedDirection | ScrollSnapFlags::IntendedEndPosition); } @@ -2380,7 +2379,7 @@ PresShell::ScrollLine(bool aForward) { scrollContainerFrame->ScrollBy( nsIntPoint(0, aForward ? lineCount : -lineCount), ScrollUnit::LINES, scrollMode, nullptr, mozilla::ScrollOrigin::NotSpecified, - nsIScrollableFrame::NOT_MOMENTUM, ScrollSnapFlags::IntendedDirection); + ScrollContainerFrame::NOT_MOMENTUM, ScrollSnapFlags::IntendedDirection); } return NS_OK; } @@ -2394,7 +2393,7 @@ PresShell::ScrollCharacter(bool aRight) { int32_t h = StaticPrefs::toolkit_scrollbox_horizontalScrollDistance(); scrollContainerFrame->ScrollBy( nsIntPoint(aRight ? h : -h, 0), ScrollUnit::LINES, scrollMode, nullptr, - mozilla::ScrollOrigin::NotSpecified, nsIScrollableFrame::NOT_MOMENTUM, + mozilla::ScrollOrigin::NotSpecified, ScrollContainerFrame::NOT_MOMENTUM, ScrollSnapFlags::IntendedDirection); } return NS_OK; @@ -2406,10 +2405,11 @@ PresShell::CompleteScroll(bool aForward) { GetScrollContainerFrameToScroll(VerticalScrollDirection); ScrollMode scrollMode = apz::GetScrollModeForOrigin(ScrollOrigin::Other); if (scrollContainerFrame) { - scrollContainerFrame->ScrollBy( - nsIntPoint(0, aForward ? 1 : -1), ScrollUnit::WHOLE, scrollMode, - nullptr, mozilla::ScrollOrigin::NotSpecified, - nsIScrollableFrame::NOT_MOMENTUM, ScrollSnapFlags::IntendedEndPosition); + scrollContainerFrame->ScrollBy(nsIntPoint(0, aForward ? 1 : -1), + ScrollUnit::WHOLE, scrollMode, nullptr, + mozilla::ScrollOrigin::NotSpecified, + ScrollContainerFrame::NOT_MOMENTUM, + ScrollSnapFlags::IntendedEndPosition); } return NS_OK; } @@ -2581,11 +2581,11 @@ void PresShell::VerifyHasDirtyRootAncestor(nsIFrame* aFrame) { void PresShell::PostPendingScrollAnchorSelection( mozilla::layout::ScrollAnchorContainer* aContainer) { - mPendingScrollAnchorSelection.Insert(aContainer->ScrollableFrame()); + mPendingScrollAnchorSelection.Insert(aContainer->ScrollContainer()); } void PresShell::FlushPendingScrollAnchorSelections() { - for (nsIScrollableFrame* scroll : mPendingScrollAnchorSelection) { + for (ScrollContainerFrame* scroll : mPendingScrollAnchorSelection) { scroll->Anchor()->SelectAnchor(); } mPendingScrollAnchorSelection.Clear(); @@ -2593,23 +2593,24 @@ void PresShell::FlushPendingScrollAnchorSelections() { void PresShell::PostPendingScrollAnchorAdjustment( ScrollAnchorContainer* aContainer) { - mPendingScrollAnchorAdjustment.Insert(aContainer->ScrollableFrame()); + mPendingScrollAnchorAdjustment.Insert(aContainer->ScrollContainer()); } void PresShell::FlushPendingScrollAnchorAdjustments() { - for (nsIScrollableFrame* scroll : mPendingScrollAnchorAdjustment) { + for (ScrollContainerFrame* scroll : mPendingScrollAnchorAdjustment) { scroll->Anchor()->ApplyAdjustments(); } mPendingScrollAnchorAdjustment.Clear(); } -void PresShell::PostPendingScrollResnap(nsIScrollableFrame* aScrollableFrame) { - mPendingScrollResnap.Insert(aScrollableFrame); +void PresShell::PostPendingScrollResnap( + ScrollContainerFrame* aScrollContainerFrame) { + mPendingScrollResnap.Insert(aScrollContainerFrame); } void PresShell::FlushPendingScrollResnap() { - for (nsIScrollableFrame* scrollableFrame : mPendingScrollResnap) { - scrollableFrame->TryResnap(); + for (ScrollContainerFrame* scrollContainerFrame : mPendingScrollResnap) { + scrollContainerFrame->TryResnap(); } mPendingScrollResnap.Clear(); } @@ -3413,18 +3414,18 @@ static nscoord ComputeWhereToScroll(WhereToScroll aWhereToScroll, } static WhereToScroll GetApplicableWhereToScroll( - const nsIScrollableFrame* aFrameAsScrollable, + const ScrollContainerFrame* aScrollContainerFrame, const nsIFrame* aScrollableFrame, const nsIFrame* aTarget, ScrollDirection aScrollDirection, WhereToScroll aOriginal) { - MOZ_ASSERT(do_QueryFrame(aFrameAsScrollable) == aScrollableFrame); + MOZ_ASSERT(do_QueryFrame(aScrollContainerFrame) == aScrollableFrame); if (aTarget == aScrollableFrame) { return aOriginal; } StyleScrollSnapAlignKeyword align = aScrollDirection == ScrollDirection::eHorizontal - ? aFrameAsScrollable->GetScrollSnapAlignFor(aTarget).first - : aFrameAsScrollable->GetScrollSnapAlignFor(aTarget).second; + ? aScrollContainerFrame->GetScrollSnapAlignFor(aTarget).first + : aScrollContainerFrame->GetScrollSnapAlignFor(aTarget).second; switch (align) { case StyleScrollSnapAlignKeyword::None: @@ -3440,26 +3441,26 @@ static WhereToScroll GetApplicableWhereToScroll( } /** - * This function takes a scrollable frame, a rect in the coordinate system + * This function takes a scroll container frame, a rect in the coordinate system * of the scrolled frame, and a desired percentage-based scroll * position and attempts to scroll the rect to that position in the * visual viewport. * * This needs to work even if aRect has a width or height of zero. */ -static void ScrollToShowRect(nsIScrollableFrame* aFrameAsScrollable, +static void ScrollToShowRect(ScrollContainerFrame* aScrollContainerFrame, const nsIFrame* aScrollableFrame, const nsIFrame* aTarget, const nsRect& aRect, const Sides aScrollPaddingSkipSides, const nsMargin& aMargin, ScrollAxis aVertical, ScrollAxis aHorizontal, ScrollFlags aScrollFlags) { - nsPoint scrollPt = aFrameAsScrollable->GetVisualViewportOffset(); + nsPoint scrollPt = aScrollContainerFrame->GetVisualViewportOffset(); const nsPoint originalScrollPt = scrollPt; const nsRect visibleRect(scrollPt, - aFrameAsScrollable->GetVisualViewportSize()); + aScrollContainerFrame->GetVisualViewportSize()); const nsMargin padding = [&] { - nsMargin p = aFrameAsScrollable->GetScrollPadding(); + nsMargin p = aScrollContainerFrame->GetScrollPadding(); p.ApplySkipSides(aScrollPaddingSkipSides); return p + aMargin; }(); @@ -3467,7 +3468,7 @@ static void ScrollToShowRect(nsIScrollableFrame* aFrameAsScrollable, const nsRect rectToScrollIntoView = [&] { nsRect r(aRect); r.Inflate(padding); - return r.Intersect(aFrameAsScrollable->GetScrolledRect()); + return r.Intersect(aScrollContainerFrame->GetScrolledRect()); }(); nsSize lineSize; @@ -3478,12 +3479,12 @@ static void ScrollToShowRect(nsIScrollableFrame* aFrameAsScrollable, // it would assert and possible give the wrong result. if (aVertical.mWhenToScroll == WhenToScroll::IfNotVisible || aHorizontal.mWhenToScroll == WhenToScroll::IfNotVisible) { - lineSize = aFrameAsScrollable->GetLineScrollAmount(); + lineSize = aScrollContainerFrame->GetLineScrollAmount(); } - ScrollStyles ss = aFrameAsScrollable->GetScrollStyles(); + ScrollStyles ss = aScrollContainerFrame->GetScrollStyles(); nsRect allowedRange(scrollPt, nsSize(0, 0)); ScrollDirections directions = - aFrameAsScrollable->GetAvailableScrollingDirections(); + aScrollContainerFrame->GetAvailableScrollingDirections(); if (((aScrollFlags & ScrollFlags::ScrollOverflowHidden) || ss.mVertical != StyleOverflow::Hidden) && @@ -3494,7 +3495,7 @@ static void ScrollToShowRect(nsIScrollableFrame* aFrameAsScrollable, visibleRect.YMost() - padding.bottom)) { // If the scroll-snap-align on the frame is valid, we need to respect it. WhereToScroll whereToScroll = GetApplicableWhereToScroll( - aFrameAsScrollable, aScrollableFrame, aTarget, + aScrollContainerFrame, aScrollableFrame, aTarget, ScrollDirection::eVertical, aVertical.mWhereToScroll); nscoord maxHeight; @@ -3515,7 +3516,7 @@ static void ScrollToShowRect(nsIScrollableFrame* aFrameAsScrollable, visibleRect.XMost() - padding.right)) { // If the scroll-snap-align on the frame is valid, we need to respect it. WhereToScroll whereToScroll = GetApplicableWhereToScroll( - aFrameAsScrollable, aScrollableFrame, aTarget, + aScrollContainerFrame, aScrollableFrame, aTarget, ScrollDirection::eHorizontal, aHorizontal.mWhereToScroll); nscoord maxWidth; @@ -3544,17 +3545,17 @@ static void ScrollToShowRect(nsIScrollableFrame* aFrameAsScrollable, } else if (aScrollFlags & ScrollFlags::ScrollSmoothAuto) { behavior = ScrollBehavior::Auto; } - bool smoothScroll = aFrameAsScrollable->IsSmoothScroll(behavior); + bool smoothScroll = aScrollContainerFrame->IsSmoothScroll(behavior); if (smoothScroll) { scrollMode = ScrollMode::SmoothMsd; } - nsIFrame* frame = do_QueryFrame(aFrameAsScrollable); + nsIFrame* frame = do_QueryFrame(aScrollContainerFrame); AutoWeakFrame weakFrame(frame); - aFrameAsScrollable->ScrollTo(scrollPt, scrollMode, &allowedRange, - ScrollSnapFlags::IntendedEndPosition, - aScrollFlags & ScrollFlags::TriggeredByScript - ? ScrollTriggeredByScript::Yes - : ScrollTriggeredByScript::No); + aScrollContainerFrame->ScrollTo(scrollPt, scrollMode, &allowedRange, + ScrollSnapFlags::IntendedEndPosition, + aScrollFlags & ScrollFlags::TriggeredByScript + ? ScrollTriggeredByScript::Yes + : ScrollTriggeredByScript::No); if (!weakFrame.IsAlive()) { return; } @@ -3563,7 +3564,7 @@ static void ScrollToShowRect(nsIScrollableFrame* aFrameAsScrollable, // scroll the rect into view visually, and that may require scrolling // the visual viewport in scenarios where there is not enough layout // scroll range. - if (aFrameAsScrollable->IsRootScrollFrameOfDocument() && + if (aScrollContainerFrame->IsRootScrollFrameOfDocument() && frame->PresContext()->IsRootContentDocumentCrossProcess()) { frame->PresShell()->ScrollToVisual(scrollPt, FrameMetrics::eMainThread, scrollMode); @@ -3745,7 +3746,7 @@ bool PresShell::ScrollFrameIntoView( MaybeSkipPaddingSides(aTargetFrame); while (nsIFrame* parent = container->GetParent()) { container = parent; - if (static_cast(do_QueryFrame(container))) { + if (container->IsScrollContainerOrSubclass()) { // We really just need a non-fragmented frame so that we can accumulate // the bounds of all our continuations relative to it. We shouldn't jump // out of our nearest scrollable frame, and that's an ok reference @@ -3787,7 +3788,7 @@ bool PresShell::ScrollFrameIntoView( // Walk up the frame hierarchy scrolling the rect into view and // keeping rect relative to container do { - if (nsIScrollableFrame* sf = do_QueryFrame(container)) { + if (ScrollContainerFrame* sf = do_QueryFrame(container)) { nsPoint oldPosition = sf->GetScrollPosition(); nsRect targetRect = rect; // Inflate the scrolled rect by the container's padding in each dimension, @@ -6013,8 +6014,7 @@ void PresShell::MarkFramesInSubtreeApproximatelyVisible( nsRect rect = aRect; - nsIScrollableFrame* scrollFrame = do_QueryFrame(aFrame); - if (scrollFrame) { + if (ScrollContainerFrame* scrollFrame = do_QueryFrame(aFrame)) { bool ignoreDisplayPort = false; if (DisplayPortUtils::IsMissingDisplayPortBaseRect(aFrame->GetContent())) { // We can properly set the base rect for root scroll frames on top level @@ -8079,7 +8079,7 @@ PresShell::EventHandler::ComputeRootFrameToHandleEventWithCapturingContent( // scrollable frames should use the scrolling container as the root instead // of the document - nsIScrollableFrame* scrollFrame = do_QueryFrame(captureFrame); + ScrollContainerFrame* scrollFrame = do_QueryFrame(captureFrame); return scrollFrame ? scrollFrame->GetScrolledFrame() : aRootFrameToHandleEvent; } diff --git a/layout/base/PresShell.h b/layout/base/PresShell.h index 303ad727ad48..1f710a5897b6 100644 --- a/layout/base/PresShell.h +++ b/layout/base/PresShell.h @@ -68,7 +68,6 @@ class nsIFrame; class nsILayoutHistoryState; class nsINode; class nsIReflowCallback; -class nsIScrollableFrame; class nsITimer; class nsPageSequenceFrame; class nsPIDOMWindowOuter; @@ -485,7 +484,7 @@ class PresShell final : public nsStubDocumentObserver, void PostPendingScrollAnchorAdjustment( layout::ScrollAnchorContainer* aContainer); - void PostPendingScrollResnap(nsIScrollableFrame* aScrollableFrame); + void PostPendingScrollResnap(ScrollContainerFrame* aScrollContainerFrame); void FlushPendingScrollResnap(); void CancelAllPendingReflows(); @@ -1198,7 +1197,7 @@ class PresShell final : public nsStubDocumentObserver, // content (such as via window.scrollTo() should scroll the layout viewport // only). // If scrolling "far away", i.e. not just within the existing layout - // viewport, it's recommended to use both nsIScrollableFrame.ScrollTo*() + // viewport, it's recommended to use both ScrollContainerFrame.ScrollTo*() // (via window.scrollTo if calling from JS) *and* this function; otherwise, // temporary checkerboarding may result. If doing this: // * Be sure to call ScrollTo*() first, as a subsequent layout scroll @@ -1286,7 +1285,7 @@ class PresShell final : public nsStubDocumentObserver, * |aOrigin| specifies who originated the resolution change. For changes * sent by APZ, pass ResolutionChangeOrigin::Apz. For changes sent by * the main thread, pass ResolutionChangeOrigin::MainThreadAdjustment (similar - * to the |aOrigin| parameter of nsIScrollableFrame::ScrollToCSSPixels()). + * to the |aOrigin| parameter of ScrollContainerFrame::ScrollToCSSPixels()). */ nsresult SetResolutionAndScaleTo(float aResolution, ResolutionChangeOrigin aOrigin); @@ -1642,14 +1641,14 @@ class PresShell final : public nsStubDocumentObserver, * iframe or the like. If ScrollFlags::ScrollSmooth * is set and CSSOM-VIEW scroll-behavior is enabled, * we will scroll smoothly using - * nsIScrollableFrame::ScrollMode::SMOOTH_MSD; - * otherwise, nsIScrollableFrame::ScrollMode::INSTANT + * ScrollContainerFrame::ScrollMode::SMOOTH_MSD; + * otherwise, ScrollContainerFrame::ScrollMode::INSTANT * will be used. If ScrollFlags::ScrollSmoothAuto is * set, the CSSOM-View scroll-behavior attribute is * set to 'smooth' on the scroll frame, and CSSOM-VIEW * scroll-behavior is enabled, we will scroll smoothly - * using nsIScrollableFrame::ScrollMode::SMOOTH_MSD; - * otherwise, nsIScrollableFrame::ScrollMode::INSTANT + * using ScrollContainerFrame::ScrollMode::SMOOTH_MSD; + * otherwise, ScrollContainerFrame::ScrollMode::INSTANT * will be used. */ MOZ_CAN_RUN_SCRIPT @@ -3014,9 +3013,9 @@ class PresShell final : public nsStubDocumentObserver, // Set of frames that we should mark with NS_FRAME_HAS_DIRTY_CHILDREN after // we finish reflowing mCurrentReflowRoot. nsTHashSet mFramesToDirty; - nsTHashSet mPendingScrollAnchorSelection; - nsTHashSet mPendingScrollAnchorAdjustment; - nsTHashSet mPendingScrollResnap; + nsTHashSet mPendingScrollAnchorSelection; + nsTHashSet mPendingScrollAnchorAdjustment; + nsTHashSet mPendingScrollResnap; nsTHashSet mHiddenContentInForcedLayout; diff --git a/layout/base/RestyleManager.cpp b/layout/base/RestyleManager.cpp index cf94d36d60db..337600dfdb92 100644 --- a/layout/base/RestyleManager.cpp +++ b/layout/base/RestyleManager.cpp @@ -39,7 +39,6 @@ #include "ScrollSnap.h" #include "nsAnimationManager.h" #include "nsBlockFrame.h" -#include "nsIScrollableFrame.h" #include "nsContentUtils.h" #include "nsCSSFrameConstructor.h" #include "nsCSSRendering.h" @@ -1459,7 +1458,7 @@ static inline void TryToDealWithScrollbarChange(nsChangeHint& aHint, // Under these conditions, we're OK to assume that this "overflow" // change only impacts the root viewport's scrollframe, which // already exists, so we can simply reflow instead of reframing. - if (nsIScrollableFrame* sf = do_QueryFrame(aFrame)) { + if (ScrollContainerFrame* sf = do_QueryFrame(aFrame)) { sf->MarkScrollbarsDirtyForReflow(); } else if (ScrollContainerFrame* sf = aPc->PresShell()->GetRootScrollContainerFrame()) { @@ -1476,7 +1475,7 @@ static inline void TryToDealWithScrollbarChange(nsChangeHint& aHint, } const bool scrollable = aFrame->StyleDisplay()->IsScrollableOverflow(); - if (nsIScrollableFrame* sf = do_QueryFrame(aFrame)) { + if (ScrollContainerFrame* sf = do_QueryFrame(aFrame)) { if (scrollable && sf->HasAllNeededScrollbars()) { sf->MarkScrollbarsDirtyForReflow(); // Once we've created scrollbars for a frame, don't bother reconstructing diff --git a/layout/base/ScrollTypes.h b/layout/base/ScrollTypes.h index 512c2579bce9..e2aff6f61f39 100644 --- a/layout/base/ScrollTypes.h +++ b/layout/base/ScrollTypes.h @@ -7,13 +7,13 @@ #include "mozilla/TypedEnumBits.h" -// Types used in main-thread scrolling interfaces such as nsIScrollableFrame. +// Types used in main-thread scrolling interfaces such as ScrollContainerFrame. namespace mozilla { /** * Scroll modes for main-thread scroll operations. These are mostly used - * by nsIScrollableFrame methods. + * by ScrollContainerFrame methods. * * When a scroll operation is requested, we ask for instant, smooth, * smooth msd, or normal scrolling. diff --git a/layout/base/ViewportUtils.cpp b/layout/base/ViewportUtils.cpp index a5869bdcbf43..0e2bcb891f98 100644 --- a/layout/base/ViewportUtils.cpp +++ b/layout/base/ViewportUtils.cpp @@ -244,7 +244,7 @@ const nsIFrame* ViewportUtils::IsZoomedContentRoot(const nsIFrame* aFrame) { } if (aFrame->Type() == LayoutFrameType::Canvas || aFrame->Type() == LayoutFrameType::PageSequence) { - nsIScrollableFrame* sf = do_QueryFrame(aFrame->GetParent()); + ScrollContainerFrame* sf = do_QueryFrame(aFrame->GetParent()); if (sf && sf->IsRootScrollFrameOfDocument() && aFrame->PresContext()->IsRootContentDocumentCrossProcess()) { return aFrame->GetParent(); diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 0eb3ec14cb09..e294f80d1ec0 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -77,7 +77,6 @@ #include "nsIObjectLoadingContent.h" #include "nsIPopupContainer.h" #include "nsIScriptError.h" -#include "nsIScrollableFrame.h" #include "nsLayoutUtils.h" #include "nsListControlFrame.h" #include "nsMathMLParts.h" @@ -5477,8 +5476,9 @@ nsContainerFrame* nsCSSFrameConstructor::GetAbsoluteContainingBlock( type = absPosCBCandidate->Type(); } if (type == LayoutFrameType::ScrollContainer) { - nsIScrollableFrame* scrollFrame = do_QueryFrame(absPosCBCandidate); - absPosCBCandidate = scrollFrame->GetScrolledFrame(); + ScrollContainerFrame* scrollContainerFrame = + do_QueryFrame(absPosCBCandidate); + absPosCBCandidate = scrollContainerFrame->GetScrolledFrame(); if (!absPosCBCandidate) { continue; } diff --git a/layout/base/nsCaret.cpp b/layout/base/nsCaret.cpp index 8707dcba5f15..775d72845e01 100644 --- a/layout/base/nsCaret.cpp +++ b/layout/base/nsCaret.cpp @@ -14,13 +14,13 @@ #include "mozilla/CaretAssociationHint.h" #include "mozilla/gfx/2D.h" #include "mozilla/intl/BidiEmbeddingLevel.h" +#include "mozilla/ScrollContainerFrame.h" #include "mozilla/StaticPrefs_bidi.h" #include "nsCOMPtr.h" #include "nsFontMetrics.h" #include "nsITimer.h" #include "nsFrameSelection.h" #include "nsIFrame.h" -#include "nsIScrollableFrame.h" #include "nsIContent.h" #include "nsIFrameInlines.h" #include "nsLayoutUtils.h" @@ -188,7 +188,7 @@ void nsCaret::SetCaretReadOnly(bool aReadOnly) { static nsPoint AdjustRectForClipping(const nsRect& aRect, nsIFrame* aFrame, bool aVertical) { nsRect rectRelativeToClip = aRect; - nsIScrollableFrame* sf = nullptr; + ScrollContainerFrame* sf = nullptr; nsIFrame* scrollFrame = nullptr; for (nsIFrame* current = aFrame; current; current = current->GetParent()) { if ((sf = do_QueryFrame(current))) { diff --git a/layout/base/nsDocumentViewer.cpp b/layout/base/nsDocumentViewer.cpp index cea0832f2cff..3bc57a037715 100644 --- a/layout/base/nsDocumentViewer.cpp +++ b/layout/base/nsDocumentViewer.cpp @@ -2963,7 +2963,7 @@ static nscoord ScrollPositionForFrame( const nsIFrame* aFrame, ScrollContainerFrame* aScrollContainerFrame, float aPreviewScale) { // Note that even if the computed scroll position is out of the range of - // the scroll port, it gets clamped in nsIScrollableFrame::ScrollTo. + // the scroll port, it gets clamped in ScrollContainerFrame::ScrollTo. return nscoord(aPreviewScale * aFrame->GetRect().Center().y - float(aScrollContainerFrame->GetScrollPortRect().height) / 2.0f); diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 24d65a184544..d49896183e66 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -781,13 +781,11 @@ bool nsLayoutUtils::ShouldDisableApzForElement(nsIContent* aContent) { } void nsLayoutUtils::NotifyPaintSkipTransaction(ViewID aScrollId) { - if (nsIScrollableFrame* scrollFrame = + if (ScrollContainerFrame* sf = nsLayoutUtils::FindScrollContainerFrameFor(aScrollId)) { -#ifdef DEBUG - nsIFrame* f = do_QueryFrame(scrollFrame); - MOZ_ASSERT(f && f->PresShell() && !f->PresShell()->IsResolutionUpdated()); -#endif - scrollFrame->NotifyApzTransaction(); + MOZ_ASSERT(sf && sf->PresShell() && + !sf->PresShell()->IsResolutionUpdated()); + sf->NotifyApzTransaction(); } } @@ -1332,13 +1330,13 @@ static nsIFrame* GetNearestScrollableOrOverflowClipFrame( if ((aFlags & nsLayoutUtils::SCROLLABLE_STOP_AT_PAGE) && f->IsPageFrame()) { break; } - if (nsIScrollableFrame* scrollableFrame = do_QueryFrame(f)) { + if (ScrollContainerFrame* scrollContainerFrame = do_QueryFrame(f)) { if (aFlags & nsLayoutUtils::SCROLLABLE_ONLY_ASYNC_SCROLLABLE) { - if (scrollableFrame->WantAsyncScroll()) { + if (scrollContainerFrame->WantAsyncScroll()) { return f; } } else { - ScrollStyles ss = scrollableFrame->GetScrollStyles(); + ScrollStyles ss = scrollContainerFrame->GetScrollStyles(); if ((aFlags & nsLayoutUtils::SCROLLABLE_INCLUDE_HIDDEN) || ss.mVertical != StyleOverflow::Hidden || ss.mHorizontal != StyleOverflow::Hidden) { @@ -2379,7 +2377,7 @@ nsRect nsLayoutUtils::ClampRectToScrollFrames(nsIFrame* aFrame, nsRect resultRect = aRect; while (closestScrollFrame) { - nsIScrollableFrame* sf = do_QueryFrame(closestScrollFrame); + ScrollContainerFrame* sf = do_QueryFrame(closestScrollFrame); nsRect scrollPortRect = sf->GetScrollPortRect(); nsLayoutUtils::TransformRect(closestScrollFrame, aFrame, scrollPortRect); @@ -5732,8 +5730,7 @@ bool nsLayoutUtils::GetFirstLinePosition(WritingMode aWM, } // For first-line baselines, we have to consider scroll frames. - if (nsIScrollableFrame* sFrame = - do_QueryFrame(const_cast(aFrame))) { + if (const ScrollContainerFrame* sFrame = do_QueryFrame(aFrame)) { LinePosition kidPosition; if (GetFirstLinePosition(aWM, sFrame->GetScrolledFrame(), &kidPosition)) { // Consider only the border (Padding is ignored, since @@ -5826,7 +5823,7 @@ bool nsLayoutUtils::GetLastLineBaseline(WritingMode aWM, const nsIFrame* aFrame, const nsBlockFrame* block = do_QueryFrame(aFrame); if (!block) { - if (nsIScrollableFrame* sFrame = do_QueryFrame(aFrame)) { + if (const ScrollContainerFrame* sFrame = do_QueryFrame(aFrame)) { // Use the baseline position only if the last line's baseline is within // the scrolling frame's box in the initial position. const auto* scrolledFrame = sFrame->GetScrolledFrame(); @@ -8327,7 +8324,7 @@ nsMargin nsLayoutUtils::ScrollbarAreaToExcludeFromCompositionBoundsFor( return nsMargin(); } return scrollContainerFrame->GetActualScrollbarSizes( - nsIScrollableFrame::ScrollbarSizesOptions:: + ScrollContainerFrame::ScrollbarSizesOptions:: INCLUDE_VISUAL_VIEWPORT_SCROLLBARS); } diff --git a/layout/forms/nsComboboxControlFrame.cpp b/layout/forms/nsComboboxControlFrame.cpp index 98486255d09c..6b4ce653e10e 100644 --- a/layout/forms/nsComboboxControlFrame.cpp +++ b/layout/forms/nsComboboxControlFrame.cpp @@ -24,7 +24,6 @@ #include "mozilla/dom/Event.h" #include "mozilla/dom/HTMLSelectElement.h" #include "mozilla/dom/Document.h" -#include "nsIScrollableFrame.h" #include "mozilla/ServoStyleSet.h" #include "nsNodeInfoManager.h" #include "nsContentCreatorFunctions.h" diff --git a/layout/forms/nsListControlFrame.cpp b/layout/forms/nsListControlFrame.cpp index 9740b04bf1e2..6bebfaa8f16b 100644 --- a/layout/forms/nsListControlFrame.cpp +++ b/layout/forms/nsListControlFrame.cpp @@ -12,7 +12,6 @@ #include "nsGkAtoms.h" #include "nsComboboxControlFrame.h" #include "nsFontMetrics.h" -#include "nsIScrollableFrame.h" #include "nsCSSRendering.h" #include "nsLayoutUtils.h" #include "nsDisplayList.h" diff --git a/layout/forms/nsTextControlFrame.cpp b/layout/forms/nsTextControlFrame.cpp index 75b7ce68b69b..91dba2043f74 100644 --- a/layout/forms/nsTextControlFrame.cpp +++ b/layout/forms/nsTextControlFrame.cpp @@ -225,11 +225,11 @@ LogicalSize nsTextControlFrame::CalcIntrinsicSize(gfxContext* aRenderingContext, // Add in the size of the scrollbars for textarea if (IsTextArea()) { - nsIScrollableFrame* scrollableFrame = GetScrollTargetFrame(); - NS_ASSERTION(scrollableFrame, "Child must be scrollable"); - if (scrollableFrame) { - LogicalMargin scrollbarSizes(aWM, - scrollableFrame->GetDesiredScrollbarSizes()); + ScrollContainerFrame* scrollContainerFrame = GetScrollTargetFrame(); + NS_ASSERTION(scrollContainerFrame, "Child must be scrollable"); + if (scrollContainerFrame) { + LogicalMargin scrollbarSizes( + aWM, scrollContainerFrame->GetDesiredScrollbarSizes()); intrinsicSize.ISize(aWM) += scrollbarSizes.IStartEnd(aWM); // We only include scrollbar-thickness in our BSize if the scrollbar on diff --git a/layout/generic/ReflowInput.h b/layout/generic/ReflowInput.h index 7bf7c4fc7358..9ff903ecbd79 100644 --- a/layout/generic/ReflowInput.h +++ b/layout/generic/ReflowInput.h @@ -460,11 +460,11 @@ struct ReflowInput : public SizeComputationInput { // infinite loops. bool mIsTopOfPage : 1; - // parent frame is an nsIScrollableFrame and it is assuming a horizontal + // parent frame is an ScrollContainerFrame and it is assuming a horizontal // scrollbar bool mAssumingHScrollbar : 1; - // parent frame is an nsIScrollableFrame and it is assuming a vertical + // parent frame is an ScrollContainerFrame and it is assuming a vertical // scrollbar bool mAssumingVScrollbar : 1; diff --git a/layout/generic/ScrollAnchorContainer.cpp b/layout/generic/ScrollAnchorContainer.cpp index 1755b38b941d..938624f7f995 100644 --- a/layout/generic/ScrollAnchorContainer.cpp +++ b/layout/generic/ScrollAnchorContainer.cpp @@ -75,7 +75,7 @@ ScrollAnchorContainer* ScrollAnchorContainer::FindFor(nsIFrame* aFrame) { return nullptr; } -nsIScrollableFrame* ScrollAnchorContainer::ScrollableFrame() const { +ScrollContainerFrame* ScrollAnchorContainer::ScrollContainer() const { return Frame()->GetScrollTargetFrame(); } @@ -314,7 +314,7 @@ void ScrollAnchorContainer::UserScrolled() { if (!StaticPrefs:: layout_css_scroll_anchoring_reset_heuristic_during_animation() && Frame()->ScrollAnimationState().contains( - nsIScrollableFrame::AnimationState::APZInProgress)) { + ScrollContainerFrame::AnimationState::APZInProgress)) { // We'd want to skip resetting our heuristic while APZ is running an async // scroll because this UserScrolled function gets called on every refresh // driver's tick during running the async scroll, thus it will clobber the @@ -465,7 +465,7 @@ void ScrollAnchorContainer::ApplyAdjustments() { layout_css_scroll_anchoring_reset_heuristic_during_animation() && Frame()->IsProcessingScrollEvent()) || Frame()->ScrollAnimationState().contains( - nsIScrollableFrame::AnimationState::TriggeredByScript) || + ScrollContainerFrame::AnimationState::TriggeredByScript) || Frame()->GetScrollPosition() == nsPoint()) { ANCHOR_LOG( "Ignoring post-reflow (anchor=%p, dirty=%d, disabled=%d, " @@ -476,7 +476,7 @@ void ScrollAnchorContainer::ApplyAdjustments() { Frame()->HasPendingScrollRestoration(), Frame()->IsProcessingScrollEvent(), Frame()->ScrollAnimationState().contains( - nsIScrollableFrame::AnimationState::TriggeredByScript), + ScrollContainerFrame::AnimationState::TriggeredByScript), Frame()->GetScrollPosition() == nsPoint(), mSuppressAnchorAdjustment, this); if (mSuppressAnchorAdjustment) { @@ -610,11 +610,11 @@ ScrollAnchorContainer::ExamineAnchorCandidate(nsIFrame* aFrame) const { // See if this frame has or could maintain its own anchor node. const bool isScrollableWithAnchor = [&] { - nsIScrollableFrame* scrollable = do_QueryFrame(aFrame); - if (!scrollable) { + ScrollContainerFrame* scrollContainer = do_QueryFrame(aFrame); + if (!scrollContainer) { return false; } - auto* anchor = scrollable->Anchor(); + auto* anchor = scrollContainer->Anchor(); return anchor->AnchorNode() || anchor->CanMaintainAnchor(); }(); diff --git a/layout/generic/ScrollAnchorContainer.h b/layout/generic/ScrollAnchorContainer.h index 1b919fe2a72d..fadcffe4c896 100644 --- a/layout/generic/ScrollAnchorContainer.h +++ b/layout/generic/ScrollAnchorContainer.h @@ -13,7 +13,6 @@ class nsFrameList; class nsIFrame; -class nsIScrollableFrame; namespace mozilla { class ScrollContainerFrame; @@ -22,8 +21,8 @@ class ScrollContainerFrame; namespace mozilla::layout { /** - * A scroll anchor container finds a descendent element of a scrollable frame - * to be an anchor node. After every reflow, the scroll anchor will apply + * A scroll anchor container finds a descendent element of a scroll container + * frame to be an anchor node. After every reflow, the scroll anchor will apply * scroll adjustments to keep the anchor node in the same relative position. * * See: https://drafts.csswg.org/css-scroll-anchoring/ @@ -49,14 +48,15 @@ class ScrollAnchorContainer final { ScrollContainerFrame* Frame() const; /** - * Returns the frame that owns this scroll anchor container as a scrollable - * frame. This is always non-null. + * Returns the scroll container frame that owns this scroll anchor container. + * This is always non-null. */ - nsIScrollableFrame* ScrollableFrame() const; + ScrollContainerFrame* ScrollContainer() const; /** - * Find a suitable anchor node among the descendants of the scrollable frame. - * This should only be called after the scroll anchor has been invalidated. + * Find a suitable anchor node among the descendants of the scroll container + * frame. This should only be called after the scroll anchor has been + * invalidated. */ void SelectAnchor(); diff --git a/layout/generic/ScrollContainerFrame.cpp b/layout/generic/ScrollContainerFrame.cpp index 897385c3cc7f..3d346266cff8 100644 --- a/layout/generic/ScrollContainerFrame.cpp +++ b/layout/generic/ScrollContainerFrame.cpp @@ -1729,7 +1729,7 @@ void ScrollContainerFrame::HandleScrollbarStyleSwitching() { mScrollbarActivity->Destroy(); mScrollbarActivity = nullptr; } else if (!mScrollbarActivity && UsesOverlayScrollbars()) { - mScrollbarActivity = new ScrollbarActivity(do_QueryFrame(this)); + mScrollbarActivity = new ScrollbarActivity(this); } } @@ -1877,7 +1877,7 @@ void ScrollContainerFrame::ScrollByLine(nsScrollbarFrame* aScrollbar, nsIntPoint overflow; ScrollBy(delta, ScrollUnit::LINES, ScrollMode::Smooth, &overflow, - ScrollOrigin::Other, nsIScrollableFrame::NOT_MOMENTUM, aSnapFlags); + ScrollOrigin::Other, NOT_MOMENTUM, aSnapFlags); } void ScrollContainerFrame::RepeatButtonScroll(nsScrollbarFrame* aScrollbar) { @@ -1932,8 +1932,8 @@ void ScrollContainerFrame::ScrollByUnit(nsScrollbarFrame* aScrollbar, delta.y = aDirection; } nsIntPoint overflow; - ScrollBy(delta, aUnit, aMode, &overflow, ScrollOrigin::Other, - nsIScrollableFrame::NOT_MOMENTUM, aSnapFlags); + ScrollBy(delta, aUnit, aMode, &overflow, ScrollOrigin::Other, NOT_MOMENTUM, + aSnapFlags); } //-------------------- Helper ---------------------- @@ -4805,20 +4805,21 @@ static void CalcRangeForScrollBy(int32_t aDelta, nscoord aPos, (aDelta > 0 ? aPosTolerance : aNegTolerance)); } -void ScrollContainerFrame::ScrollBy( - nsIntPoint aDelta, ScrollUnit aUnit, ScrollMode aMode, - nsIntPoint* aOverflow, ScrollOrigin aOrigin, - nsIScrollableFrame::ScrollMomentum aMomentum, ScrollSnapFlags aSnapFlags) { +void ScrollContainerFrame::ScrollBy(nsIntPoint aDelta, ScrollUnit aUnit, + ScrollMode aMode, nsIntPoint* aOverflow, + ScrollOrigin aOrigin, + ScrollMomentum aMomentum, + ScrollSnapFlags aSnapFlags) { // When a smooth scroll is being processed on a frame, mouse wheel and // trackpad momentum scroll event updates must notcancel the SMOOTH or // SMOOTH_MSD scroll animations, enabling Javascript that depends on them to // be responsive without forcing the user to wait for the fling animations to // completely stop. switch (aMomentum) { - case nsIScrollableFrame::NOT_MOMENTUM: + case NOT_MOMENTUM: mIgnoreMomentumScroll = false; break; - case nsIScrollableFrame::SYNTHESIZED_MOMENTUM_EVENT: + case SYNTHESIZED_MOMENTUM_EVENT: if (mIgnoreMomentumScroll) { return; } @@ -6962,16 +6963,13 @@ nsRect ScrollContainerFrame::GetUnsnappedScrolledRectInternal( } nsMargin ScrollContainerFrame::GetActualScrollbarSizes( - nsIScrollableFrame::ScrollbarSizesOptions - aOptions /* = nsIScrollableFrame::ScrollbarSizesOptions::NONE */) - const { + ScrollbarSizesOptions aOptions /* = ScrollbarSizesOptions::NONE */) const { nsRect r = GetPaddingRectRelativeToSelf(); nsMargin m(mScrollPort.y - r.y, r.XMost() - mScrollPort.XMost(), r.YMost() - mScrollPort.YMost(), mScrollPort.x - r.x); - if (aOptions == nsIScrollableFrame::ScrollbarSizesOptions:: - INCLUDE_VISUAL_VIEWPORT_SCROLLBARS && + if (aOptions == ScrollbarSizesOptions::INCLUDE_VISUAL_VIEWPORT_SCROLLBARS && !UsesOverlayScrollbars()) { // If we are using layout scrollbars and they only exist to scroll the // visual viewport then they do not take up any layout space (so the @@ -7066,8 +7064,8 @@ bool ScrollContainerFrame::IsLastScrollUpdateTriggeredByScriptAnimating() return false; } -using AnimationState = nsIScrollableFrame::AnimationState; -EnumSet ScrollContainerFrame::ScrollAnimationState() const { +EnumSet +ScrollContainerFrame::ScrollAnimationState() const { EnumSet retval; if (IsApzAnimationInProgress()) { retval += AnimationState::APZInProgress; @@ -7471,7 +7469,7 @@ static void CollectScrollPositionsForSnap( ScrollContainerFrame::SnapTargetSet* aSnapTargets) { // Snap positions only affect the nearest ancestor scroll container on the // element's containing block chain. - nsIScrollableFrame* sf = do_QueryFrame(aFrame); + ScrollContainerFrame* sf = do_QueryFrame(aFrame); if (sf) { return; } @@ -8009,7 +8007,7 @@ void ScrollContainerFrame::AppendScrollUpdate( void ScrollContainerFrame::ScheduleScrollAnimations() { nsIContent* content = GetContent(); MOZ_ASSERT(content && content->IsElement(), - "The nsIScrollableFrame should have the element."); + "The ScrollContainerFrame should have the element."); const Element* elementOrPseudo = content->AsElement(); PseudoStyleType pseudo = elementOrPseudo->GetPseudoElementType(); diff --git a/layout/generic/ScrollContainerFrame.h b/layout/generic/ScrollContainerFrame.h index f7b57f40fced..b82ae542cac6 100644 --- a/layout/generic/ScrollContainerFrame.h +++ b/layout/generic/ScrollContainerFrame.h @@ -70,7 +70,6 @@ class ScrollContainerFrame : public nsContainerFrame, public nsIStatefulFrame { public: using Element = dom::Element; - using InScrollingGesture = nsIScrollableFrame::InScrollingGesture; using ScrollAnchorContainer = layout::ScrollAnchorContainer; using SnapTargetSet = nsTHashSet>; @@ -203,8 +202,7 @@ class ScrollContainerFrame : public nsContainerFrame, return result; } nsMargin GetActualScrollbarSizes( - nsIScrollableFrame::ScrollbarSizesOptions aOptions = - nsIScrollableFrame::ScrollbarSizesOptions::NONE) const final; + ScrollbarSizesOptions aOptions = ScrollbarSizesOptions::NONE) const final; nsMargin GetDesiredScrollbarSizes() const final; static nscoord GetNonOverlayScrollbarSize(const nsPresContext*, StyleScrollbarWidth); @@ -266,8 +264,7 @@ class ScrollContainerFrame : public nsContainerFrame, void ScrollBy(nsIntPoint aDelta, ScrollUnit aUnit, ScrollMode aMode, nsIntPoint* aOverflow = nullptr, ScrollOrigin aOrigin = ScrollOrigin::NotSpecified, - nsIScrollableFrame::ScrollMomentum aMomentum = - nsIScrollableFrame::NOT_MOMENTUM, + ScrollMomentum aMomentum = NOT_MOMENTUM, ScrollSnapFlags aSnapFlags = ScrollSnapFlags::Disabled) final; void ScrollByCSSPixels(const CSSIntPoint& aDelta, ScrollMode aMode = ScrollMode::Instant) final { @@ -310,7 +307,6 @@ class ScrollContainerFrame : public nsContainerFrame, bool IsRectNearlyVisible(const nsRect& aRect) const final; nsRect ExpandRectToNearlyVisible(const nsRect& aRect) const final; ScrollOrigin LastScrollOrigin() const final { return mLastScrollOrigin; } - using AnimationState = nsIScrollableFrame::AnimationState; EnumSet ScrollAnimationState() const final; MainThreadScrollGeneration CurrentScrollGeneration() const final { return mScrollGeneration; @@ -392,7 +388,6 @@ class ScrollContainerFrame : public nsContainerFrame, void TryResnap() final; void PostPendingResnapIfNeeded(const nsIFrame* aFrame) final; void PostPendingResnap() final; - using PhysicalScrollSnapAlign = nsIScrollableFrame::PhysicalScrollSnapAlign; PhysicalScrollSnapAlign GetScrollSnapAlignFor( const nsIFrame* aFrame) const final; diff --git a/layout/generic/ScrollbarActivity.cpp b/layout/generic/ScrollbarActivity.cpp index e9865c62f929..d7c16d19ffb8 100644 --- a/layout/generic/ScrollbarActivity.cpp +++ b/layout/generic/ScrollbarActivity.cpp @@ -11,7 +11,6 @@ #include "nsContentUtils.h" #include "nsITimer.h" #include "nsQueryFrame.h" -#include "nsIScrollableFrame.h" #include "PresShell.h" #include "nsLayoutUtils.h" #include "nsScrollbarFrame.h" @@ -20,6 +19,7 @@ #include "mozilla/dom/Event.h" #include "mozilla/dom/Document.h" #include "mozilla/LookAndFeel.h" +#include "mozilla/ScrollContainerFrame.h" namespace mozilla::layout { @@ -100,12 +100,14 @@ ScrollbarActivity::HandleEvent(dom::Event* aEvent) { // of our scroll frame) and we don't want those to activate us. nsIFrame* scrollFrame = do_QueryFrame(mScrollableFrame); MOZ_ASSERT(scrollFrame); - nsIScrollableFrame* scrollableFrame = do_QueryFrame(mScrollableFrame); + ScrollContainerFrame* scrollContainerFrame = + do_QueryFrame(mScrollableFrame); nsCOMPtr targetContent = do_QueryInterface(aEvent->GetOriginalTarget()); nsIFrame* targetFrame = targetContent ? targetContent->GetPrimaryFrame() : nullptr; - if ((scrollableFrame && scrollableFrame->IsRootScrollFrameOfDocument()) || + if ((scrollContainerFrame && + scrollContainerFrame->IsRootScrollFrameOfDocument()) || !targetFrame || nsLayoutUtils::IsAncestorFrameCrossDocInProcess( scrollFrame, targetFrame, diff --git a/layout/generic/StickyScrollContainer.cpp b/layout/generic/StickyScrollContainer.cpp index 0c5fc3420217..cd0a36b12d0d 100644 --- a/layout/generic/StickyScrollContainer.cpp +++ b/layout/generic/StickyScrollContainer.cpp @@ -15,7 +15,6 @@ #include "mozilla/ScrollContainerFrame.h" #include "nsIFrame.h" #include "nsIFrameInlines.h" -#include "nsIScrollableFrame.h" #include "nsLayoutUtils.h" namespace mozilla { @@ -23,13 +22,14 @@ namespace mozilla { NS_DECLARE_FRAME_PROPERTY_DELETABLE(StickyScrollContainerProperty, StickyScrollContainer) -StickyScrollContainer::StickyScrollContainer(nsIScrollableFrame* aScrollFrame) - : mScrollFrame(aScrollFrame) { - mScrollFrame->AddScrollPositionListener(this); +StickyScrollContainer::StickyScrollContainer( + ScrollContainerFrame* aScrollContainerFrame) + : mScrollContainerFrame(aScrollContainerFrame) { + mScrollContainerFrame->AddScrollPositionListener(this); } StickyScrollContainer::~StickyScrollContainer() { - mScrollFrame->RemoveScrollPositionListener(this); + mScrollContainerFrame->RemoveScrollPositionListener(this); } // static @@ -167,7 +167,7 @@ void StickyScrollContainer::ComputeStickyLimits(nsIFrame* aFrame, return; } - nsIFrame* scrolledFrame = mScrollFrame->GetScrolledFrame(); + nsIFrame* scrolledFrame = mScrollContainerFrame->GetScrolledFrame(); nsIFrame* cbFrame = aFrame->GetContainingBlock(); NS_ASSERTION(cbFrame == scrolledFrame || nsLayoutUtils::IsProperAncestorFrame(scrolledFrame, cbFrame), @@ -376,7 +376,7 @@ void StickyScrollContainer::UpdatePositions(nsPoint aScrollPosition, nsIFrame* aSubtreeRoot) { #ifdef DEBUG { - nsIFrame* scrollFrameAsFrame = do_QueryFrame(mScrollFrame); + nsIFrame* scrollFrameAsFrame = do_QueryFrame(mScrollContainerFrame); NS_ASSERTION(!aSubtreeRoot || aSubtreeRoot == scrollFrameAsFrame, "If reflowing, should be reflowing the scroll frame"); } diff --git a/layout/generic/StickyScrollContainer.h b/layout/generic/StickyScrollContainer.h index 64f2aea5086d..58a78b15b18b 100644 --- a/layout/generic/StickyScrollContainer.h +++ b/layout/generic/StickyScrollContainer.h @@ -19,10 +19,11 @@ struct nsRect; class nsIFrame; -class nsIScrollableFrame; namespace mozilla { +class ScrollContainerFrame; + class StickyScrollContainer final : public nsIScrollPositionListener { public: /** @@ -48,7 +49,9 @@ class StickyScrollContainer final : public nsIScrollPositionListener { void AddFrame(nsIFrame* aFrame) { mFrames.AppendElement(aFrame); } void RemoveFrame(nsIFrame* aFrame) { mFrames.RemoveElement(aFrame); } - nsIScrollableFrame* ScrollFrame() const { return mScrollFrame; } + ScrollContainerFrame* ScrollContainer() const { + return mScrollContainerFrame; + } // Compute the offsets for a sticky position element static void ComputeStickyOffsets(nsIFrame* aFrame); @@ -94,7 +97,7 @@ class StickyScrollContainer final : public nsIScrollPositionListener { bool IsStuckInYDirection(nsIFrame* aFrame) const; private: - explicit StickyScrollContainer(nsIScrollableFrame* aScrollFrame); + explicit StickyScrollContainer(ScrollContainerFrame* aScrollContainerFrame); /** * Compute two rectangles that determine sticky positioning: |aStick|, based @@ -105,7 +108,7 @@ class StickyScrollContainer final : public nsIScrollPositionListener { void ComputeStickyLimits(nsIFrame* aFrame, nsRect* aStick, nsRect* aContain) const; - nsIScrollableFrame* const mScrollFrame; + ScrollContainerFrame* const mScrollContainerFrame; nsTArray mFrames; nsPoint mScrollPosition; }; diff --git a/layout/generic/ViewportFrame.cpp b/layout/generic/ViewportFrame.cpp index feb24ebbf9c7..65e748a89513 100644 --- a/layout/generic/ViewportFrame.cpp +++ b/layout/generic/ViewportFrame.cpp @@ -15,8 +15,8 @@ #include "mozilla/PresShell.h" #include "mozilla/ProfilerLabels.h" #include "mozilla/RestyleManager.h" +#include "mozilla/ScrollContainerFrame.h" #include "nsGkAtoms.h" -#include "nsIScrollableFrame.h" #include "nsAbsoluteContainingBlock.h" #include "nsCanvasFrame.h" #include "nsLayoutUtils.h" @@ -287,11 +287,11 @@ nsPoint ViewportFrame::AdjustReflowInputForScrollbars( ReflowInput* aReflowInput) const { // Get our prinicpal child frame and see if we're scrollable nsIFrame* kidFrame = mFrames.FirstChild(); - nsIScrollableFrame* scrollingFrame = do_QueryFrame(kidFrame); - if (scrollingFrame) { + if (ScrollContainerFrame* scrollContainerFrame = do_QueryFrame(kidFrame)) { WritingMode wm = aReflowInput->GetWritingMode(); - LogicalMargin scrollbars(wm, scrollingFrame->GetActualScrollbarSizes()); + LogicalMargin scrollbars(wm, + scrollContainerFrame->GetActualScrollbarSizes()); aReflowInput->SetComputedISize( aReflowInput->ComputedISize() - scrollbars.IStartEnd(wm), ReflowInput::ResetResizeFlags::No); diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index 72e822e48d01..e94d9156d4c7 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -19,6 +19,7 @@ #include "mozilla/DebugOnly.h" #include "mozilla/Maybe.h" #include "mozilla/PresShell.h" +#include "mozilla/ScrollContainerFrame.h" #include "mozilla/StaticPrefs_browser.h" #include "mozilla/StaticPrefs_layout.h" #include "mozilla/ToString.h" @@ -45,7 +46,6 @@ #include "nsFloatManager.h" #include "prenv.h" #include "nsError.h" -#include "nsIScrollableFrame.h" #include #include "nsLayoutUtils.h" #include "nsDisplayList.h" @@ -1126,11 +1126,10 @@ static LogicalSize CalculateContainingBlockSizeForAbsolutes( // For scroll containers, we can just use cbSize (which is the padding-box // size of the scrolled-content frame). - if (nsIScrollableFrame* scrollFrame = do_QueryFrame(lastRI->mFrame)) { + if (lastRI->mFrame->IsScrollContainerOrSubclass()) { // Assert that we're not missing any frames between the abspos containing // block and the scroll container. // the parent. - Unused << scrollFrame; MOZ_ASSERT(lastButOneRI == &aReflowInput); return cbSize; } diff --git a/layout/generic/nsCanvasFrame.cpp b/layout/generic/nsCanvasFrame.cpp index c8b0b8f85c21..169a7b6873ec 100644 --- a/layout/generic/nsCanvasFrame.cpp +++ b/layout/generic/nsCanvasFrame.cpp @@ -278,9 +278,8 @@ nsRect nsCanvasFrame::CanvasArea() const { // matter. nsRect result(InkOverflowRect()); - nsIScrollableFrame* scrollableFrame = do_QueryFrame(GetParent()); - if (scrollableFrame) { - nsRect portRect = scrollableFrame->GetScrollPortRect(); + if (ScrollContainerFrame* scrollContainerFrame = do_QueryFrame(GetParent())) { + nsRect portRect = scrollContainerFrame->GetScrollPortRect(); result.UnionRect(result, nsRect(nsPoint(0, 0), portRect.Size())); } return result; @@ -587,12 +586,11 @@ void nsCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, void nsCanvasFrame::PaintFocus(DrawTarget* aDrawTarget, nsPoint aPt) { nsRect focusRect(aPt, GetSize()); - nsIScrollableFrame* scrollableFrame = do_QueryFrame(GetParent()); - if (scrollableFrame) { - nsRect portRect = scrollableFrame->GetScrollPortRect(); + if (ScrollContainerFrame* scrollContainerFrame = do_QueryFrame(GetParent())) { + nsRect portRect = scrollContainerFrame->GetScrollPortRect(); focusRect.width = portRect.width; focusRect.height = portRect.height; - focusRect.MoveBy(scrollableFrame->GetScrollPosition()); + focusRect.MoveBy(scrollContainerFrame->GetScrollPosition()); } // XXX use the root frame foreground color, but should we find BODY frame diff --git a/layout/generic/nsFrameSelection.cpp b/layout/generic/nsFrameSelection.cpp index 924802d600a0..b0bd92e53698 100644 --- a/layout/generic/nsFrameSelection.cpp +++ b/layout/generic/nsFrameSelection.cpp @@ -1662,16 +1662,16 @@ nsIFrame* nsFrameSelection::GetFrameToPageSelect() const { // parent under the root frame. for (nsIFrame* frame = contentToSelect->GetPrimaryFrame(); frame && frame != rootFrameToSelect; frame = frame->GetParent()) { - nsIScrollableFrame* scrollableFrame = do_QueryFrame(frame); - if (!scrollableFrame) { + ScrollContainerFrame* scrollContainerFrame = do_QueryFrame(frame); + if (!scrollContainerFrame) { continue; } - ScrollStyles scrollStyles = scrollableFrame->GetScrollStyles(); + ScrollStyles scrollStyles = scrollContainerFrame->GetScrollStyles(); if (scrollStyles.mVertical == StyleOverflow::Hidden) { continue; } layers::ScrollDirections directions = - scrollableFrame->GetAvailableScrollingDirections(); + scrollContainerFrame->GetAvailableScrollingDirections(); if (directions.contains(layers::ScrollDirection::eVertical)) { // If there is sub scrollable frame, let's use its page size to select. return frame; diff --git a/layout/generic/nsFrameSelection.h b/layout/generic/nsFrameSelection.h index bbc9f9dc1d44..5c517df3f112 100644 --- a/layout/generic/nsFrameSelection.h +++ b/layout/generic/nsFrameSelection.h @@ -217,7 +217,6 @@ enum class TableSelectionMode : uint32_t { }; } // namespace mozilla -class nsIScrollableFrame; class nsFrameSelection final { public: diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp index faced8474489..5f064736ffab 100644 --- a/layout/generic/nsGridContainerFrame.cpp +++ b/layout/generic/nsGridContainerFrame.cpp @@ -7542,7 +7542,7 @@ nsGridContainerFrame::GetNearestFragmentainer( WritingMode wm = aState.mWM; const ReflowInput* cbRI = gridRI->mCBReflowInput; for (; cbRI; cbRI = cbRI->mCBReflowInput) { - nsIScrollableFrame* sf = do_QueryFrame(cbRI->mFrame); + ScrollContainerFrame* sf = do_QueryFrame(cbRI->mFrame); if (sf) { break; } diff --git a/layout/generic/nsIFrame.cpp b/layout/generic/nsIFrame.cpp index 35fa6c37772d..74a19dd8cafd 100644 --- a/layout/generic/nsIFrame.cpp +++ b/layout/generic/nsIFrame.cpp @@ -1217,8 +1217,8 @@ void nsIFrame::DidSetComputedStyle(ComputedStyle* aOldComputedStyle) { if (auto* container = ScrollAnchorContainer::FindFor(this)) { container->InvalidateAnchor(); } - if (nsIScrollableFrame* scrollableFrame = do_QueryFrame(this)) { - scrollableFrame->Anchor()->InvalidateAnchor(); + if (ScrollContainerFrame* scrollContainerFrame = do_QueryFrame(this)) { + scrollContainerFrame->Anchor()->InvalidateAnchor(); } } @@ -2185,8 +2185,7 @@ void nsIFrame::UpdateVisibilitySynchronously() { nsRect rect = GetRectRelativeToSelf(); nsIFrame* rectFrame = this; while (f && visible) { - nsIScrollableFrame* sf = do_QueryFrame(f); - if (sf) { + if (ScrollContainerFrame* sf = do_QueryFrame(f)) { nsRect transformedRect = nsLayoutUtils::TransformFrameRectToAncestor(rectFrame, rect, f); if (!sf->IsRectNearlyVisible(transformedRect)) { @@ -3785,8 +3784,8 @@ void nsIFrame::BuildDisplayListForStackingContext( StickyScrollContainer* stickyScrollContainer = StickyScrollContainer::GetStickyScrollContainerForFrame(this); - if (stickyScrollContainer && - stickyScrollContainer->ScrollFrame()->IsMaybeAsynchronouslyScrolled()) { + if (stickyScrollContainer && stickyScrollContainer->ScrollContainer() + ->IsMaybeAsynchronouslyScrolled()) { shouldFlatten = false; } @@ -10799,17 +10798,17 @@ bool nsIFrame::IsFocusableDueToScrollFrame() { // with the mouse, because the extra focus outlines are considered // unnecessarily ugly. When clicked on, the selection position within the // element will be enough to make them keyboard scrollable. - nsIScrollableFrame* scrollFrame = do_QueryFrame(this); - if (!scrollFrame) { + ScrollContainerFrame* scrollContainerFrame = do_QueryFrame(this); + if (!scrollContainerFrame) { return false; } - if (scrollFrame->IsForTextControlWithNoScrollbars()) { + if (scrollContainerFrame->IsForTextControlWithNoScrollbars()) { return false; } - if (scrollFrame->GetScrollStyles().IsHiddenInBothDirections()) { + if (scrollContainerFrame->GetScrollStyles().IsHiddenInBothDirections()) { return false; } - if (scrollFrame->GetScrollRange().IsEqualEdges(nsRect(0, 0, 0, 0))) { + if (scrollContainerFrame->GetScrollRange().IsEqualEdges(nsRect(0, 0, 0, 0))) { return false; } return true; @@ -11174,8 +11173,8 @@ static bool IsFrameScrolledOutOfView(const nsIFrame* aTarget, // subtree for (nsIFrame* f = const_cast(aParent); f; f = nsLayoutUtils::GetCrossDocParentFrameInProcess(f)) { - nsIScrollableFrame* scrollableFrame = do_QueryFrame(f); - if (scrollableFrame) { + ScrollContainerFrame* scrollContainerFrame = do_QueryFrame(f); + if (scrollContainerFrame) { clipParent = f; break; } diff --git a/layout/generic/nsIScrollPositionListener.h b/layout/generic/nsIScrollPositionListener.h index eadae2fe0c78..12b4f49a2ebc 100644 --- a/layout/generic/nsIScrollPositionListener.h +++ b/layout/generic/nsIScrollPositionListener.h @@ -11,7 +11,7 @@ /** * Provides a way to learn about scroll position changes of - * nsIScrollableFrame's. + * ScrollContainerFrame's. */ class nsIScrollPositionListener { public: diff --git a/layout/painting/DisplayItemClipChain.h b/layout/painting/DisplayItemClipChain.h index 64917dd9f6cb..c1e39b707de6 100644 --- a/layout/painting/DisplayItemClipChain.h +++ b/layout/painting/DisplayItemClipChain.h @@ -11,8 +11,6 @@ #include "DisplayItemClip.h" #include "nsString.h" -class nsIScrollableFrame; - namespace mozilla { struct ActiveScrolledRoot; diff --git a/layout/painting/DisplayListClipState.h b/layout/painting/DisplayListClipState.h index 0f1df2ca5882..1c9451606fc8 100644 --- a/layout/painting/DisplayListClipState.h +++ b/layout/painting/DisplayListClipState.h @@ -13,7 +13,6 @@ #include "mozilla/DebugOnly.h" class nsIFrame; -class nsIScrollableFrame; namespace mozilla { diff --git a/layout/painting/RetainedDisplayListBuilder.cpp b/layout/painting/RetainedDisplayListBuilder.cpp index 028677dfb440..eaf9a9304a6c 100644 --- a/layout/painting/RetainedDisplayListBuilder.cpp +++ b/layout/painting/RetainedDisplayListBuilder.cpp @@ -973,7 +973,7 @@ static bool ProcessFrameInternal(nsIFrame* aFrame, // Check whether the current frame is a scrollable frame with display port. nsRect displayPort; - nsIScrollableFrame* sf = do_QueryFrame(currentFrame); + ScrollContainerFrame* sf = do_QueryFrame(currentFrame); nsIContent* content = sf ? currentFrame->GetContent() : nullptr; if (content && DisplayPortUtils::GetDisplayPort(content, &displayPort)) { diff --git a/layout/painting/nsCSSRendering.cpp b/layout/painting/nsCSSRendering.cpp index eede2ac2321f..021e1fabba50 100644 --- a/layout/painting/nsCSSRendering.cpp +++ b/layout/painting/nsCSSRendering.cpp @@ -2184,15 +2184,15 @@ void nsCSSRendering::GetImageLayerClip( // like the content. (See below.) // Therefore, only 'content-box' makes a difference here. if (layerClip == StyleGeometryBox::ContentBox) { - nsIScrollableFrame* scrollableFrame = do_QueryFrame(aForFrame); + ScrollContainerFrame* scrollContainerFrame = do_QueryFrame(aForFrame); // Clip at a rectangle attached to the scrolled content. aClipState->mHasAdditionalBGClipArea = true; aClipState->mAdditionalBGClipArea = nsRect(aClipState->mBGClipArea.TopLeft() + - scrollableFrame->GetScrolledFrame()->GetPosition() + scrollContainerFrame->GetScrolledFrame()->GetPosition() // For the dir=rtl case: - + scrollableFrame->GetScrollRange().TopLeft(), - scrollableFrame->GetScrolledRect().Size()); + + scrollContainerFrame->GetScrollRange().TopLeft(), + scrollContainerFrame->GetScrolledRect().Size()); nsMargin padding = aForFrame->GetUsedPadding(); // padding-bottom is ignored on scrollable frames: // https://bugzilla.mozilla.org/show_bug.cgi?id=748518 @@ -2771,11 +2771,12 @@ nsRect nsCSSRendering::ComputeImageLayerPositioningArea( nsIFrame* geometryFrame = aForFrame; if (MOZ_UNLIKELY(frameType == LayoutFrameType::ScrollContainer && StyleImageLayerAttachment::Local == aLayer.mAttachment)) { - nsIScrollableFrame* scrollableFrame = do_QueryFrame(aForFrame); - positionArea = nsRect(scrollableFrame->GetScrolledFrame()->GetPosition() - // For the dir=rtl case: - + scrollableFrame->GetScrollRange().TopLeft(), - scrollableFrame->GetScrolledRect().Size()); + ScrollContainerFrame* scrollContainerFrame = do_QueryFrame(aForFrame); + positionArea = + nsRect(scrollContainerFrame->GetScrolledFrame()->GetPosition() + // For the dir=rtl case: + + scrollContainerFrame->GetScrollRange().TopLeft(), + scrollContainerFrame->GetScrolledRect().Size()); // The ScrolledRect’s size does not include the borders or scrollbars, // reverse the handling of background-origin // compared to the common case below. @@ -2783,7 +2784,7 @@ nsRect nsCSSRendering::ComputeImageLayerPositioningArea( nsMargin border = geometryFrame->GetUsedBorder(); border.ApplySkipSides(geometryFrame->GetSkipSides()); positionArea.Inflate(border); - positionArea.Inflate(scrollableFrame->GetActualScrollbarSizes()); + positionArea.Inflate(scrollContainerFrame->GetActualScrollbarSizes()); } else if (layerOrigin != StyleGeometryBox::PaddingBox) { nsMargin padding = geometryFrame->GetUsedPadding(); padding.ApplySkipSides(geometryFrame->GetSkipSides()); diff --git a/layout/painting/nsDisplayList.cpp b/layout/painting/nsDisplayList.cpp index 27e942ffe545..4bed18efb41e 100644 --- a/layout/painting/nsDisplayList.cpp +++ b/layout/painting/nsDisplayList.cpp @@ -912,16 +912,16 @@ bool nsDisplayListBuilder::ShouldRebuildDisplayListDueToPrefChange() { return false; } -void nsDisplayListBuilder::AddScrollFrameToNotify( - nsIScrollableFrame* aScrollFrame) { - mScrollFramesToNotify.insert(aScrollFrame); +void nsDisplayListBuilder::AddScrollContainerFrameToNotify( + ScrollContainerFrame* aScrollContainerFrame) { + mScrollContainerFramesToNotify.insert(aScrollContainerFrame); } -void nsDisplayListBuilder::NotifyAndClearScrollFrames() { - for (const auto& it : mScrollFramesToNotify) { +void nsDisplayListBuilder::NotifyAndClearScrollContainerFrames() { + for (const auto& it : mScrollContainerFramesToNotify) { it->NotifyApzTransaction(); } - mScrollFramesToNotify.clear(); + mScrollContainerFramesToNotify.clear(); } bool nsDisplayListBuilder::MarkOutOfFlowFrameForDisplay( @@ -1621,8 +1621,8 @@ static bool IsStickyFrameActive(nsDisplayListBuilder* aBuilder, StickyScrollContainer* stickyScrollContainer = StickyScrollContainer::GetStickyScrollContainerForFrame(aFrame); - return stickyScrollContainer && - stickyScrollContainer->ScrollFrame()->IsMaybeAsynchronouslyScrolled(); + return stickyScrollContainer && stickyScrollContainer->ScrollContainer() + ->IsMaybeAsynchronouslyScrolled(); } bool nsDisplayListBuilder::IsAnimatedGeometryRoot(nsIFrame* aFrame, @@ -1657,7 +1657,7 @@ bool nsDisplayListBuilder::IsAnimatedGeometryRoot(nsIFrame* aFrame, } if (parent->IsScrollContainerOrSubclass()) { - nsIScrollableFrame* sf = do_QueryFrame(parent); + ScrollContainerFrame* sf = do_QueryFrame(parent); if (sf->GetScrolledFrame() == aFrame) { MOZ_ASSERT(!aFrame->IsTransformed()); return sf->IsMaybeAsynchronouslyScrolled(); @@ -5582,9 +5582,9 @@ StickyScrollContainer* nsDisplayStickyPosition::GetStickyScrollContainer() { // will never be asynchronously scrolled. Instead we will always position // the sticky items correctly on the gecko side and WR will never need to // adjust their position itself. - MOZ_ASSERT( - stickyScrollContainer->ScrollFrame()->IsMaybeAsynchronouslyScrolled()); - if (!stickyScrollContainer->ScrollFrame() + MOZ_ASSERT(stickyScrollContainer->ScrollContainer() + ->IsMaybeAsynchronouslyScrolled()); + if (!stickyScrollContainer->ScrollContainer() ->IsMaybeAsynchronouslyScrolled()) { stickyScrollContainer = nullptr; } @@ -5618,14 +5618,14 @@ bool nsDisplayStickyPosition::CreateWebRenderCommands( nsRectAbsolute inner; stickyScrollContainer->GetScrollRanges(mFrame, &outer, &inner); - nsIFrame* scrollFrame = do_QueryFrame(stickyScrollContainer->ScrollFrame()); nsPoint offset = - scrollFrame->GetOffsetToCrossDoc(Frame()) + ToReferenceFrame(); + stickyScrollContainer->ScrollContainer()->GetOffsetToCrossDoc(Frame()) + + ToReferenceFrame(); // Adjust the scrollPort coordinates to be relative to the reference frame, // so that it is in the same space as everything else. nsRect scrollPort = - stickyScrollContainer->ScrollFrame()->GetScrollPortRect(); + stickyScrollContainer->ScrollContainer()->GetScrollPortRect(); scrollPort += offset; // The following computations make more sense upon understanding the @@ -5821,10 +5821,10 @@ bool nsDisplayStickyPosition::UpdateScrollData( nsLayoutUtils::GetSideBitsForFixedPositionContent(mFrame); aLayerData->SetFixedPositionSides(sides); - ScrollableLayerGuid::ViewID scrollId = - nsLayoutUtils::FindOrCreateIDFor(stickyScrollContainer->ScrollFrame() - ->GetScrolledFrame() - ->GetContent()); + ScrollableLayerGuid::ViewID scrollId = nsLayoutUtils::FindOrCreateIDFor( + stickyScrollContainer->ScrollContainer() + ->GetScrolledFrame() + ->GetContent()); aLayerData->SetStickyPositionScrollContainerId(scrollId); } @@ -5869,7 +5869,7 @@ UniquePtr nsDisplayScrollInfoLayer::ComputeScrollMetadata( ScrollContainerFrame* scrollContainerFrame = mScrollFrame->GetScrollTargetFrame(); if (scrollContainerFrame) { - aBuilder->AddScrollFrameToNotify(scrollContainerFrame); + aBuilder->AddScrollContainerFrameToNotify(scrollContainerFrame); } return UniquePtr(new ScrollMetadata(metadata)); @@ -5960,9 +5960,10 @@ void nsDisplayAsyncZoom::HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect, HitTestState* aState, nsTArray* aOutFrames) { #ifdef DEBUG - nsIScrollableFrame* scrollFrame = do_QueryFrame(mFrame); - MOZ_ASSERT(scrollFrame && ViewportUtils::IsZoomedContentRoot( - scrollFrame->GetScrolledFrame())); + ScrollContainerFrame* scrollContainerFrame = do_QueryFrame(mFrame); + MOZ_ASSERT(scrollContainerFrame && + ViewportUtils::IsZoomedContentRoot( + scrollContainerFrame->GetScrolledFrame())); #endif nsRect rect = ViewportUtils::VisualToLayout(aRect, mFrame->PresShell()); mList.HitTest(aBuilder, rect, aState, aOutFrames); diff --git a/layout/painting/nsDisplayList.h b/layout/painting/nsDisplayList.h index c1e4f4104980..22b35e293b26 100644 --- a/layout/painting/nsDisplayList.h +++ b/layout/painting/nsDisplayList.h @@ -65,7 +65,6 @@ class gfxContext; class nsIContent; -class nsIScrollableFrame; class nsSubDocumentFrame; class nsCaret; struct WrFiltersHolder; @@ -1643,8 +1642,9 @@ class nsDisplayListBuilder { } }; - void AddScrollFrameToNotify(nsIScrollableFrame* aScrollFrame); - void NotifyAndClearScrollFrames(); + void AddScrollContainerFrameToNotify( + ScrollContainerFrame* aScrollContainerFrame); + void NotifyAndClearScrollContainerFrames(); // Helper class to find what link spec (if any) to associate with a frame, // recording it in the builder, and generate the corresponding DisplayItem. @@ -1829,7 +1829,7 @@ class nsDisplayListBuilder { std::unordered_set mClipDeduplicator; - std::unordered_set mScrollFramesToNotify; + std::unordered_set mScrollContainerFramesToNotify; AutoTArray mFramesWithOOFData; AutoTArray mFramesMarkedForDisplayIfVisible; diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp index fbf4c0e0cbc2..744024a2b1d6 100644 --- a/layout/style/nsComputedDOMStyle.cpp +++ b/layout/style/nsComputedDOMStyle.cpp @@ -23,7 +23,6 @@ #include "nsIFrame.h" #include "nsIFrameInlines.h" #include "mozilla/ComputedStyle.h" -#include "nsIScrollableFrame.h" #include "nsContentUtils.h" #include "nsDocShell.h" #include "nsIContent.h" @@ -2014,9 +2013,9 @@ nscoord nsComputedDOMStyle::GetUsedAbsoluteOffset(mozilla::Side aSide) { // scrollbars. We have to do some extra work. // the first child in the default frame list is what we want nsIFrame* scrollingChild = container->PrincipalChildList().FirstChild(); - nsIScrollableFrame* scrollFrame = do_QueryFrame(scrollingChild); - if (scrollFrame) { - scrollbarSizes = scrollFrame->GetActualScrollbarSizes(); + ScrollContainerFrame* scrollContainerFrame = do_QueryFrame(scrollingChild); + if (scrollContainerFrame) { + scrollbarSizes = scrollContainerFrame->GetActualScrollbarSizes(); } // The viewport size might have been expanded by the visual viewport or diff --git a/layout/tables/nsTableCellFrame.cpp b/layout/tables/nsTableCellFrame.cpp index 6a8d777c97b1..6312cc79f9d4 100644 --- a/layout/tables/nsTableCellFrame.cpp +++ b/layout/tables/nsTableCellFrame.cpp @@ -533,7 +533,7 @@ static bool CellHasVisibleContent(nsTableFrame* aTableFrame, nsIFrame* nsTableCellFrame::CellContentFrame() const { nsIFrame* inner = mFrames.FirstChild(); - if (nsIScrollableFrame* sf = do_QueryFrame(inner)) { + if (ScrollContainerFrame* sf = do_QueryFrame(inner)) { return sf->GetScrolledFrame(); } return inner; diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp index e03af22e4cbf..f9076ef9032f 100644 --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -47,7 +47,6 @@ #include "mozilla/RestyleManager.h" #include "mozilla/ServoStyleSet.h" #include "nsDisplayList.h" -#include "nsIScrollableFrame.h" #include "nsCSSProps.h" #include "nsLayoutUtils.h" #include "nsStyleChangeList.h" diff --git a/layout/xul/nsMenuPopupFrame.cpp b/layout/xul/nsMenuPopupFrame.cpp index 17993c84665f..68ba2a1a75e9 100644 --- a/layout/xul/nsMenuPopupFrame.cpp +++ b/layout/xul/nsMenuPopupFrame.cpp @@ -24,7 +24,6 @@ #include "nsFrameManager.h" #include "mozilla/dom/Document.h" #include "nsRect.h" -#include "nsIScrollableFrame.h" #include "nsIPopupContainer.h" #include "nsIDocShell.h" #include "nsReadableUtils.h" @@ -53,6 +52,7 @@ #include "mozilla/LookAndFeel.h" #include "mozilla/MouseEvents.h" #include "mozilla/PresShell.h" +#include "mozilla/ScrollContainerFrame.h" #include "mozilla/Services.h" #include "mozilla/dom/BrowserParent.h" #include "mozilla/dom/Element.h" @@ -472,7 +472,7 @@ void nsMenuPopupFrame::TweakMinPrefISize(nscoord& aSize) { // // Automatically accommodating for the scrollbar otherwise would be bug // 764076, but that has its own set of problems. - if (nsIScrollableFrame* sf = GetScrollFrame()) { + if (ScrollContainerFrame* sf = GetScrollContainerFrame()) { aSize += sf->GetDesiredScrollbarSizes().LeftRight(); } @@ -1170,7 +1170,7 @@ nsPoint nsMenuPopupFrame::AdjustPositionForAnchorAlign( // popup up in a way that our box would no longer intersect with the // anchor. nscoord maxOffset = aPrefSize.height - itemHeight; - if (const nsIScrollableFrame* sf = GetScrollFrame()) { + if (const ScrollContainerFrame* sf = GetScrollContainerFrame()) { // HACK: We ideally would want to use the offset from the bottom // bottom of our scroll-frame to the bottom of our frame (so as to // ensure that the bottom of the scrollport is inside the anchor @@ -1183,8 +1183,7 @@ nsPoint nsMenuPopupFrame::AdjustPositionForAnchorAlign( // from the top. This holds for all the popups where this matters // (menulists on macOS, effectively), and seems better than somehow // moving the popup after the fact as we used to do. - const nsIFrame* f = do_QueryFrame(sf); - maxOffset -= f->GetOffsetTo(this).y; + maxOffset -= sf->GetOffsetTo(this).y; } mPositionedOffset = originalAnchorRect.height + std::min(itemOffset, maxOffset); @@ -1905,12 +1904,12 @@ ConsumeOutsideClicksResult nsMenuPopupFrame::ConsumeOutsideClicks() { return ConsumeOutsideClicks_True; } -static nsIScrollableFrame* DoGetScrollFrame(const nsIFrame* aFrame) { - if (const nsIScrollableFrame* sf = do_QueryFrame(aFrame)) { - return const_cast(sf); +static ScrollContainerFrame* DoGetScrollContainerFrame(const nsIFrame* aFrame) { + if (const ScrollContainerFrame* sf = do_QueryFrame(aFrame)) { + return const_cast(sf); } for (nsIFrame* childFrame : aFrame->PrincipalChildList()) { - if (auto* sf = DoGetScrollFrame(childFrame)) { + if (auto* sf = DoGetScrollContainerFrame(childFrame)) { return sf; } } @@ -1919,8 +1918,8 @@ static nsIScrollableFrame* DoGetScrollFrame(const nsIFrame* aFrame) { // XXXroc this is megalame. Fossicking around for a frame of the right // type is a recipe for disaster in the long term. -nsIScrollableFrame* nsMenuPopupFrame::GetScrollFrame() const { - return DoGetScrollFrame(this); +ScrollContainerFrame* nsMenuPopupFrame::GetScrollContainerFrame() const { + return DoGetScrollContainerFrame(this); } void nsMenuPopupFrame::ChangeByPage(bool aIsUp) { @@ -1929,7 +1928,7 @@ void nsMenuPopupFrame::ChangeByPage(bool aIsUp) { return; } - nsIScrollableFrame* scrollframe = GetScrollFrame(); + ScrollContainerFrame* scrollContainerFrame = GetScrollContainerFrame(); RefPtr popup = &PopupElement(); XULButtonElement* currentMenu = popup->GetActiveMenuChild(); @@ -1947,7 +1946,8 @@ void nsMenuPopupFrame::ChangeByPage(bool aIsUp) { if (currentMenu && currentMenu->GetPrimaryFrame()) { const nscoord scrollHeight = - scrollframe ? scrollframe->GetScrollPortRect().height : mRect.height; + scrollContainerFrame ? scrollContainerFrame->GetScrollPortRect().height + : mRect.height; const nsRect currentRect = currentMenu->GetPrimaryFrame()->GetRect(); const XULButtonElement* startMenu = currentMenu; diff --git a/layout/xul/nsMenuPopupFrame.h b/layout/xul/nsMenuPopupFrame.h index aeabdfa0bfb8..eed6b54d3a1e 100644 --- a/layout/xul/nsMenuPopupFrame.h +++ b/layout/xul/nsMenuPopupFrame.h @@ -24,7 +24,6 @@ #include "Units.h" -class nsIScrollableFrame; class nsIWidget; namespace mozilla { @@ -339,7 +338,7 @@ class nsMenuPopupFrame final : public nsBlockFrame { void MoveToAnchor(nsIContent* aAnchorContent, const nsAString& aPosition, int32_t aXPos, int32_t aYPos, bool aAttributesOverride); - nsIScrollableFrame* GetScrollFrame() const; + mozilla::ScrollContainerFrame* GetScrollContainerFrame() const; void SetOverrideConstraintRect(const mozilla::CSSIntRect& aRect) { mOverrideConstraintRect = mozilla::CSSIntRect::ToAppUnits(aRect); diff --git a/layout/xul/nsScrollbarFrame.cpp b/layout/xul/nsScrollbarFrame.cpp index af229af718e2..d726fb9f56a5 100644 --- a/layout/xul/nsScrollbarFrame.cpp +++ b/layout/xul/nsScrollbarFrame.cpp @@ -166,13 +166,13 @@ nsresult nsScrollbarFrame::AttributeChanged(int32_t aNameSpaceID, return rv; } - nsIScrollableFrame* scrollable = do_QueryFrame(GetParent()); - if (!scrollable) { + ScrollContainerFrame* scrollContainerFrame = do_QueryFrame(GetParent()); + if (!scrollContainerFrame) { return rv; } nsCOMPtr content(mContent); - scrollable->CurPosAttributeChanged(content); + scrollContainerFrame->CurPosAttributeChanged(content); return rv; } @@ -214,11 +214,11 @@ nsIScrollbarMediator* nsScrollbarFrame::GetScrollbarMediator() { return nullptr; } nsIFrame* f = mScrollbarMediator->GetPrimaryFrame(); - nsIScrollableFrame* scrollFrame = do_QueryFrame(f); + ScrollContainerFrame* scrollContainerFrame = do_QueryFrame(f); nsIScrollbarMediator* sbm; - if (scrollFrame) { - nsIFrame* scrolledFrame = scrollFrame->GetScrolledFrame(); + if (scrollContainerFrame) { + nsIFrame* scrolledFrame = scrollContainerFrame->GetScrolledFrame(); sbm = do_QueryFrame(scrolledFrame); if (sbm) { return sbm; diff --git a/layout/xul/nsSliderFrame.cpp b/layout/xul/nsSliderFrame.cpp index 6d26f7603530..07c9ab7ce2ca 100644 --- a/layout/xul/nsSliderFrame.cpp +++ b/layout/xul/nsSliderFrame.cpp @@ -22,7 +22,6 @@ #include "nsHTMLParts.h" #include "nsCSSRendering.h" #include "nsScrollbarButtonFrame.h" -#include "nsIScrollableFrame.h" #include "nsIScrollbarMediator.h" #include "nsISupportsImpl.h" #include "nsScrollbarFrame.h" @@ -38,6 +37,7 @@ #include "mozilla/MouseEvents.h" #include "mozilla/Preferences.h" #include "mozilla/PresShell.h" +#include "mozilla/ScrollContainerFrame.h" #include "mozilla/StaticPrefs_general.h" #include "mozilla/StaticPrefs_layout.h" #include "mozilla/SVGIntegrationUtils.h" @@ -388,9 +388,9 @@ void nsSliderFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, // XXX seems like this should be done in nsScrollbarFrame instead perhaps? if (!aBuilder->IsForEventDelivery()) { nsScrollbarFrame* scrollbar = Scrollbar(); - if (nsIScrollableFrame* scrollFrame = + if (ScrollContainerFrame* scrollContainerFrame = do_QueryFrame(scrollbar->GetParent())) { - if (scrollFrame->IsRootScrollFrameOfDocument()) { + if (scrollContainerFrame->IsRootScrollFrameOfDocument()) { nsGlobalWindowInner* window = nsGlobalWindowInner::Cast( PresContext()->Document()->GetInnerWindow()); if (window && @@ -408,10 +408,10 @@ static bool UsesCustomScrollbarMediator(nsIFrame* scrollbarBox) { if (nsScrollbarFrame* scrollbarFrame = do_QueryFrame(scrollbarBox)) { if (nsIScrollbarMediator* mediator = scrollbarFrame->GetScrollbarMediator()) { - nsIScrollableFrame* scrollFrame = do_QueryFrame(mediator); - // The scrollbar mediator is not the scroll frame. - // That means this scroll frame has a custom scrollbar mediator. - if (!scrollFrame) { + ScrollContainerFrame* scrollContainerFrame = do_QueryFrame(mediator); + // The scrollbar mediator is not the scroll container frame. + // That means this scroll container frame has a custom scrollbar mediator. + if (!scrollContainerFrame) { return true; } } @@ -456,9 +456,9 @@ void nsSliderFrame::BuildDisplayListForThumb(nsDisplayListBuilder* aBuilder, bool isAsyncDraggable = !UsesCustomScrollbarMediator(scrollbarBox); nsPoint scrollPortOrigin; - if (nsIScrollableFrame* scrollFrame = + if (ScrollContainerFrame* scrollContainerFrame = do_QueryFrame(scrollbarBox->GetParent())) { - scrollPortOrigin = scrollFrame->GetScrollPortRect().TopLeft(); + scrollPortOrigin = scrollContainerFrame->GetScrollPortRect().TopLeft(); } else { isAsyncDraggable = false; } @@ -1057,7 +1057,7 @@ static bool ScrollFrameWillBuildScrollInfoLayer(nsIFrame* aScrollFrame) { return false; } -nsIScrollableFrame* nsSliderFrame::GetScrollFrame() { +ScrollContainerFrame* nsSliderFrame::GetScrollContainerFrame() { return do_QueryFrame(Scrollbar()->GetParent()); } @@ -1466,11 +1466,11 @@ void nsSliderFrame::PageScroll(bool aClickAndHold) { } nsScrollbarFrame* sb = Scrollbar(); - nsIScrollableFrame* sf = GetScrollFrame(); + ScrollContainerFrame* sf = GetScrollContainerFrame(); const ScrollSnapFlags scrollSnapFlags = ScrollSnapFlags::IntendedDirection | ScrollSnapFlags::IntendedEndPosition; - // If our nsIScrollbarMediator implementation is an nsIScrollableFrame, + // If our nsIScrollbarMediator implementation is a ScrollContainerFrame, // use ScrollTo() to ensure we do not scroll past the intended // destination. Otherwise, the combination of smooth scrolling and // ScrollBy() semantics (which adds the delta to the current destination diff --git a/layout/xul/nsSliderFrame.h b/layout/xul/nsSliderFrame.h index d47784faa31e..8eba43becfa3 100644 --- a/layout/xul/nsSliderFrame.h +++ b/layout/xul/nsSliderFrame.h @@ -22,6 +22,7 @@ class nsSliderFrame; namespace mozilla { class nsDisplaySliderMarks; class PresShell; +class ScrollContainerFrame; } // namespace mozilla nsIFrame* NS_NewSliderFrame(mozilla::PresShell* aPresShell, @@ -152,8 +153,9 @@ class nsSliderFrame final : public nsContainerFrame { bool OnlySystemGroupDispatch(mozilla::EventMessage aMessage) const override; - // Returns the associated scrollframe that contains this slider if any. - nsIScrollableFrame* GetScrollFrame(); + // Returns the associated scroll container frame that contains this slider if + // any. + mozilla::ScrollContainerFrame* GetScrollContainerFrame(); private: bool GetScrollToClick(); diff --git a/layout/xul/tree/nsTreeBodyFrame.cpp b/layout/xul/tree/nsTreeBodyFrame.cpp index a7eba30f8be3..c924c812c6cc 100644 --- a/layout/xul/tree/nsTreeBodyFrame.cpp +++ b/layout/xul/tree/nsTreeBodyFrame.cpp @@ -17,6 +17,7 @@ #include "mozilla/MouseEvents.h" #include "mozilla/PresShell.h" #include "mozilla/ResultExtensions.h" +#include "mozilla/ScrollContainerFrame.h" #include "mozilla/Try.h" #include "mozilla/intl/Segmenter.h" @@ -57,7 +58,6 @@ #include "mozilla/dom/NodeInfo.h" #include "nsContentUtils.h" #include "nsLayoutUtils.h" -#include "nsIScrollableFrame.h" #include "nsDisplayList.h" #include "mozilla/dom/CustomEvent.h" #include "mozilla/dom/Event.h" @@ -710,7 +710,7 @@ nsresult nsTreeBodyFrame::InvalidateRange(int32_t aStart, int32_t aEnd) { static void FindScrollParts(nsIFrame* aCurrFrame, nsTreeBodyFrame::ScrollParts* aResult) { if (!aResult->mColumnsScrollFrame) { - nsIScrollableFrame* f = do_QueryFrame(aCurrFrame); + ScrollContainerFrame* f = do_QueryFrame(aCurrFrame); if (f) { aResult->mColumnsFrame = aCurrFrame; aResult->mColumnsScrollFrame = f; diff --git a/layout/xul/tree/nsTreeBodyFrame.h b/layout/xul/tree/nsTreeBodyFrame.h index d7a9498cedb8..7754aa22229a 100644 --- a/layout/xul/tree/nsTreeBodyFrame.h +++ b/layout/xul/tree/nsTreeBodyFrame.h @@ -32,6 +32,7 @@ class nsTreeImageListener; namespace mozilla { class PresShell; +class ScrollContainerFrame; namespace layout { class ScrollbarActivity; } // namespace layout @@ -179,7 +180,7 @@ class nsTreeBodyFrame final : public mozilla::SimpleXULLeafFrame, nsScrollbarFrame* mHScrollbar; RefPtr mHScrollbarContent; nsIFrame* mColumnsFrame; - nsIScrollableFrame* mColumnsScrollFrame; + mozilla::ScrollContainerFrame* mColumnsScrollFrame; }; ImgDrawResult PaintTreeBody(gfxContext& aRenderingContext, diff --git a/toolkit/components/sessionstore/SessionStoreUtils.cpp b/toolkit/components/sessionstore/SessionStoreUtils.cpp index 3c0eaa00e4d4..6a103bd13bb4 100644 --- a/toolkit/components/sessionstore/SessionStoreUtils.cpp +++ b/toolkit/components/sessionstore/SessionStoreUtils.cpp @@ -53,7 +53,6 @@ #include "nsIContentInlines.h" #include "nsIDocShell.h" #include "nsIFormControl.h" -#include "nsIScrollableFrame.h" #include "nsISHistory.h" #include "nsIXULRuntime.h" #include "nsPresContext.h" diff --git a/widget/Theme.cpp b/widget/Theme.cpp index 1fef1e2d6b55..41f861492886 100644 --- a/widget/Theme.cpp +++ b/widget/Theme.cpp @@ -18,12 +18,12 @@ #include "mozilla/gfx/Types.h" #include "mozilla/gfx/Filters.h" #include "mozilla/RelativeLuminanceUtils.h" +#include "mozilla/ScrollContainerFrame.h" #include "mozilla/StaticPrefs_widget.h" #include "mozilla/webrender/WebRenderAPI.h" #include "nsCSSColorUtils.h" #include "nsCSSRendering.h" #include "nsScrollbarFrame.h" -#include "nsIScrollableFrame.h" #include "nsIScrollbarMediator.h" #include "nsDeviceContext.h" #include "nsLayoutUtils.h" @@ -1139,7 +1139,7 @@ static ScrollbarDrawing::ScrollbarKind ComputeScrollbarKind( static ScrollbarDrawing::ScrollbarKind ComputeScrollbarKindForScrollCorner( nsIFrame* aFrame) { - nsIScrollableFrame* sf = do_QueryFrame(aFrame->GetParent()); + ScrollContainerFrame* sf = do_QueryFrame(aFrame->GetParent()); if (!sf) { return ScrollbarDrawing::ScrollbarKind::VerticalRight; } diff --git a/widget/cocoa/nsNativeThemeCocoa.mm b/widget/cocoa/nsNativeThemeCocoa.mm index ad16fac04ab8..4bb570ba19c8 100644 --- a/widget/cocoa/nsNativeThemeCocoa.mm +++ b/widget/cocoa/nsNativeThemeCocoa.mm @@ -29,7 +29,6 @@ #include "nsCocoaFeatures.h" #include "nsCocoaWindow.h" #include "nsNativeThemeColors.h" -#include "nsIScrollableFrame.h" #include "mozilla/ClearOnShutdown.h" #include "mozilla/Range.h" #include "mozilla/dom/Element.h"