tor-browser

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

commit 764938320efc67b5e82ad34dff5334f68a6fc308
parent 33f4884e6b60eadba6212fcf24cfdd9a13282f1b
Author: Emilio Cobos Álvarez <emilio@crisal.io>
Date:   Thu,  9 Oct 2025 11:19:49 +0000

Bug 1993353 - Remove NS_FRAME_HAS_VIEW. r=tnikkel,layout-reviewers

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

Diffstat:
Mlayout/base/PresShell.cpp | 6+++---
Mlayout/base/nsCSSFrameConstructor.cpp | 3+--
Mlayout/base/nsLayoutUtils.cpp | 7+------
Mlayout/generic/FrameClasses.py | 7++++---
Mlayout/generic/nsBlockFrame.cpp | 10+++++-----
Mlayout/generic/nsContainerFrame.cpp | 56++++++++++++++++++++++++--------------------------------
Mlayout/generic/nsContainerFrame.h | 2+-
Mlayout/generic/nsFrameStateBits.h | 3---
Mlayout/generic/nsIFrame.cpp | 70+++++++++++++++++++++++++---------------------------------------------
Mlayout/generic/nsIFrame.h | 16++++++----------
Mlayout/generic/nsLineLayout.cpp | 9++++-----
Mlayout/generic/nsSubDocumentFrame.cpp | 2+-
Mlayout/style/RestyleManager.cpp | 2+-
Mlayout/tables/nsTableCellFrame.cpp | 5-----
Mlayout/tables/nsTableRowFrame.cpp | 5-----
Mlayout/xul/nsMenuPopupFrame.cpp | 4++--
16 files changed, 78 insertions(+), 129 deletions(-)

diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp @@ -10885,9 +10885,9 @@ bool PresShell::DoReflow(nsIFrame* target, bool aInterruptible, // because for root frames (where they could be different, since root frames // are allowed to have overflow) the root view bounds need to match the // viewport bounds; the view manager "window dimensions" code depends on it. - if (target->HasView()) { - nsContainerFrame::SyncFrameViewAfterReflow( - mPresContext, target, target->GetView(), boundsRelativeToTarget); + if (auto* view = target->GetView()) { + nsContainerFrame::SyncFrameViewAfterReflow(mPresContext, target, view, + boundsRelativeToTarget); } target->DidReflow(mPresContext, nullptr); diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp @@ -1344,8 +1344,7 @@ static void MoveChildrenTo(nsIFrame* aOldParent, nsContainerFrame* aNewParent, nsFrameList& aFrameList) { #ifdef DEBUG bool sameGrandParent = aOldParent->GetParent() == aNewParent->GetParent(); - - if (aNewParent->HasView() || aOldParent->HasView() || !sameGrandParent) { + if (aNewParent->GetView() || aOldParent->GetView() || !sameGrandParent) { // Move the frames into the new view nsContainerFrame::ReparentFrameViewList(aFrameList, aOldParent, aNewParent); } diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp @@ -1602,7 +1602,7 @@ nsIFrame* nsLayoutUtils::GetPopupFrameForPoint( continue; } if (aFlags & GetPopupFrameForPointFlags::OnlyReturnFramesWithWidgets) { - if (!popup->HasView() || !popup->GetView()->HasWidget()) { + if (!popup->GetView() || !popup->GetView()->HasWidget()) { continue; } } @@ -6729,11 +6729,6 @@ widget::TransparencyMode nsLayoutUtils::GetFrameTransparency( /* static */ bool nsLayoutUtils::IsPopup(const nsIFrame* aFrame) { - // Optimization: the frame can't possibly be a popup if it has no view. - if (!aFrame->HasView()) { - NS_ASSERTION(!aFrame->IsMenuPopupFrame(), "popup frame must have a view"); - return false; - } return aFrame->IsMenuPopupFrame(); } diff --git a/layout/generic/FrameClasses.py b/layout/generic/FrameClasses.py @@ -16,6 +16,7 @@ MATHML = {"MathML"} SVG = {"SVG"} BFC = {"BlockFormattingContext"} LINE_PARTICIPANT = {"LineParticipant"} +MAY_HAVE_VIEW = {"MayHaveView"} BLOCK = COMMON | {"CanContainOverflowContainers"} @@ -94,7 +95,7 @@ FRAME_CLASSES = [ Frame("nsMathMLmtrFrame", "TableRow", TABLE_PART | MATHML), Frame("nsMathMLmunderoverFrame", "None", MATHML_CONTAINER), Frame("nsMathMLTokenFrame", "None", MATHML_CONTAINER), - Frame("nsMenuPopupFrame", "MenuPopup", BLOCK), + Frame("nsMenuPopupFrame", "MenuPopup", BLOCK | MAY_HAVE_VIEW), Frame("nsNumberControlFrame", "TextInput", REPLACED | LEAF), Frame("nsPageBreakFrame", "PageBreak", COMMON | LEAF), Frame("nsPageContentFrame", "PageContent", BLOCK), @@ -116,7 +117,7 @@ FRAME_CLASSES = [ Frame("nsPageSequenceFrame", "PageSequence", COMMON), Frame("nsSliderFrame", "Slider", COMMON), Frame("nsSplitterFrame", "SimpleXULLeaf", COMMON | LEAF), - Frame("nsSubDocumentFrame", "SubDocument", REPLACED_SIZING | LEAF), + Frame("nsSubDocumentFrame", "SubDocument", REPLACED_SIZING | LEAF | MAY_HAVE_VIEW), Frame("PrintedSheetFrame", "PrintedSheet", COMMON), Frame("SVGAFrame", "SVGA", SVG_CONTAINER), Frame("SVGClipPathFrame", "SVGClipPath", SVG_RENDERING_OBSERVER_CONTAINER), @@ -171,7 +172,7 @@ FRAME_CLASSES = [ Frame("nsTreeBodyFrame", "SimpleXULLeaf", COMMON | LEAF), Frame("nsVideoFrame", "HTMLVideo", REPLACED_SIZING), Frame("nsAudioFrame", "HTMLVideo", REPLACED_SIZING - {"SupportsAspectRatio"}), - Frame("ViewportFrame", "Viewport", COMMON), + Frame("ViewportFrame", "Viewport", COMMON | MAY_HAVE_VIEW), Frame("WBRFrame", "Wbr", COMMON | LEAF), # Non-concrete classes (for FrameIID use) AbstractFrame("ButtonControlFrame"), diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp @@ -4874,7 +4874,7 @@ void nsBlockFrame::ReflowBlockFrame(BlockReflowState& aState, // views it may have. Note that the case when frame has a view got handled // by FinishReflowChild, but that function didn't have the coordinates needed // to correctly decide whether to reposition child views. - if (originalPosition != frame->GetPosition() && !frame->HasView()) { + if (originalPosition != frame->GetPosition() && !frame->GetView()) { nsContainerFrame::PositionChildViews(frame); } @@ -7581,10 +7581,10 @@ void nsBlockFrame::ReflowFloat(BlockReflowState& aState, ReflowInput& aFloatRI, // of |PlaceFrameView| here? WritingMode metricsWM = metrics.GetWritingMode(); aFloat->SetSize(metricsWM, metrics.Size(metricsWM)); - if (aFloat->HasView()) { - nsContainerFrame::SyncFrameViewAfterReflow( - aState.mPresContext, aFloat, aFloat->GetView(), metrics.InkOverflow(), - ReflowChildFlags::NoMoveView); + if (auto* view = aFloat->GetView()) { + nsContainerFrame::SyncFrameViewAfterReflow(aState.mPresContext, aFloat, + view, metrics.InkOverflow(), + ReflowChildFlags::NoMoveView); } aFloat->DidReflow(aState.mPresContext, &aFloatRI); } diff --git a/layout/generic/nsContainerFrame.cpp b/layout/generic/nsContainerFrame.cpp @@ -225,8 +225,8 @@ void nsContainerFrame::SafelyDestroyFrameListProp( void nsContainerFrame::Destroy(DestroyContext& aContext) { // Prevent event dispatch during destruction. - if (HasView()) { - GetView()->SetFrame(nullptr); + if (auto* view = GetView()) { + view->SetFrame(nullptr); } DestroyAbsoluteFrames(aContext); @@ -565,12 +565,18 @@ nsIFrame::FrameSearchResult nsContainerFrame::PeekOffsetCharacter( * but before |Reflow|. */ void nsContainerFrame::PositionFrameView(nsIFrame* aKidFrame) { + if (MOZ_LIKELY(!aKidFrame->MayHaveView())) { + return; + } nsIFrame* parentFrame = aKidFrame->GetParent(); - if (!aKidFrame->HasView() || !parentFrame) { + if (!parentFrame) { + return; + } + auto* view = aKidFrame->GetView(); + if (!view) { return; } - nsView* view = aKidFrame->GetView(); nsViewManager* vm = view->GetViewManager(); nsPoint pt; nsView* ancestorView = parentFrame->GetClosestView(&pt); @@ -598,7 +604,7 @@ void nsContainerFrame::ReparentFrameView(nsIFrame* aChildFrame, "same old and new parent frame"); // See if either the old parent frame or the new parent frame have a view - while (!aOldParentFrame->HasView() && !aNewParentFrame->HasView()) { + while (!aOldParentFrame->GetView() && !aNewParentFrame->GetView()) { // Walk up both the old parent frame and the new parent frame nodes // stopping when we either find a common parent or views for one // or both of the frames. @@ -656,7 +662,7 @@ void nsContainerFrame::ReparentFrameViewList(const nsFrameList& aChildFrameList, "same old and new parent frame"); // See if either the old parent frame or the new parent frame have a view - while (!aOldParentFrame->HasView() && !aNewParentFrame->HasView()) { + while (!aOldParentFrame->GetView() && !aNewParentFrame->GetView()) { // Walk up both the old parent frame and the new parent frame nodes // stopping when we either find a common parent or views for one // or both of the frames. @@ -983,11 +989,7 @@ void nsContainerFrame::PositionChildViews(nsIFrame* aFrame) { for (nsIFrame* childFrame : list) { // Position the frame's view (if it has one) otherwise recursively // process its children - if (childFrame->HasView()) { - PositionFrameView(childFrame); - } else { - PositionChildViews(childFrame); - } + PlaceFrameView(childFrame); } } } @@ -1030,21 +1032,16 @@ void nsContainerFrame::FinishReflowChild( aKidFrame->SetSize(aWM, convertedSize); } - if (aKidFrame->HasView()) { - nsView* view = aKidFrame->GetView(); + if (nsView* view = aKidFrame->GetView()) { // Make sure the frame's view is properly sized and positioned and has // things like opacity correct SyncFrameViewAfterReflow(aPresContext, aKidFrame, view, aDesiredSize.InkOverflow(), aFlags); - } - - nsPoint newOrigin = aKidFrame->GetPosition(); - if (!(aFlags & ReflowChildFlags::NoMoveView) && curOrigin != newOrigin) { - if (!aKidFrame->HasView()) { - // If the frame has moved, then we need to make sure any child views are - // correctly positioned - PositionChildViews(aKidFrame); - } + } else if (!(aFlags & ReflowChildFlags::NoMoveView) && + curOrigin != aKidFrame->GetPosition()) { + // If the frame has moved, then we need to make sure any child views are + // correctly positioned + PositionChildViews(aKidFrame); } aKidFrame->DidReflow(aPresContext, aReflowInput); @@ -1076,20 +1073,15 @@ void nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame, aKidFrame->SetSize(size); } - if (aKidFrame->HasView()) { - nsView* view = aKidFrame->GetView(); + if (nsView* view = aKidFrame->GetView()) { // Make sure the frame's view is properly sized and positioned and has // things like opacity correct SyncFrameViewAfterReflow(aPresContext, aKidFrame, view, aDesiredSize.InkOverflow(), aFlags); - } - - if (!(aFlags & ReflowChildFlags::NoMoveView) && curOrigin != pos) { - if (!aKidFrame->HasView()) { - // If the frame has moved, then we need to make sure any child views are - // correctly positioned - PositionChildViews(aKidFrame); - } + } else if (!(aFlags & ReflowChildFlags::NoMoveView) && curOrigin != pos) { + // If the frame has moved, then we need to make sure any child views are + // correctly positioned + PositionChildViews(aKidFrame); } aKidFrame->DidReflow(aPresContext, aReflowInput); diff --git a/layout/generic/nsContainerFrame.h b/layout/generic/nsContainerFrame.h @@ -448,7 +448,7 @@ class nsContainerFrame : public nsSplittableFrame { const nsDisplayListSet& aLists) override; static void PlaceFrameView(nsIFrame* aFrame) { - if (aFrame->HasView()) { + if (aFrame->GetView()) { nsContainerFrame::PositionFrameView(aFrame); } else { nsContainerFrame::PositionChildViews(aFrame); diff --git a/layout/generic/nsFrameStateBits.h b/layout/generic/nsFrameStateBits.h @@ -144,9 +144,6 @@ FRAME_STATE_BIT(Generic, 11, NS_FRAME_TOO_DEEP_IN_FRAME_TREE) // PresShell::FrameNeedsReflow. Pass the right arguments instead. FRAME_STATE_BIT(Generic, 12, NS_FRAME_HAS_DIRTY_CHILDREN) -// If this bit is set, the frame has an associated view -FRAME_STATE_BIT(Generic, 13, NS_FRAME_HAS_VIEW) - // If this bit is set, the frame was created from anonymous content. FRAME_STATE_BIT(Generic, 14, NS_FRAME_INDEPENDENT_SELECTION) diff --git a/layout/generic/nsIFrame.cpp b/layout/generic/nsIFrame.cpp @@ -1519,12 +1519,11 @@ void nsIFrame::AssertNewStyleIsSane(ComputedStyle& aNewStyle) { void nsIFrame::ReparentFrameViewTo(nsViewManager* aViewManager, nsView* aNewParentView) { - if (HasView()) { + if (auto* view = GetView()) { if (IsMenuPopupFrame()) { // This view must be parented by the root view, don't reparent it. return; } - nsView* view = GetView(); aViewManager->RemoveChild(view); // The view will remember the Z-order and other attributes that have been @@ -7792,22 +7791,12 @@ nsIFrame* nsIFrame::GetTailContinuation() { // Associated view object void nsIFrame::SetView(nsView* aView) { if (aView) { + MOZ_ASSERT(MayHaveView(), "Only specific frame types can have an nsView"); aView->SetFrame(this); -#ifdef DEBUG - LayoutFrameType frameType = Type(); - NS_ASSERTION(frameType == LayoutFrameType::SubDocument || - frameType == LayoutFrameType::Viewport || - frameType == LayoutFrameType::MenuPopup, - "Only specific frame types can have an nsView"); -#endif - // Store the view on the frame. SetViewInternal(aView); - // Set the frame state bit that says the frame has a view - AddStateBits(NS_FRAME_HAS_VIEW); - // Let all of the ancestors know they have a descendant with a view. for (nsIFrame* f = GetParent(); f && !f->HasAnyStateBits(NS_FRAME_HAS_CHILD_WITH_VIEW); @@ -7816,7 +7805,6 @@ void nsIFrame::SetView(nsView* aView) { } } else { MOZ_ASSERT_UNREACHABLE("Destroying a view while the frame is alive?"); - RemoveStateBits(NS_FRAME_HAS_VIEW); SetViewInternal(nullptr); } } @@ -7947,18 +7935,21 @@ nsRect nsIFrame::GetScreenRectInAppUnits() const { // Returns the offset from this frame to the closest geometric parent that // has a view. Also returns the containing view or null in case of error void nsIFrame::GetOffsetFromView(nsPoint& aOffset, nsView** aView) const { - MOZ_ASSERT(nullptr != aView, "null OUT parameter pointer"); + MOZ_ASSERT(aView, "null OUT parameter pointer"); nsIFrame* frame = const_cast<nsIFrame*>(this); *aView = nullptr; aOffset.MoveTo(0, 0); - do { + while (true) { aOffset += frame->GetPosition(); frame = frame->GetParent(); - } while (frame && !frame->HasView()); - - if (frame) { - *aView = frame->GetView(); + if (!frame) { + break; + } + if (auto* view = frame->GetView()) { + *aView = view; + break; + } } } @@ -8823,9 +8814,9 @@ void nsIFrame::ListGeneric(nsACString& aTo, const char* aPrefix, const bool onlyDeterministic = aFlags.contains(ListFlag::OnlyListDeterministicInfo); aTo += ListTag(onlyDeterministic); - if (HasView()) { + if (auto* view = GetView()) { aTo += " [view"; - ListPtr(aTo, aFlags, GetView()); + ListPtr(aTo, aFlags, view); aTo += "]"; } if (!onlyDeterministic) { @@ -9433,7 +9424,7 @@ static nsresult GetNextPrevLineFromBlockFrame(PeekOffsetStruct* aPos, point.x = aPos->mDesiredCaretPos.x; } - if (!resultFrame->HasView()) { + if (!resultFrame->GetView()) { nsView* view; nsPoint offset; resultFrame->GetOffsetFromView(offset, &view); @@ -10543,11 +10534,11 @@ nsIFrame::SelectablePeekReport nsIFrame::GetFrameFromDirection( nsView* nsIFrame::GetClosestView(nsPoint* aOffset) const { nsPoint offset(0, 0); for (const nsIFrame* f = this; f; f = f->GetParent()) { - if (f->HasView()) { + if (auto* view = f->GetView()) { if (aOffset) { *aOffset = offset; } - return f->GetView(); + return view; } offset += f->GetPosition(); } @@ -11766,30 +11757,19 @@ void nsIFrame::SetParent(nsContainerFrame* aParent) { mParent = aParent; MOZ_ASSERT(!mParent || PresShell() == mParent->PresShell()); - if (HasAnyStateBits(NS_FRAME_HAS_VIEW | NS_FRAME_HAS_CHILD_WITH_VIEW)) { - for (nsIFrame* f = aParent; - f && !f->HasAnyStateBits(NS_FRAME_HAS_CHILD_WITH_VIEW); - f = f->GetParent()) { - f->AddStateBits(NS_FRAME_HAS_CHILD_WITH_VIEW); - } + nsFrameState flagsToPropagateSameDoc = + GetStateBits() & + (NS_FRAME_HAS_CHILD_WITH_VIEW | NS_FRAME_CONTAINS_RELATIVE_BSIZE | + NS_FRAME_DESCENDANT_INTRINSIC_ISIZE_DEPENDS_ON_BSIZE); + if (GetView()) { + flagsToPropagateSameDoc |= NS_FRAME_HAS_CHILD_WITH_VIEW; } - - if (HasAnyStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE)) { - for (nsIFrame* f = aParent; f; f = f->GetParent()) { - if (f->HasAnyStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE)) { - break; - } - f->AddStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE); - } - } - - if (HasAnyStateBits(NS_FRAME_DESCENDANT_INTRINSIC_ISIZE_DEPENDS_ON_BSIZE)) { + if (flagsToPropagateSameDoc) { for (nsIFrame* f = aParent; f; f = f->GetParent()) { - if (f->HasAnyStateBits( - NS_FRAME_DESCENDANT_INTRINSIC_ISIZE_DEPENDS_ON_BSIZE)) { + if (f->HasAllStateBits(flagsToPropagateSameDoc)) { break; } - f->AddStateBits(NS_FRAME_DESCENDANT_INTRINSIC_ISIZE_DEPENDS_ON_BSIZE); + f->AddStateBits(flagsToPropagateSameDoc); } } diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h @@ -630,7 +630,7 @@ struct MOZ_RAII FrameDestroyContext { /** * Bit-flags specific to a given layout class id. */ -enum class LayoutFrameClassFlags : uint16_t { +enum class LayoutFrameClassFlags : uint32_t { None = 0, Leaf = 1 << 0, LeafDynamic = 1 << 1, @@ -663,6 +663,8 @@ enum class LayoutFrameClassFlags : uint16_t { BlockFormattingContext = 1 << 14, // Whether we're a SVG rendering observer container. SVGRenderingObserverContainer = 1 << 15, + // Whether this frame type may store an nsView + MayHaveView = 1 << 16, }; MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(LayoutFrameClassFlags) @@ -3302,11 +3304,6 @@ class nsIFrame : public nsQueryFrame { return false; } - // - // Accessor functions to an associated view object: - // - bool HasView() const { return !!(mState & NS_FRAME_HAS_VIEW); } - template <typename SizeOrMaxSize> static inline bool IsIntrinsicKeyword(const SizeOrMaxSize& aSize) { // All keywords other than auto/none/-moz-available depend on intrinsic @@ -3334,12 +3331,10 @@ class nsIFrame : public nsQueryFrame { public: nsView* GetView() const { - if (MOZ_LIKELY(!HasView())) { + if (MOZ_LIKELY(!MayHaveView())) { return nullptr; } - nsView* view = GetViewInternal(); - MOZ_ASSERT(view, "GetViewInternal() should agree with HasView()"); - return view; + return GetViewInternal(); } void SetView(nsView* aView); @@ -3594,6 +3589,7 @@ class nsIFrame : public nsQueryFrame { CLASS_FLAG_METHOD(IsBidiInlineContainer, BidiInlineContainer); CLASS_FLAG_METHOD(IsLineParticipant, LineParticipant); CLASS_FLAG_METHOD(HasReplacedSizing, ReplacedSizing); + CLASS_FLAG_METHOD(MayHaveView, MayHaveView); CLASS_FLAG_METHOD(IsTablePart, TablePart); CLASS_FLAG_METHOD0(CanContainOverflowContainers) CLASS_FLAG_METHOD0(SupportsCSSTransforms); diff --git a/layout/generic/nsLineLayout.cpp b/layout/generic/nsLineLayout.cpp @@ -3429,10 +3429,9 @@ void nsLineLayout::RelativePositionFrames(PerSpanData* psd, // We must position the view correctly before positioning its // descendants so that widgets are positioned properly (since only // some views have widgets). - if (frame->HasView()) { + if (auto* view = frame->GetView()) { nsContainerFrame::SyncFrameViewAfterReflow( - mPresContext, frame, frame->GetView(), - pfd->mOverflowAreas.InkOverflow(), + mPresContext, frame, view, pfd->mOverflowAreas.InkOverflow(), nsIFrame::ReflowChildFlags::NoSizeView); } @@ -3478,9 +3477,9 @@ void nsLineLayout::RelativePositionFrames(PerSpanData* psd, // Do this here (rather than along with setting the overflow rect // below) so we get leaf frames as well. No need to worry // about the root span, since it doesn't have a frame. - if (frame->HasView()) { + if (auto* view = frame->GetView()) { nsContainerFrame::SyncFrameViewAfterReflow( - mPresContext, frame, frame->GetView(), r.InkOverflow(), + mPresContext, frame, view, r.InkOverflow(), nsIFrame::ReflowChildFlags::NoMoveView); } diff --git a/layout/generic/nsSubDocumentFrame.cpp b/layout/generic/nsSubDocumentFrame.cpp @@ -213,7 +213,7 @@ void nsSubDocumentFrame::ShowViewer() { } void nsSubDocumentFrame::CreateView() { - MOZ_ASSERT(!HasView()); + MOZ_ASSERT(!GetView()); nsView* parentView = GetParent()->GetClosestView(); MOZ_ASSERT(parentView, "no parent with view"); diff --git a/layout/style/RestyleManager.cpp b/layout/style/RestyleManager.cpp @@ -824,7 +824,7 @@ static bool RecomputePosition(nsIFrame* aFrame) { // Don't process position changes on frames which have views or the ones which // have a view somewhere in their descendants, because the corresponding view // needs to be repositioned properly as well. - if (aFrame->HasView() || + if (aFrame->GetView() || aFrame->HasAnyStateBits(NS_FRAME_HAS_CHILD_WITH_VIEW)) { return false; } diff --git a/layout/tables/nsTableCellFrame.cpp b/layout/tables/nsTableCellFrame.cpp @@ -478,11 +478,6 @@ void nsTableCellFrame::AlignChildWithinCell( // Invalidate new overflow rect. inner->InvalidateFrameSubtree(); } - if (HasView()) { - nsContainerFrame::SyncFrameViewAfterReflow(PresContext(), this, GetView(), - reflowOutput.InkOverflow(), - ReflowChildFlags::Default); - } } bool nsTableCellFrame::ComputeCustomOverflow(OverflowAreas& aOverflowAreas) { diff --git a/layout/tables/nsTableRowFrame.cpp b/layout/tables/nsTableRowFrame.cpp @@ -380,11 +380,6 @@ void nsTableRowFrame::DidResize(ForceAlignTopForTableCell aForceAlignTop) { // to this height, it will get a special bsize reflow. } FinishAndStoreOverflow(&desiredSize); - if (HasView()) { - nsContainerFrame::SyncFrameViewAfterReflow(PresContext(), this, GetView(), - desiredSize.InkOverflow(), - ReflowChildFlags::Default); - } // Let our base class do the usual work } diff --git a/layout/xul/nsMenuPopupFrame.cpp b/layout/xul/nsMenuPopupFrame.cpp @@ -2349,12 +2349,12 @@ int8_t nsMenuPopupFrame::GetAlignmentPosition() const { * as much as possible. Until we get rid of views finally... */ void nsMenuPopupFrame::CreatePopupView() { - if (HasView()) { + if (mView) { return; } nsViewManager* viewManager = PresContext()->GetPresShell()->GetViewManager(); - NS_ASSERTION(nullptr != viewManager, "null view manager"); + NS_ASSERTION(viewManager, "null view manager"); // Create a view nsView* parentView = viewManager->GetRootView();