Bug 1824877 Part 2 - Rename nsHTMLScrollFrame to mozilla::ScrollContainerFrame. r=dholbert

Also, change the ScrollContainerFrame::GetFrameName() to return
"ScrollContainer" instead of "HTMLScroll".

Differential Revision: https://phabricator.services.mozilla.com/D210233
This commit is contained in:
Ting-Yu Lin 2024-05-15 17:50:48 +00:00
parent 89d03cb81b
commit fb92ee5f64
24 changed files with 428 additions and 409 deletions

View File

@ -244,7 +244,7 @@ class ScrollTimeline : public AnimationTimeline {
* of scroll driven animations. This is used for all kinds of progress
* timelines, i.e. anonymous/named scroll timelines and anonymous/named view
* timelines. And this object is owned by the scroll source (See
* ElementAnimationData and nsGfxScrollFrame for the usage).
* ElementAnimationData and ScrollContainerFrame for the usage).
*/
class ProgressTimelineScheduler {
public:

View File

@ -351,7 +351,7 @@ static Maybe<nsRect> ComputeTheIntersection(
nsLayoutUtils::GetCrossDocParentFrameInProcess(target);
while (containerFrame && containerFrame != aRoot) {
// FIXME(emilio): What about other scroll frames that inherit from
// nsHTMLScrollFrame but have a different type, like nsListControlFrame?
// ScrollContainerFrame but have a different type, like nsListControlFrame?
// This looks bogus in that case, but different bug.
if (nsIScrollableFrame* scrollFrame = do_QueryFrame(containerFrame)) {
if (containerFrame->GetParent() == aRoot && !aRoot->GetParent()) {

View File

@ -6543,7 +6543,7 @@ Maybe<CSSSnapDestination> AsyncPanZoomController::FindSnapPointNear(
// GetSnapPointForDestination() can produce a destination that's outside
// of the scroll frame's scroll range. Clamp it here (this matches the
// behaviour of the main-thread code path, which clamps it in
// nsGfxScrollFrame::ScrollTo()).
// ScrollContainerFrame::ScrollTo()).
return Some(CSSSnapDestination{scrollRange.ClampPoint(cssSnapPoint),
snapDestination->mTargetIds});
}

View File

@ -6079,7 +6079,7 @@ void PresShell::MarkFramesInSubtreeApproximatelyVisible(
// We can properly set the base rect for root scroll frames on top level
// and root content documents. Otherwise the base rect we compute might
// be way too big without the limiting that
// nsHTMLScrollFrame::DecideScrollableLayer does, so we just ignore the
// ScrollContainerFrame::DecideScrollableLayer does, so we just ignore the
// displayport in that case.
nsPresContext* pc = aFrame->PresContext();
if (scrollFrame->IsRootScrollFrameOfDocument() &&
@ -11476,7 +11476,7 @@ bool PresShell::SetVisualViewportOffset(const nsPoint& aScrollOffset,
nsPoint newOffset = aScrollOffset;
nsIScrollableFrame* rootScrollFrame = GetRootScrollFrameAsScrollable();
if (rootScrollFrame) {
// See the comment in nsHTMLScrollFrame::Reflow above the call to
// See the comment in ScrollContainerFrame::Reflow above the call to
// SetVisualViewportOffset for why we need to do this.
nsRect scrollRange = rootScrollFrame->GetScrollRangeForUserInputEvents();
if (!scrollRange.Contains(newOffset)) {

View File

@ -769,7 +769,7 @@ static nsIFrame* GetFrameForChildrenOnlyTransformHint(nsIFrame* aFrame) {
// GetContent() returns nullptr for ViewportFrame.
aFrame = aFrame->PrincipalChildList().FirstChild();
}
// For an nsHTMLScrollFrame, this will get the SVG frame that has the
// For a ScrollContainerFrame, this will get the SVG frame that has the
// children-only transforms:
aFrame = aFrame->GetContent()->GetPrimaryFrame();
if (aFrame->IsSVGOuterSVGFrame()) {

View File

@ -213,9 +213,6 @@ nsIFrame* NS_NewMenuPopupFrame(PresShell* aPresShell, ComputedStyle* aStyle);
nsIFrame* NS_NewTreeBodyFrame(PresShell* aPresShell, ComputedStyle* aStyle);
nsHTMLScrollFrame* NS_NewHTMLScrollFrame(PresShell* aPresShell,
ComputedStyle* aStyle, bool aIsRoot);
nsIFrame* NS_NewSliderFrame(PresShell* aPresShell, ComputedStyle* aStyle);
nsIFrame* NS_NewScrollbarFrame(PresShell* aPresShell, ComputedStyle* aStyle);
@ -468,10 +465,10 @@ static nsIFrame* GetIBContainingBlockFor(nsIFrame* aFrame) {
// Find the multicol containing block suitable for reframing.
//
// Note: this function may not return a ColumnSetWrapperFrame. For example, if
// the multicol containing block has "overflow:scroll" style, HTMLScrollFrame is
// returned because ColumnSetWrapperFrame is the scrolled frame which has the
// -moz-scrolled-content pseudo style. We may walk up "too far", but in terms of
// correctness of reframing, it's OK.
// the multicol containing block has "overflow:scroll" style,
// ScrollContainerFrame is returned because ColumnSetWrapperFrame is the
// scrolled frame which has the -moz-scrolled-content pseudo style. We may walk
// up "too far", but in terms of correctness of reframing, it's OK.
static nsContainerFrame* GetMultiColumnContainingBlockFor(nsIFrame* aFrame) {
MOZ_ASSERT(aFrame->HasAnyStateBits(NS_FRAME_HAS_MULTI_COLUMN_ANCESTOR),
"Should only be called if the frame has a multi-column ancestor!");
@ -2684,7 +2681,7 @@ void nsCSSFrameConstructor::SetUpDocElementContainingBlock(
Galley presentation, with scrolling:
ViewportFrame [fixed-cb]
nsHTMLScrollFrame (if needed)
ScrollContainerFrame (if needed)
nsCanvasFrame [abs-cb]
root element frame (nsBlockFrame, SVGOuterSVGFrame,
nsTableWrapperFrame, nsPlaceholderFrame)
@ -2704,7 +2701,7 @@ void nsCSSFrameConstructor::SetUpDocElementContainingBlock(
Print-preview presentation, non-XUL
ViewportFrame
nsHTMLScrollFrame
ScrollContainerFrame
nsCanvasFrame
nsPageSequenceFrame
PrintedSheetFrame
@ -4179,7 +4176,8 @@ already_AddRefed<ComputedStyle> nsCSSFrameConstructor::BeginBuildingScrollFrame(
nsContainerFrame* gfxScrollFrame = aNewFrame;
if (!gfxScrollFrame) {
gfxScrollFrame = NS_NewHTMLScrollFrame(mPresShell, aContentStyle, aIsRoot);
gfxScrollFrame =
NS_NewScrollContainerFrame(mPresShell, aContentStyle, aIsRoot);
InitAndRestoreFrame(aState, aContent, aParentFrame, gfxScrollFrame);
}

View File

@ -1398,7 +1398,7 @@ nsRect nsLayoutUtils::GetScrolledRect(nsIFrame* aScrolledFrame,
StyleDirection aDirection) {
WritingMode wm = aScrolledFrame->GetWritingMode();
// Potentially override the frame's direction to use the direction found
// by nsHTMLScrollFrame::GetScrolledFrameDir()
// by ScrollContainerFrame::GetScrolledFrameDir()
wm.SetDirectionFromBidiLevel(aDirection == StyleDirection::Rtl
? mozilla::intl::BidiEmbeddingLevel::RTL()
: mozilla::intl::BidiEmbeddingLevel::LTR());
@ -3165,7 +3165,7 @@ void nsLayoutUtils::PaintFrame(gfxContext* aRenderingContext, nsIFrame* aFrame,
// In cases where the root document is a XUL document, we want to take
// the ViewID from the root element, as that will be the ViewID of the
// root APZC in the tree. Skip doing this in cases where we know
// nsGfxScrollFrame::BuilDisplayList will do it instead.
// ScrollContainerFrame::BuilDisplayList will do it instead.
if (dom::Element* element =
presShell->GetDocument()->GetDocumentElement()) {
id = nsLayoutUtils::FindOrCreateIDFor(element);
@ -4162,7 +4162,7 @@ static bool GetPercentBSize(const LengthPercentage& aStyle, nsIFrame* aFrame,
MOZ_ASSERT(!aStyle.ConvertsToLength(),
"GetAbsoluteCoord should have handled this");
// During reflow, nsHTMLScrollFrame::ReflowScrolledFrame uses
// During reflow, ScrollContainerFrame::ReflowScrolledFrame uses
// SetComputedHeight on the reflow input for its child to propagate its
// computed height to the scrolled content. So here we skip to the scroll
// frame that contains this scrolled content in order to get the same

View File

@ -55,7 +55,7 @@ NS_IMPL_FRAMEARENA_HELPERS(nsListControlFrame)
nsListControlFrame::nsListControlFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext)
: nsHTMLScrollFrame(aStyle, aPresContext, kClassID, false),
: ScrollContainerFrame(aStyle, aPresContext, kClassID, false),
mMightNeedSecondPass(false),
mHasPendingInterruptAtStartOfReflow(false),
mForceSelection(false) {
@ -85,7 +85,7 @@ void nsListControlFrame::Destroy(DestroyContext& aContext) {
// event listener can outlive the frame.
mEventListener->Detach();
nsHTMLScrollFrame::Destroy(aContext);
ScrollContainerFrame::Destroy(aContext);
}
void nsListControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
@ -99,7 +99,7 @@ void nsListControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
DO_GLOBAL_REFLOW_COUNT_DSP("nsListControlFrame");
nsHTMLScrollFrame::BuildDisplayList(aBuilder, aLists);
ScrollContainerFrame::BuildDisplayList(aBuilder, aLists);
}
HTMLOptionElement* nsListControlFrame::GetCurrentOption() const {
@ -170,7 +170,7 @@ NS_QUERYFRAME_HEAD(nsListControlFrame)
NS_QUERYFRAME_ENTRY(nsIFormControlFrame)
NS_QUERYFRAME_ENTRY(nsISelectControlFrame)
NS_QUERYFRAME_ENTRY(nsListControlFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsHTMLScrollFrame)
NS_QUERYFRAME_TAIL_INHERITING(ScrollContainerFrame)
#ifdef ACCESSIBILITY
a11y::AccType nsListControlFrame::AccessibleType() {
@ -340,7 +340,7 @@ void nsListControlFrame::Reflow(nsPresContext* aPresContext,
state.SetComputedBSize(*containBSize);
}
nsHTMLScrollFrame::Reflow(aPresContext, aDesiredSize, state, aStatus);
ScrollContainerFrame::Reflow(aPresContext, aDesiredSize, state, aStatus);
if (!mMightNeedSecondPass) {
NS_ASSERTION(!autoBSize || BSizeOfARow() == oldBSizeOfARow,
@ -384,9 +384,9 @@ void nsListControlFrame::Reflow(nsPresContext* aPresContext,
// XXXbz We're just changing the block size here; do we need to dirty
// ourselves or anything like that? We might need to, per the letter
// of the reflow protocol, but things seem to work fine without it...
// Is that just an implementation detail of nsHTMLScrollFrame that
// Is that just an implementation detail of ScrollContainerFrame that
// we're depending on?
nsHTMLScrollFrame::DidReflow(aPresContext, &state);
ScrollContainerFrame::DidReflow(aPresContext, &state);
// Now compute the block size we want to have
nscoord computedBSize = CalcIntrinsicBSize(BSizeOfARow(), length);
@ -395,9 +395,9 @@ void nsListControlFrame::Reflow(nsPresContext* aPresContext,
// XXXbz to make the ascent really correct, we should add our
// mComputedPadding.top to it (and subtract it from descent). Need that
// because nsGfxScrollFrame just adds in the border....
// because ScrollContainerFrame just adds in the border....
aStatus.Reset();
nsHTMLScrollFrame::Reflow(aPresContext, aDesiredSize, state, aStatus);
ScrollContainerFrame::Reflow(aPresContext, aDesiredSize, state, aStatus);
}
bool nsListControlFrame::ShouldPropagateComputedBSizeToScrolledContent() const {
@ -646,12 +646,12 @@ nsresult nsListControlFrame::HandleEvent(nsPresContext* aPresContext,
if (nsEventStatus_eConsumeNoDefault == *aEventStatus) return NS_OK;
// disabled state affects how we're selected, but we don't want to go through
// nsHTMLScrollFrame if we're disabled.
// ScrollContainerFrame if we're disabled.
if (IsContentDisabled()) {
return nsIFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
}
return nsHTMLScrollFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
return ScrollContainerFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
}
//---------------------------------------------------------
@ -665,7 +665,7 @@ void nsListControlFrame::SetInitialChildList(ChildListID aListID,
mHasBeenInitialized = false;
}
}
nsHTMLScrollFrame::SetInitialChildList(aListID, std::move(aChildList));
ScrollContainerFrame::SetInitialChildList(aListID, std::move(aChildList));
}
HTMLSelectElement& nsListControlFrame::Select() const {
@ -675,7 +675,7 @@ HTMLSelectElement& nsListControlFrame::Select() const {
//---------------------------------------------------------
void nsListControlFrame::Init(nsIContent* aContent, nsContainerFrame* aParent,
nsIFrame* aPrevInFlow) {
nsHTMLScrollFrame::Init(aContent, aParent, aPrevInFlow);
ScrollContainerFrame::Init(aContent, aParent, aPrevInFlow);
// we shouldn't have to unregister this listener because when
// our frame goes away all these content node go away as well
@ -978,7 +978,7 @@ void nsListControlFrame::DidReflow(nsPresContext* aPresContext,
bool wasInterrupted = !mHasPendingInterruptAtStartOfReflow &&
aPresContext->HasPendingInterrupt();
nsHTMLScrollFrame::DidReflow(aPresContext, aReflowInput);
ScrollContainerFrame::DidReflow(aPresContext, aReflowInput);
if (mNeedToReset && !wasInterrupted) {
mNeedToReset = false;

View File

@ -43,7 +43,7 @@ class HTMLOptionsCollection;
* Frame-based listbox.
*/
class nsListControlFrame final : public nsHTMLScrollFrame,
class nsListControlFrame final : public mozilla::ScrollContainerFrame,
public nsIFormControlFrame,
public nsISelectControlFrame {
public:
@ -195,7 +195,7 @@ class nsListControlFrame final : public nsHTMLScrollFrame,
bool MightNeedSecondPass() const { return mMightNeedSecondPass; }
void SetSuppressScrollbarUpdate(bool aSuppress) {
nsHTMLScrollFrame::SetSuppressScrollbarUpdate(aSuppress);
ScrollContainerFrame::SetSuppressScrollbarUpdate(aSuppress);
}
/**

View File

@ -1145,7 +1145,7 @@ NS_IMETHODIMP
nsTextControlFrame::RestoreState(PresState* aState) {
NS_ENSURE_ARG_POINTER(aState);
// Query the nsIStatefulFrame from the HTMLScrollFrame
// Query the nsIStatefulFrame from the ScrollContainerFrame
if (nsIStatefulFrame* scrollStateFrame =
do_QueryFrame(GetScrollTargetFrame())) {
return scrollStateFrame->RestoreState(aState);

View File

@ -75,7 +75,6 @@ FRAME_CLASSES = [
Frame("nsHTMLFramesetBlankFrame", "None", COMMON | LEAF),
Frame("nsHTMLFramesetBorderFrame", "None", COMMON | LEAF),
Frame("nsHTMLFramesetFrame", "FrameSet", COMMON | LEAF),
Frame("nsHTMLScrollFrame", "Scroll", COMMON),
Frame("nsImageControlFrame", "ImageControl", REPLACED_SIZING | LEAF),
Frame("nsImageFrame", "Image", REPLACED_SIZING | {"LeafDynamic"}),
Frame("nsInlineFrame", "Inline", INLINE),
@ -112,6 +111,7 @@ FRAME_CLASSES = [
Frame("nsRubyFrame", "Ruby", RUBY_CONTENT),
Frame("nsRubyTextContainerFrame", "RubyTextContainer", {"None"}),
Frame("nsRubyTextFrame", "RubyText", RUBY_CONTENT),
Frame("ScrollContainerFrame", "Scroll", COMMON),
Frame("SimpleXULLeafFrame", "SimpleXULLeaf", COMMON | LEAF),
Frame("nsScrollbarButtonFrame", "SimpleXULLeaf", COMMON | LEAF),
Frame("nsScrollbarFrame", "Scrollbar", COMMON),

View File

@ -45,12 +45,12 @@ static mozilla::LazyLogModule sAnchorLog("scrollanchor");
namespace mozilla::layout {
nsHTMLScrollFrame* ScrollAnchorContainer::Frame() const {
return reinterpret_cast<nsHTMLScrollFrame*>(
((char*)this) - offsetof(nsHTMLScrollFrame, mAnchor));
ScrollContainerFrame* ScrollAnchorContainer::Frame() const {
return reinterpret_cast<ScrollContainerFrame*>(
((char*)this) - offsetof(ScrollContainerFrame, mAnchor));
}
ScrollAnchorContainer::ScrollAnchorContainer(nsHTMLScrollFrame* aScrollFrame)
ScrollAnchorContainer::ScrollAnchorContainer(ScrollContainerFrame* aScrollFrame)
: mDisabled(false),
mAnchorMightBeSubOptimal(false),
mAnchorNodeIsDirty(true),
@ -199,16 +199,16 @@ static nsRect FindScrollAnchoringBoundingRect(const nsIFrame* aScrollFrame,
/**
* Compute the offset between the scrollable overflow rect start edge of
* aCandidate and the scroll-port start edge of aScrollFrame, in the block axis
* of aScrollFrame.
* aCandidate and the scroll-port start edge of aScrollContainerFrame, in the
* block axis of aScrollContainerFrame.
*/
static nscoord FindScrollAnchoringBoundingOffset(
const nsHTMLScrollFrame* aScrollFrame, nsIFrame* aCandidate) {
WritingMode writingMode = aScrollFrame->GetWritingMode();
const ScrollContainerFrame* aScrollContainerFrame, nsIFrame* aCandidate) {
WritingMode writingMode = aScrollContainerFrame->GetWritingMode();
nsRect physicalBounding =
FindScrollAnchoringBoundingRect(aScrollFrame, aCandidate);
FindScrollAnchoringBoundingRect(aScrollContainerFrame, aCandidate);
LogicalRect logicalBounding(writingMode, physicalBounding,
aScrollFrame->mScrolledFrame->GetSize());
aScrollContainerFrame->mScrolledFrame->GetSize());
return logicalBounding.BStart(writingMode);
}

View File

@ -12,10 +12,13 @@
#include "mozilla/TimeStamp.h"
class nsFrameList;
class nsHTMLScrollFrame;
class nsIFrame;
class nsIScrollableFrame;
namespace mozilla {
class ScrollContainerFrame;
}
namespace mozilla::layout {
/**
@ -27,7 +30,7 @@ namespace mozilla::layout {
*/
class ScrollAnchorContainer final {
public:
explicit ScrollAnchorContainer(nsHTMLScrollFrame* aScrollFrame);
explicit ScrollAnchorContainer(ScrollContainerFrame* aScrollFrame);
~ScrollAnchorContainer();
/**
@ -43,7 +46,7 @@ class ScrollAnchorContainer final {
nsIFrame* AnchorNode() const { return mAnchorNode; }
// The owner of this scroll anchor container.
nsHTMLScrollFrame* Frame() const;
ScrollContainerFrame* Frame() const;
/**
* Returns the frame that owns this scroll anchor container as a scrollable

File diff suppressed because it is too large Load Diff

View File

@ -35,6 +35,7 @@ class AutoContainsBlendModeCapturer;
namespace mozilla {
class PresShell;
enum class StyleScrollbarWidth : uint8_t;
class ScrollContainerFrame;
struct ScrollReflowInput;
struct StyleScrollSnapAlign;
namespace layers {
@ -47,6 +48,12 @@ class ScrollbarActivity;
} // namespace mozilla
mozilla::ScrollContainerFrame* NS_NewScrollContainerFrame(
mozilla::PresShell* aPresShell, mozilla::ComputedStyle* aStyle,
bool aIsRoot);
namespace mozilla {
/**
* The scroll frame creates and manages the scrolling view
*
@ -56,11 +63,11 @@ class ScrollbarActivity;
* Scroll frames don't support incremental changes, i.e. you can't replace
* or remove the scrolled frame
*/
class nsHTMLScrollFrame : public nsContainerFrame,
public nsIScrollableFrame,
public nsIAnonymousContentCreator,
public nsIReflowCallback,
public nsIStatefulFrame {
class ScrollContainerFrame : public nsContainerFrame,
public nsIScrollableFrame,
public nsIAnonymousContentCreator,
public nsIReflowCallback,
public nsIStatefulFrame {
public:
using Sides = nsIFrame::Sides;
using ScrollbarActivity = mozilla::layout::ScrollbarActivity;
@ -82,12 +89,13 @@ class nsHTMLScrollFrame : public nsContainerFrame,
using CSSPoint = mozilla::CSSPoint;
using ScrollReflowInput = mozilla::ScrollReflowInput;
using ScrollAnchorContainer = mozilla::layout::ScrollAnchorContainer;
friend nsHTMLScrollFrame* NS_NewHTMLScrollFrame(
friend ScrollContainerFrame* ::NS_NewScrollContainerFrame(
mozilla::PresShell* aPresShell, ComputedStyle* aStyle, bool aIsRoot);
friend class mozilla::layout::ScrollAnchorContainer;
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS(nsHTMLScrollFrame)
NS_DECL_FRAMEARENA_HELPERS(ScrollContainerFrame)
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists) override;
@ -170,7 +178,7 @@ class nsHTMLScrollFrame : public nsContainerFrame,
void Destroy(DestroyContext&) override;
nsIScrollableFrame* GetScrollTargetFrame() const final {
return const_cast<nsHTMLScrollFrame*>(this);
return const_cast<ScrollContainerFrame*>(this);
}
nsContainerFrame* GetContentInsertionFrame() override {
@ -445,12 +453,12 @@ class nsHTMLScrollFrame : public nsContainerFrame,
#endif
protected:
nsHTMLScrollFrame(ComputedStyle* aStyle, nsPresContext* aPresContext,
bool aIsRoot)
: nsHTMLScrollFrame(aStyle, aPresContext, kClassID, aIsRoot) {}
nsHTMLScrollFrame(ComputedStyle* aStyle, nsPresContext* aPresContext,
nsIFrame::ClassID aID, bool aIsRoot);
~nsHTMLScrollFrame();
ScrollContainerFrame(ComputedStyle* aStyle, nsPresContext* aPresContext,
bool aIsRoot)
: ScrollContainerFrame(aStyle, aPresContext, kClassID, aIsRoot) {}
ScrollContainerFrame(ComputedStyle* aStyle, nsPresContext* aPresContext,
nsIFrame::ClassID aID, bool aIsRoot);
~ScrollContainerFrame();
void SetSuppressScrollbarUpdate(bool aSuppress) {
mSuppressScrollbarUpdate = aSuppress;
}
@ -602,9 +610,9 @@ class nsHTMLScrollFrame : public nsContainerFrame,
bool IsProcessingScrollEvent() const { return mProcessingScrollEvent; }
public:
static void AsyncScrollCallback(nsHTMLScrollFrame* aInstance,
static void AsyncScrollCallback(ScrollContainerFrame* aInstance,
mozilla::TimeStamp aTime);
static void AsyncSmoothMSDScrollCallback(nsHTMLScrollFrame* aInstance,
static void AsyncSmoothMSDScrollCallback(ScrollContainerFrame* aInstance,
mozilla::TimeDuration aDeltaTime);
/**
* @note This method might destroy the frame, pres shell and other objects.
@ -664,8 +672,8 @@ class nsHTMLScrollFrame : public nsContainerFrame,
* behavior.
*
* Currently it allows scrolling down and to the right for
* nsHTMLScrollFrames with LTR directionality, and allows scrolling down and
* to the left for nsHTMLScrollFrames with RTL directionality.
* ScrollContainerFrames with LTR directionality, and allows scrolling down
* and to the left for ScrollContainerFrames with RTL directionality.
*/
nsRect GetUnsnappedScrolledRectInternal(const nsRect& aScrolledOverflowArea,
const nsSize& aScrollPortSize) const;
@ -995,7 +1003,7 @@ class nsHTMLScrollFrame : public nsContainerFrame,
friend class AutoScrollbarRepaintSuppression;
class AutoScrollbarRepaintSuppression {
public:
AutoScrollbarRepaintSuppression(nsHTMLScrollFrame* aFrame,
AutoScrollbarRepaintSuppression(ScrollContainerFrame* aFrame,
AutoWeakFrame& aWeakOuter, bool aSuppress)
: mFrame(aFrame),
mWeakOuter(aWeakOuter),
@ -1010,7 +1018,7 @@ class nsHTMLScrollFrame : public nsContainerFrame,
}
private:
nsHTMLScrollFrame* mFrame;
ScrollContainerFrame* mFrame;
AutoWeakFrame& mWeakOuter;
bool mOldSuppressValue;
};
@ -1091,6 +1099,8 @@ class nsHTMLScrollFrame : public nsContainerFrame,
mozilla::UniquePtr<ScrollSnapTargetIds> mLastSnapTargetIds;
};
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(nsHTMLScrollFrame::OverflowState)
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(ScrollContainerFrame::OverflowState)
} // namespace mozilla
#endif /* mozilla_ScrollContainerFrame_h_ */

View File

@ -3695,7 +3695,7 @@ static Subgrid* SubgridComputeMarginBorderPadding(
bool scroller = false;
nsIFrame* outerFrame = [&]() -> nsIFrame* {
if (nsHTMLScrollFrame* scrollFrame =
if (ScrollContainerFrame* scrollFrame =
do_QueryFrame(aGridItem.mFrame->GetScrollTargetFrame())) {
scroller = true;
return scrollFrame;
@ -3720,7 +3720,7 @@ static Subgrid* SubgridComputeMarginBorderPadding(
subgrid->mMarginBorderPadding += szOuterFrame.ComputedLogicalMargin(cbWM) +
szOuterFrame.ComputedLogicalBorder(cbWM);
if (scroller) {
nsMargin ssz = static_cast<nsHTMLScrollFrame*>(outerFrame)
nsMargin ssz = static_cast<ScrollContainerFrame*>(outerFrame)
->IntrinsicScrollbarGutterSize();
subgrid->mMarginBorderPadding += LogicalMargin(cbWM, ssz);
} else {

View File

@ -3219,8 +3219,8 @@ void nsIFrame::BuildDisplayListForStackingContext(
AutoSaveRestoreContainsBlendMode autoRestoreBlendMode(*aBuilder);
aBuilder->SetContainsBlendMode(false);
// NOTE: When changing this condition make sure to tweak nsGfxScrollFrame as
// well.
// NOTE: When changing this condition make sure to tweak ScrollContainerFrame
// as well.
bool usingBackdropFilter = effects->HasBackdropFilters() &&
IsVisibleForPainting() &&
!style.IsRootElementStyle();
@ -11579,7 +11579,7 @@ nsIFrame::PhysicalAxes nsIFrame::ShouldApplyOverflowClipping(
}
// clip overflow:clip, except for nsListControlFrame which is
// an nsHTMLScrollFrame sub-class.
// a ScrollContainerFrame sub-class.
if (MOZ_UNLIKELY((aDisp->mOverflowX == mozilla::StyleOverflow::Clip ||
aDisp->mOverflowY == mozilla::StyleOverflow::Clip) &&
!IsListControlFrame())) {

View File

@ -991,7 +991,7 @@ class nsIFrame : public nsQueryFrame {
* from the parent.
* (@see nsIFrame::Init)
* * a scrolled frame propagates its value to its ancestor scroll frame
* (@see nsHTMLScrollFrame::ReloadChildFrames)
* (@see ScrollContainerFrame::ReloadChildFrames)
*/
mozilla::WritingMode GetWritingMode() const { return mWritingMode; }

View File

@ -152,8 +152,8 @@ class nsIScrollableFrame : public nsIScrollbarMediator {
* reflowed with the scroll port size given in mScrollPort.
*
* Currently it allows scrolling down and to the right for
* nsHTMLScrollFrames with LTR directionality, and allows scrolling down and
* to the left for nsHTMLScrollFrames with RTL directionality.
* ScrollContainerFrames with LTR directionality, and allows scrolling down
* and to the left for ScrollContainerFrames with RTL directionality.
*/
virtual nsRect GetScrolledRect() const = 0;
/**

View File

@ -2332,7 +2332,7 @@ nsChangeHint nsStyleDisplay::CalcDifference(
} else if (isScrollable) {
if (ScrollbarGenerationChanged(*this, aNewData)) {
// We might need to reframe in the case of hidden -> non-hidden case
// though, since nsHTMLScrollFrame::CreateAnonymousContent avoids
// though, since ScrollContainerFrame::CreateAnonymousContent avoids
// creating scrollbars altogether for overflow: hidden. That seems it
// could create some interesting perf cliffs...
hint |= nsChangeHint_ScrollbarChange;

View File

@ -47,7 +47,7 @@ class nsIScrollbarMediator : public nsQueryFrame {
mozilla::ScrollSnapFlags aSnapFlags =
mozilla::ScrollSnapFlags::Disabled) = 0;
// Only implemented for nsGfxScrollFrame, not nsTreeBodyFrame.
// Only implemented for ScrollContainerFrame, not nsTreeBodyFrame.
virtual void ScrollByUnit(nsScrollbarFrame* aScrollbar,
mozilla::ScrollMode aMode, int32_t aDirection,
mozilla::ScrollUnit aUnit,
@ -65,7 +65,7 @@ class nsIScrollbarMediator : public nsQueryFrame {
* aOldPos and aNewPos are scroll positions.
* The scroll positions start with zero at the left edge; implementors that
* want zero at the right edge for RTL content will need to adjust
* accordingly. (See nsHTMLScrollFrame::ThumbMoved in
* accordingly. (See ScrollContainerFrame::ThumbMoved in
* ScrollContainerFrame.cpp.)
* @note This method might destroy the frame, pres shell, and other objects.
*/

View File

@ -160,7 +160,7 @@ nsresult nsScrollbarFrame::AttributeChanged(int32_t aNameSpaceID,
// Update value in our children
UpdateChildrenAttributeValue(aAttribute, true);
// if the current position changes, notify any nsGfxScrollFrame
// if the current position changes, notify any ScrollContainerFrame
// parent we may have
if (aAttribute != nsGkAtoms::curpos) {
return rv;

View File

@ -37,7 +37,7 @@ called with a smart pointer like nsRefPtr or nsCOMPtr.
>
(lldb) ft this
Viewport(-1)@0x116017430 [view=0x115efe190] {0,0,60,60} [state=000b063000002623] [sc=0x1160170f8:-moz-viewport]<
HTMLScroll(html)(-1)@0x1160180d0 {0,0,0,0} [state=000b020000000403] [content=0x115e4d640] [sc=0x116017768:-moz-viewport-scroll]<
ScrollContainer(html)(-1)@0x1160180d0 {0,0,0,0} [state=000b020000000403] [content=0x115e4d640] [sc=0x116017768:-moz-viewport-scroll]<
...
Canvas(html)(-1)@0x116017e08 {0,0,60,60} ink-overflow=0,0,8340,2196 scr-overflow=0,0,8220,2196 [state=000b002000000601] [content=0x115e4d640] [sc=0x11687e0f8:-moz-scrolled-canvas]<
Block(html)(-1)@0x11687e578 {0,0,60,2196} ink-overflow=0,0,8340,2196 scr-overflow=0,0,8220,2196 [state=000b100000d00601] [content=0x115e4d640] [sc=0x11687e4b8,parent=0x0]<
@ -45,7 +45,7 @@ called with a smart pointer like nsRefPtr or nsCOMPtr.
Block(body)(1)@0x11687ebb0 {480,480,0,1236} ink-overflow=-120,-54,7980,1410 scr-overflow=0,0,7740,1236 [state=000b120000100601] [content=0x115ed8980] [sc=0x11687e990]<
line 0x116899170: count=1 state=inline,clean,prevmarginclean,not impacted,not wrapped,before:nobr,after:nobr[0x0] {0,0,7740,1236} ink-overflow=-120,-54,7980,1410 scr-overflow=0,0,7740,1236 <
nsTextControlFrame@0x11687f068 {0,66,7740,1170} ink-overflow=-120,-120,7980,1410 scr-overflow=0,0,7740,1170 [state=0002000000004621] [content=0x115ca2c50] [sc=0x11687ea40]<
HTMLScroll(div)(-1)@0x11687f6b0 {180,240,7380,690} [state=0002000000084409] [content=0x11688c0c0] [sc=0x11687eb00]<
ScrollContainer(div)(-1)@0x11687f6b0 {180,240,7380,690} [state=0002000000084409] [content=0x11688c0c0] [sc=0x11687eb00]<
Block(div)(-1)@0x11687fcb8 {0,0,7380,690} [state=0002100000d04601] [content=0x11688c0c0] [sc=0x11687f990:-moz-scrolled-content]<
line 0x116899130: count=1 state=inline,clean,prevmarginclean,not impacted,not wrapped,before:nobr,after:nobr[0x100] {60,0,0,690} ink-overflow=60,510,0,0 scr-overflow=60,510,0,0 <
Text(0)""@0x1168990c0 {60,510,0,0} [state=0001000020404000] [content=0x11687ca10] [sc=0x11687fd88:-moz-non-element,parent=0x11687eb00] [run=0x115115e80][0,0,T]

View File

@ -4445,8 +4445,8 @@ pub extern "C" fn Servo_ComputedValues_EqualForCachedAnonymousContentStyle(
//
// If you do need a pref-controlled, inherited property to have an effect on these elements,
// then you will need to add some checks to the
// nsIAnonymousContentCreator::CreateAnonymousContent implementations of nsHTMLScrollFrame and
// nsScrollbarFrame to clear the AnonymousContentKey if a non-initial value is used.
// nsIAnonymousContentCreator::CreateAnonymousContent implementations of ScrollContainerFrame
// and nsScrollbarFrame to clear the AnonymousContentKey if a non-initial value is used.
differing_properties.remove_all(&LonghandIdSet::has_no_effect_on_gecko_scrollbars());
if !differing_properties.is_empty() {