From f027a246982d95764345058920e4e186dfe64c84 Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Mon, 12 May 2014 17:40:29 +0000 Subject: [PATCH] Bug 1008917 - part 9,10, make DidReflow() return type 'void'. r=roc --- layout/forms/nsListControlFrame.cpp | 6 ++---- layout/forms/nsListControlFrame.h | 6 +++--- layout/generic/nsFrame.cpp | 4 +--- layout/generic/nsFrame.h | 6 +++--- layout/generic/nsIFrame.h | 6 +++--- layout/generic/nsObjectFrame.cpp | 8 +++----- layout/generic/nsObjectFrame.h | 6 +++--- layout/mathml/nsMathMLContainerFrame.h | 3 +-- layout/svg/nsSVGOuterSVGFrame.cpp | 6 ++---- layout/svg/nsSVGOuterSVGFrame.h | 6 +++--- layout/xul/nsBoxFrame.cpp | 5 ++--- layout/xul/nsBoxFrame.h | 6 +++--- 12 files changed, 29 insertions(+), 39 deletions(-) diff --git a/layout/forms/nsListControlFrame.cpp b/layout/forms/nsListControlFrame.cpp index 17809144bf7..93581c57182 100644 --- a/layout/forms/nsListControlFrame.cpp +++ b/layout/forms/nsListControlFrame.cpp @@ -1434,16 +1434,15 @@ nsListControlFrame::AboutToRollup() } } -nsresult +void nsListControlFrame::DidReflow(nsPresContext* aPresContext, const nsHTMLReflowState* aReflowState, nsDidReflowStatus aStatus) { - nsresult rv; bool wasInterrupted = !mHasPendingInterruptAtStartOfReflow && aPresContext->HasPendingInterrupt(); - rv = nsHTMLScrollFrame::DidReflow(aPresContext, aReflowState, aStatus); + nsHTMLScrollFrame::DidReflow(aPresContext, aReflowState, aStatus); if (mNeedToReset && !wasInterrupted) { mNeedToReset = false; @@ -1460,7 +1459,6 @@ nsListControlFrame::DidReflow(nsPresContext* aPresContext, } mHasPendingInterruptAtStartOfReflow = false; - return rv; } nsIAtom* diff --git a/layout/forms/nsListControlFrame.h b/layout/forms/nsListControlFrame.h index c0e64cd34f3..ced15ccda1f 100644 --- a/layout/forms/nsListControlFrame.h +++ b/layout/forms/nsListControlFrame.h @@ -77,9 +77,9 @@ public: nsIFrame* aParent, nsIFrame* aPrevInFlow) MOZ_OVERRIDE; - virtual nsresult DidReflow(nsPresContext* aPresContext, - const nsHTMLReflowState* aReflowState, - nsDidReflowStatus aStatus) MOZ_OVERRIDE; + virtual void DidReflow(nsPresContext* aPresContext, + const nsHTMLReflowState* aReflowState, + nsDidReflowStatus aStatus) MOZ_OVERRIDE; virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE; virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder, diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 35718cafb10..b8f250e5b1b 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -4282,7 +4282,7 @@ nsFrame::WillReflow(nsPresContext* aPresContext) return NS_OK; } -nsresult +void nsFrame::DidReflow(nsPresContext* aPresContext, const nsHTMLReflowState* aReflowState, nsDidReflowStatus aStatus) @@ -4308,8 +4308,6 @@ nsFrame::DidReflow(nsPresContext* aPresContext, aReflowState->mPercentHeightObserver->NotifyPercentHeight(*aReflowState); } } - - return NS_OK; } void diff --git a/layout/generic/nsFrame.h b/layout/generic/nsFrame.h index 5718ae9a688..10893299f22 100644 --- a/layout/generic/nsFrame.h +++ b/layout/generic/nsFrame.h @@ -322,9 +322,9 @@ public: nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus) MOZ_OVERRIDE; - virtual nsresult DidReflow(nsPresContext* aPresContext, - const nsHTMLReflowState* aReflowState, - nsDidReflowStatus aStatus) MOZ_OVERRIDE; + virtual void DidReflow(nsPresContext* aPresContext, + const nsHTMLReflowState* aReflowState, + nsDidReflowStatus aStatus) MOZ_OVERRIDE; /** * NOTE: aStatus is assumed to be already-initialized. The reflow statuses of diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h index be98f69acb1..e3bdea2a4ef 100644 --- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -1885,9 +1885,9 @@ public: * XXX Don't we want the semantics to dictate that we only call this once for * a given reflow? */ - virtual nsresult DidReflow(nsPresContext* aPresContext, - const nsHTMLReflowState* aReflowState, - nsDidReflowStatus aStatus) = 0; + virtual void DidReflow(nsPresContext* aPresContext, + const nsHTMLReflowState* aReflowState, + nsDidReflowStatus aStatus) = 0; // XXX Maybe these three should be a separate interface? diff --git a/layout/generic/nsObjectFrame.cpp b/layout/generic/nsObjectFrame.cpp index 6c970938e3c..9768874c165 100644 --- a/layout/generic/nsObjectFrame.cpp +++ b/layout/generic/nsObjectFrame.cpp @@ -800,7 +800,7 @@ nsIntPoint nsObjectFrame::GetWindowOriginInPixels(bool aWindowless) PresContext()->AppUnitsToDevPixels(origin.y)); } -nsresult +void nsObjectFrame::DidReflow(nsPresContext* aPresContext, const nsHTMLReflowState* aReflowState, nsDidReflowStatus aStatus) @@ -814,12 +814,12 @@ nsObjectFrame::DidReflow(nsPresContext* aPresContext, objContent->HasNewFrame(this); } - nsresult rv = nsObjectFrameSuper::DidReflow(aPresContext, aReflowState, aStatus); + nsObjectFrameSuper::DidReflow(aPresContext, aReflowState, aStatus); // The view is created hidden; once we have reflowed it and it has been // positioned then we show it. if (aStatus != nsDidReflowStatus::FINISHED) - return rv; + return; if (HasView()) { nsView* view = GetView(); @@ -827,8 +827,6 @@ nsObjectFrame::DidReflow(nsPresContext* aPresContext, if (vm) vm->SetViewVisibility(view, IsHidden() ? nsViewVisibility_kHide : nsViewVisibility_kShow); } - - return rv; } /* static */ void diff --git a/layout/generic/nsObjectFrame.h b/layout/generic/nsObjectFrame.h index 7e845be7444..7478141458e 100644 --- a/layout/generic/nsObjectFrame.h +++ b/layout/generic/nsObjectFrame.h @@ -62,9 +62,9 @@ public: nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus) MOZ_OVERRIDE; - virtual nsresult DidReflow(nsPresContext* aPresContext, - const nsHTMLReflowState* aReflowState, - nsDidReflowStatus aStatus) MOZ_OVERRIDE; + virtual void DidReflow(nsPresContext* aPresContext, + const nsHTMLReflowState* aReflowState, + nsDidReflowStatus aStatus) MOZ_OVERRIDE; virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder, const nsRect& aDirtyRect, const nsDisplayListSet& aLists) MOZ_OVERRIDE; diff --git a/layout/mathml/nsMathMLContainerFrame.h b/layout/mathml/nsMathMLContainerFrame.h index c99d56178a8..6f270f25f5b 100644 --- a/layout/mathml/nsMathMLContainerFrame.h +++ b/layout/mathml/nsMathMLContainerFrame.h @@ -119,8 +119,7 @@ public: return nsContainerFrame::WillReflow(aPresContext); } - virtual nsresult - DidReflow(nsPresContext* aPresContext, + virtual void DidReflow(nsPresContext* aPresContext, const nsHTMLReflowState* aReflowState, nsDidReflowStatus aStatus) MOZ_OVERRIDE diff --git a/layout/svg/nsSVGOuterSVGFrame.cpp b/layout/svg/nsSVGOuterSVGFrame.cpp index 9f921bec2ef..313c8344ae4 100644 --- a/layout/svg/nsSVGOuterSVGFrame.cpp +++ b/layout/svg/nsSVGOuterSVGFrame.cpp @@ -451,18 +451,16 @@ nsSVGOuterSVGFrame::Reflow(nsPresContext* aPresContext, NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize); } -nsresult +void nsSVGOuterSVGFrame::DidReflow(nsPresContext* aPresContext, const nsHTMLReflowState* aReflowState, nsDidReflowStatus aStatus) { - nsresult rv = nsSVGOuterSVGFrameBase::DidReflow(aPresContext,aReflowState,aStatus); + nsSVGOuterSVGFrameBase::DidReflow(aPresContext,aReflowState,aStatus); // Make sure elements styled by :hover get updated if script/animation moves // them under or out from under the pointer: PresContext()->PresShell()->SynthesizeMouseMove(false); - - return rv; } /* virtual */ bool diff --git a/layout/svg/nsSVGOuterSVGFrame.h b/layout/svg/nsSVGOuterSVGFrame.h index 7267bab9697..3f24f077230 100644 --- a/layout/svg/nsSVGOuterSVGFrame.h +++ b/layout/svg/nsSVGOuterSVGFrame.h @@ -54,9 +54,9 @@ public: const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus) MOZ_OVERRIDE; - virtual nsresult DidReflow(nsPresContext* aPresContext, - const nsHTMLReflowState* aReflowState, - nsDidReflowStatus aStatus) MOZ_OVERRIDE; + virtual void DidReflow(nsPresContext* aPresContext, + const nsHTMLReflowState* aReflowState, + nsDidReflowStatus aStatus) MOZ_OVERRIDE; virtual bool UpdateOverflow() MOZ_OVERRIDE; diff --git a/layout/xul/nsBoxFrame.cpp b/layout/xul/nsBoxFrame.cpp index 827081e7807..3498c63e06c 100644 --- a/layout/xul/nsBoxFrame.cpp +++ b/layout/xul/nsBoxFrame.cpp @@ -550,16 +550,15 @@ nsBoxFrame::GetInitialAutoStretch(bool& aStretch) return true; } -nsresult +void nsBoxFrame::DidReflow(nsPresContext* aPresContext, const nsHTMLReflowState* aReflowState, nsDidReflowStatus aStatus) { nsFrameState preserveBits = mState & (NS_FRAME_IS_DIRTY | NS_FRAME_HAS_DIRTY_CHILDREN); - nsresult rv = nsFrame::DidReflow(aPresContext, aReflowState, aStatus); + nsFrame::DidReflow(aPresContext, aReflowState, aStatus); mState |= preserveBits; - return rv; } bool diff --git a/layout/xul/nsBoxFrame.h b/layout/xul/nsBoxFrame.h index acb2c3275ee..560d48e7a3a 100644 --- a/layout/xul/nsBoxFrame.h +++ b/layout/xul/nsBoxFrame.h @@ -129,9 +129,9 @@ public: virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE; #endif - virtual nsresult DidReflow(nsPresContext* aPresContext, - const nsHTMLReflowState* aReflowState, - nsDidReflowStatus aStatus) MOZ_OVERRIDE; + virtual void DidReflow(nsPresContext* aPresContext, + const nsHTMLReflowState* aReflowState, + nsDidReflowStatus aStatus) MOZ_OVERRIDE; virtual bool HonorPrintBackgroundSettings() MOZ_OVERRIDE;