diff --git a/layout/forms/nsComboboxControlFrame.cpp b/layout/forms/nsComboboxControlFrame.cpp index c91de9b4aa5f..7ecbead67734 100644 --- a/layout/forms/nsComboboxControlFrame.cpp +++ b/layout/forms/nsComboboxControlFrame.cpp @@ -398,7 +398,7 @@ public: nsWeakFrame mFrame; }; -nsresult +void nsComboboxControlFrame::ReflowDropdown(nsPresContext* aPresContext, const nsHTMLReflowState& aReflowState) { @@ -407,7 +407,7 @@ nsComboboxControlFrame::ReflowDropdown(nsPresContext* aPresContext, // need to reflow it, just bail out here. if (!aReflowState.ShouldReflowAllKids() && !NS_SUBTREE_DIRTY(mDropdownFrame)) { - return NS_OK; + return; } // XXXbz this will, for small-height dropdowns, have extra space on the right @@ -444,14 +444,12 @@ nsComboboxControlFrame::ReflowDropdown(nsPresContext* aPresContext, nsRect rect = mDropdownFrame->GetRect(); nsHTMLReflowMetrics desiredSize(aReflowState); nsReflowStatus ignoredStatus; - nsresult rv = ReflowChild(mDropdownFrame, aPresContext, desiredSize, - kidReflowState, rect.x, rect.y, flags, - ignoredStatus); + ReflowChild(mDropdownFrame, aPresContext, desiredSize, + kidReflowState, rect.x, rect.y, flags, ignoredStatus); // Set the child's width and height to its desired size FinishReflowChild(mDropdownFrame, aPresContext, desiredSize, &kidReflowState, rect.x, rect.y, flags); - return rv; } nsPoint @@ -759,7 +757,7 @@ nsComboboxControlFrame::GetPrefWidth(nsRenderingContext *aRenderingContext) return prefWidth; } -nsresult +void nsComboboxControlFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, @@ -778,7 +776,7 @@ nsComboboxControlFrame::Reflow(nsPresContext* aPresContext, if (!mDisplayFrame || !mButtonFrame || !mDropdownFrame) { NS_ERROR("Why did the frame constructor allow this to happen? Fix it!!"); - return NS_ERROR_UNEXPECTED; + return; } // Make sure the displayed text is the same as the selected option, bug 297389. @@ -828,9 +826,7 @@ nsComboboxControlFrame::Reflow(nsPresContext* aPresContext, mDisplayWidth = aReflowState.ComputedWidth() - buttonWidth; - nsresult rv = nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowState, - aStatus); - NS_ENSURE_SUCCESS(rv, rv); + nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus); // The button should occupy the same space as a scrollbar nsRect buttonRect = mButtonFrame->GetRect(); @@ -859,7 +855,6 @@ nsComboboxControlFrame::Reflow(nsPresContext* aPresContext, // a nsComboboxControlFrame makes no sense, so we override the status here. aStatus = NS_FRAME_COMPLETE; } - return rv; } //-------------------------------------------------------------- @@ -1213,7 +1208,7 @@ public: ~(nsIFrame::eReplacedContainsBlock)); } - virtual nsresult Reflow(nsPresContext* aPresContext, + virtual void Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus) MOZ_OVERRIDE; @@ -1234,7 +1229,7 @@ nsComboboxDisplayFrame::GetType() const return nsGkAtoms::comboboxDisplayFrame; } -nsresult +void nsComboboxDisplayFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, diff --git a/layout/forms/nsComboboxControlFrame.h b/layout/forms/nsComboboxControlFrame.h index 2196606c1beb..a8864e93034c 100644 --- a/layout/forms/nsComboboxControlFrame.h +++ b/layout/forms/nsComboboxControlFrame.h @@ -69,10 +69,10 @@ public: virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE; - virtual nsresult Reflow(nsPresContext* aCX, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus) MOZ_OVERRIDE; + virtual void Reflow(nsPresContext* aCX, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) MOZ_OVERRIDE; virtual nsresult HandleEvent(nsPresContext* aPresContext, mozilla::WidgetGUIEvent* aEvent, @@ -201,8 +201,8 @@ protected: friend class nsResizeDropdownAtFinalPosition; // Utilities - nsresult ReflowDropdown(nsPresContext* aPresContext, - const nsHTMLReflowState& aReflowState); + void ReflowDropdown(nsPresContext* aPresContext, + const nsHTMLReflowState& aReflowState); enum DropDownPositionState { // can't show the dropdown at its current position diff --git a/layout/forms/nsFieldSetFrame.cpp b/layout/forms/nsFieldSetFrame.cpp index cbab8984582d..706971504a81 100644 --- a/layout/forms/nsFieldSetFrame.cpp +++ b/layout/forms/nsFieldSetFrame.cpp @@ -339,7 +339,7 @@ nsFieldSetFrame::ComputeSize(nsRenderingContext *aRenderingContext, return result; } -nsresult +void nsFieldSetFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, @@ -554,7 +554,6 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext, InvalidateFrame(); NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize); - return NS_OK; } nsresult diff --git a/layout/forms/nsFieldSetFrame.h b/layout/forms/nsFieldSetFrame.h index 3ae9974742ef..ca0fe64c7377 100644 --- a/layout/forms/nsFieldSetFrame.h +++ b/layout/forms/nsFieldSetFrame.h @@ -33,10 +33,10 @@ public: */ virtual nsRect VisualBorderRectRelativeToSelf() const MOZ_OVERRIDE; - virtual nsresult Reflow(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus) MOZ_OVERRIDE; + virtual void Reflow(nsPresContext* aPresContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) MOZ_OVERRIDE; virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder, const nsRect& aDirtyRect, diff --git a/layout/forms/nsFormControlFrame.cpp b/layout/forms/nsFormControlFrame.cpp index 924c13d10a93..66ebf9bc3d42 100644 --- a/layout/forms/nsFormControlFrame.cpp +++ b/layout/forms/nsFormControlFrame.cpp @@ -73,7 +73,7 @@ nsFormControlFrame::GetBaseline() const return mRect.height - GetUsedBorderAndPadding().bottom; } -nsresult +void nsFormControlFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, @@ -86,11 +86,7 @@ nsFormControlFrame::Reflow(nsPresContext* aPresContext, RegUnRegAccessKey(static_cast(this), true); } - nsresult rv = nsLeafFrame::Reflow(aPresContext, aDesiredSize, aReflowState, - aStatus); - if (NS_FAILED(rv)) { - return rv; - } + nsLeafFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus); if (nsLayoutUtils::FontSizeInflationEnabled(aPresContext)) { float inflation = nsLayoutUtils::FontSizeInflationFor(this); @@ -99,7 +95,6 @@ nsFormControlFrame::Reflow(nsPresContext* aPresContext, aDesiredSize.UnionOverflowAreasWithDesiredBounds(); FinishAndStoreOverflow(&aDesiredSize); } - return NS_OK; } nsresult diff --git a/layout/forms/nsFormControlFrame.h b/layout/forms/nsFormControlFrame.h index faa0c15a83e6..c759ea11ed55 100644 --- a/layout/forms/nsFormControlFrame.h +++ b/layout/forms/nsFormControlFrame.h @@ -51,10 +51,10 @@ public: * Respond to the request to resize and/or reflow * @see nsIFrame::Reflow */ - virtual nsresult Reflow(nsPresContext* aCX, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus) MOZ_OVERRIDE; + virtual void Reflow(nsPresContext* aCX, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) MOZ_OVERRIDE; virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE; diff --git a/layout/forms/nsHTMLButtonControlFrame.cpp b/layout/forms/nsHTMLButtonControlFrame.cpp index 924190548e19..b50ba711f9f7 100644 --- a/layout/forms/nsHTMLButtonControlFrame.cpp +++ b/layout/forms/nsHTMLButtonControlFrame.cpp @@ -162,7 +162,7 @@ nsHTMLButtonControlFrame::GetPrefWidth(nsRenderingContext* aRenderingContext) return result; } -nsresult +void nsHTMLButtonControlFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, @@ -205,7 +205,6 @@ nsHTMLButtonControlFrame::Reflow(nsPresContext* aPresContext, aReflowState, aStatus); NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize); - return NS_OK; } // Helper-function that lets us clone the button's reflow state, but with its diff --git a/layout/forms/nsHTMLButtonControlFrame.h b/layout/forms/nsHTMLButtonControlFrame.h index 9f2fe2ce318e..8144cad4247c 100644 --- a/layout/forms/nsHTMLButtonControlFrame.h +++ b/layout/forms/nsHTMLButtonControlFrame.h @@ -34,10 +34,10 @@ public: virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE; - virtual nsresult Reflow(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus) MOZ_OVERRIDE; + virtual void Reflow(nsPresContext* aPresContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) MOZ_OVERRIDE; virtual nsresult HandleEvent(nsPresContext* aPresContext, mozilla::WidgetGUIEvent* aEvent, diff --git a/layout/forms/nsImageControlFrame.cpp b/layout/forms/nsImageControlFrame.cpp index b9af6e46d71f..05ed1a49c9da 100644 --- a/layout/forms/nsImageControlFrame.cpp +++ b/layout/forms/nsImageControlFrame.cpp @@ -29,7 +29,7 @@ public: NS_DECL_QUERYFRAME NS_DECL_FRAMEARENA_HELPERS - virtual nsresult Reflow(nsPresContext* aPresContext, + virtual void Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus) MOZ_OVERRIDE; @@ -124,7 +124,7 @@ nsImageControlFrame::GetType() const return nsGkAtoms::imageControlFrame; } -nsresult +void nsImageControlFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, diff --git a/layout/forms/nsLegendFrame.cpp b/layout/forms/nsLegendFrame.cpp index 46056ea641be..db526dcfd5fd 100644 --- a/layout/forms/nsLegendFrame.cpp +++ b/layout/forms/nsLegendFrame.cpp @@ -47,7 +47,7 @@ NS_QUERYFRAME_HEAD(nsLegendFrame) NS_QUERYFRAME_ENTRY(nsLegendFrame) NS_QUERYFRAME_TAIL_INHERITING(nsBlockFrame) -nsresult +void nsLegendFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, diff --git a/layout/forms/nsLegendFrame.h b/layout/forms/nsLegendFrame.h index 4f633b74b80c..8375c0a6554a 100644 --- a/layout/forms/nsLegendFrame.h +++ b/layout/forms/nsLegendFrame.h @@ -17,10 +17,10 @@ public: nsLegendFrame(nsStyleContext* aContext) : nsBlockFrame(aContext) {} - virtual nsresult Reflow(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus) MOZ_OVERRIDE; + virtual void Reflow(nsPresContext* aPresContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) MOZ_OVERRIDE; virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE; diff --git a/layout/forms/nsListControlFrame.cpp b/layout/forms/nsListControlFrame.cpp index e2847f9672e7..17809144bf7b 100644 --- a/layout/forms/nsListControlFrame.cpp +++ b/layout/forms/nsListControlFrame.cpp @@ -329,7 +329,7 @@ nsListControlFrame::GetMinWidth(nsRenderingContext *aRenderingContext) return result; } -nsresult +void nsListControlFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, @@ -358,7 +358,8 @@ nsListControlFrame::Reflow(nsPresContext* aPresContext, } if (IsInDropDownMode()) { - return ReflowAsDropdown(aPresContext, aDesiredSize, aReflowState, aStatus); + ReflowAsDropdown(aPresContext, aDesiredSize, aReflowState, aStatus); + return; } /* @@ -398,9 +399,7 @@ nsListControlFrame::Reflow(nsPresContext* aPresContext, state.SetComputedHeight(computedHeight); } - nsresult rv = nsHTMLScrollFrame::Reflow(aPresContext, aDesiredSize, - state, aStatus); - NS_ENSURE_SUCCESS(rv, rv); + nsHTMLScrollFrame::Reflow(aPresContext, aDesiredSize, state, aStatus); if (!mMightNeedSecondPass) { NS_ASSERTION(!autoHeight || HeightOfARow() == oldHeightOfARow, @@ -426,7 +425,7 @@ nsListControlFrame::Reflow(nsPresContext* aPresContext, } } - return rv; + return; } mMightNeedSecondPass = false; @@ -438,7 +437,7 @@ nsListControlFrame::Reflow(nsPresContext* aPresContext, NS_ASSERTION(!IsScrollbarUpdateSuppressed(), "Shouldn't be suppressing if the height of a row has not " "changed!"); - return rv; + return; } SetSuppressScrollbarUpdate(false); @@ -461,10 +460,10 @@ 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.... - return nsHTMLScrollFrame::Reflow(aPresContext, aDesiredSize, state, aStatus); + nsHTMLScrollFrame::Reflow(aPresContext, aDesiredSize, state, aStatus); } -nsresult +void nsListControlFrame::ReflowAsDropdown(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, @@ -493,9 +492,7 @@ nsListControlFrame::ReflowAsDropdown(nsPresContext* aPresContext, state.SetComputedHeight(mLastDropdownComputedHeight); } - nsresult rv = nsHTMLScrollFrame::Reflow(aPresContext, aDesiredSize, - state, aStatus); - NS_ENSURE_SUCCESS(rv, rv); + nsHTMLScrollFrame::Reflow(aPresContext, aDesiredSize, state, aStatus); if (!mMightNeedSecondPass) { NS_ASSERTION(oldVisibleHeight == GetScrolledFrame()->GetSize().height, @@ -506,7 +503,7 @@ nsListControlFrame::ReflowAsDropdown(nsPresContext* aPresContext, "Shouldn't be suppressing if we don't need a second pass!"); NS_ASSERTION(!(GetStateBits() & NS_FRAME_FIRST_REFLOW), "How can we avoid a second pass during first reflow?"); - return rv; + return; } mMightNeedSecondPass = false; @@ -517,7 +514,7 @@ nsListControlFrame::ReflowAsDropdown(nsPresContext* aPresContext, // All done. No need to do more reflow. NS_ASSERTION(!(GetStateBits() & NS_FRAME_FIRST_REFLOW), "How can we avoid a second pass during first reflow?"); - return rv; + return; } SetSuppressScrollbarUpdate(false); @@ -579,7 +576,7 @@ nsListControlFrame::ReflowAsDropdown(nsPresContext* aPresContext, mLastDropdownComputedHeight = state.ComputedHeight(); nsHTMLScrollFrame::WillReflow(aPresContext); - return nsHTMLScrollFrame::Reflow(aPresContext, aDesiredSize, state, aStatus); + nsHTMLScrollFrame::Reflow(aPresContext, aDesiredSize, state, aStatus); } ScrollbarStyles diff --git a/layout/forms/nsListControlFrame.h b/layout/forms/nsListControlFrame.h index 2f9808ba73b2..c0e64cd34f36 100644 --- a/layout/forms/nsListControlFrame.h +++ b/layout/forms/nsListControlFrame.h @@ -68,10 +68,10 @@ public: virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE; virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE; - virtual nsresult Reflow(nsPresContext* aCX, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus) MOZ_OVERRIDE; + virtual void Reflow(nsPresContext* aCX, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) MOZ_OVERRIDE; virtual void Init(nsIContent* aContent, nsIFrame* aParent, @@ -343,10 +343,10 @@ protected: * reflow as a listbox because the criteria for needing a second * pass are different. This will be called from Reflow() as needed. */ - nsresult ReflowAsDropdown(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus); + void ReflowAsDropdown(nsPresContext* aPresContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus); // Selection bool SetOptionsSelectedFromFrame(int32_t aStartIndex, diff --git a/layout/forms/nsMeterFrame.cpp b/layout/forms/nsMeterFrame.cpp index 4ebd9b5a0b3f..16aa784e2f47 100644 --- a/layout/forms/nsMeterFrame.cpp +++ b/layout/forms/nsMeterFrame.cpp @@ -91,7 +91,8 @@ NS_QUERYFRAME_HEAD(nsMeterFrame) NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame) -nsresult nsMeterFrame::Reflow(nsPresContext* aPresContext, +void +nsMeterFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus) @@ -125,8 +126,6 @@ nsresult nsMeterFrame::Reflow(nsPresContext* aPresContext, aStatus = NS_FRAME_COMPLETE; NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize); - - return NS_OK; } void diff --git a/layout/forms/nsMeterFrame.h b/layout/forms/nsMeterFrame.h index c0885c8b65b4..0f55e3f0aae5 100644 --- a/layout/forms/nsMeterFrame.h +++ b/layout/forms/nsMeterFrame.h @@ -27,10 +27,10 @@ public: virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE; - virtual nsresult Reflow(nsPresContext* aCX, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus) MOZ_OVERRIDE; + virtual void Reflow(nsPresContext* aCX, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) MOZ_OVERRIDE; #ifdef DEBUG_FRAME_DUMP virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE { diff --git a/layout/forms/nsNumberControlFrame.cpp b/layout/forms/nsNumberControlFrame.cpp index 309fdc715f6a..313d47322fb9 100644 --- a/layout/forms/nsNumberControlFrame.cpp +++ b/layout/forms/nsNumberControlFrame.cpp @@ -99,7 +99,7 @@ nsNumberControlFrame::GetPrefWidth(nsRenderingContext* aRenderingContext) return result; } -nsresult +void nsNumberControlFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, @@ -150,10 +150,8 @@ nsNumberControlFrame::Reflow(nsPresContext* aPresContext, wrapperReflowState.ComputedPhysicalMargin().top; nsReflowStatus childStatus; - nsresult rv = ReflowChild(outerWrapperFrame, aPresContext, - wrappersDesiredSize, wrapperReflowState, - xoffset, yoffset, 0, childStatus); - NS_ENSURE_SUCCESS(rv, rv); + ReflowChild(outerWrapperFrame, aPresContext, wrappersDesiredSize, + wrapperReflowState, xoffset, yoffset, 0, childStatus); MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(childStatus), "We gave our child unconstrained height, so it should be complete"); @@ -181,10 +179,8 @@ nsNumberControlFrame::Reflow(nsPresContext* aPresContext, yoffset += std::max(0, extraSpace / 2); // Place the child - rv = FinishReflowChild(outerWrapperFrame, aPresContext, - wrappersDesiredSize, &wrapperReflowState, - xoffset, yoffset, 0); - NS_ENSURE_SUCCESS(rv, rv); + FinishReflowChild(outerWrapperFrame, aPresContext, wrappersDesiredSize, + &wrapperReflowState, xoffset, yoffset, 0); aDesiredSize.SetTopAscent(wrappersDesiredSize.TopAscent() + outerWrapperFrame->GetPosition().y); @@ -206,8 +202,6 @@ nsNumberControlFrame::Reflow(nsPresContext* aPresContext, aStatus = NS_FRAME_COMPLETE; NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize); - - return NS_OK; } void diff --git a/layout/forms/nsNumberControlFrame.h b/layout/forms/nsNumberControlFrame.h index c2c555bb03e4..33b8ac319823 100644 --- a/layout/forms/nsNumberControlFrame.h +++ b/layout/forms/nsNumberControlFrame.h @@ -57,10 +57,10 @@ public: virtual nscoord GetPrefWidth(nsRenderingContext* aRenderingContext) MOZ_OVERRIDE; - virtual nsresult Reflow(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus) MOZ_OVERRIDE; + virtual void Reflow(nsPresContext* aPresContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) MOZ_OVERRIDE; virtual nsresult AttributeChanged(int32_t aNameSpaceID, nsIAtom* aAttribute, diff --git a/layout/forms/nsProgressFrame.cpp b/layout/forms/nsProgressFrame.cpp index 338a83bcb6a5..11de825fc6c6 100644 --- a/layout/forms/nsProgressFrame.cpp +++ b/layout/forms/nsProgressFrame.cpp @@ -96,7 +96,8 @@ nsProgressFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, BuildDisplayListForInline(aBuilder, aDirtyRect, aLists); } -nsresult nsProgressFrame::Reflow(nsPresContext* aPresContext, +void +nsProgressFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus) @@ -130,8 +131,6 @@ nsresult nsProgressFrame::Reflow(nsPresContext* aPresContext, aStatus = NS_FRAME_COMPLETE; NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize); - - return NS_OK; } void diff --git a/layout/forms/nsProgressFrame.h b/layout/forms/nsProgressFrame.h index ddf9e4e83dc8..2f75c63e0a2b 100644 --- a/layout/forms/nsProgressFrame.h +++ b/layout/forms/nsProgressFrame.h @@ -32,10 +32,10 @@ public: const nsRect& aDirtyRect, const nsDisplayListSet& aLists) MOZ_OVERRIDE; - virtual nsresult Reflow(nsPresContext* aCX, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus) MOZ_OVERRIDE; + virtual void Reflow(nsPresContext* aCX, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) MOZ_OVERRIDE; #ifdef DEBUG_FRAME_DUMP virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE { diff --git a/layout/forms/nsRangeFrame.cpp b/layout/forms/nsRangeFrame.cpp index 3513cb8865e3..74c15cf15abf 100644 --- a/layout/forms/nsRangeFrame.cpp +++ b/layout/forms/nsRangeFrame.cpp @@ -265,7 +265,7 @@ nsRangeFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, new (aBuilder) nsDisplayRangeFocusRing(aBuilder, this)); } -nsresult +void nsRangeFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, @@ -294,9 +294,7 @@ nsRangeFrame::Reflow(nsPresContext* aPresContext, aDesiredSize.Height() = computedHeight + aReflowState.ComputedPhysicalBorderPadding().TopBottom(); - nsresult rv = - ReflowAnonymousContent(aPresContext, aDesiredSize, aReflowState); - NS_ENSURE_SUCCESS(rv, rv); + ReflowAnonymousContent(aPresContext, aDesiredSize, aReflowState); aDesiredSize.SetOverflowAreasToDesiredBounds(); @@ -320,11 +318,9 @@ nsRangeFrame::Reflow(nsPresContext* aPresContext, aStatus = NS_FRAME_COMPLETE; NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize); - - return NS_OK; } -nsresult +void nsRangeFrame::ReflowAnonymousContent(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState) @@ -370,14 +366,12 @@ nsRangeFrame::ReflowAnonymousContent(nsPresContext* aPresContext, nsReflowStatus frameStatus; nsHTMLReflowMetrics trackDesiredSize(aReflowState); - nsresult rv = ReflowChild(trackFrame, aPresContext, trackDesiredSize, - trackReflowState, trackX, trackY, 0, frameStatus); - NS_ENSURE_SUCCESS(rv, rv); + ReflowChild(trackFrame, aPresContext, trackDesiredSize, + trackReflowState, trackX, trackY, 0, frameStatus); MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(frameStatus), "We gave our child unconstrained height, so it should be complete"); - rv = FinishReflowChild(trackFrame, aPresContext, trackDesiredSize, - &trackReflowState, trackX, trackY, 0); - NS_ENSURE_SUCCESS(rv, rv); + FinishReflowChild(trackFrame, aPresContext, trackDesiredSize, + &trackReflowState, trackX, trackY, 0); } nsIFrame* thumbFrame = mThumbDiv->GetPrimaryFrame(); @@ -392,15 +386,12 @@ nsRangeFrame::ReflowAnonymousContent(nsPresContext* aPresContext, nsReflowStatus frameStatus; nsHTMLReflowMetrics thumbDesiredSize(aReflowState); - nsresult rv = ReflowChild(thumbFrame, aPresContext, thumbDesiredSize, - thumbReflowState, 0, 0, 0, frameStatus); - NS_ENSURE_SUCCESS(rv, rv); + ReflowChild(thumbFrame, aPresContext, thumbDesiredSize, + thumbReflowState, 0, 0, 0, frameStatus); MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(frameStatus), "We gave our child unconstrained height, so it should be complete"); - rv = FinishReflowChild(thumbFrame, aPresContext, thumbDesiredSize, - &thumbReflowState, 0, 0, 0); - NS_ENSURE_SUCCESS(rv, rv); - + FinishReflowChild(thumbFrame, aPresContext, thumbDesiredSize, + &thumbReflowState, 0, 0, 0); DoUpdateThumbPosition(thumbFrame, nsSize(aDesiredSize.Width(), aDesiredSize.Height())); } @@ -419,21 +410,16 @@ nsRangeFrame::ReflowAnonymousContent(nsPresContext* aPresContext, nsReflowStatus frameStatus; nsHTMLReflowMetrics progressDesiredSize(aReflowState); - nsresult rv = ReflowChild(rangeProgressFrame, aPresContext, - progressDesiredSize, progressReflowState, 0, 0, - 0, frameStatus); - NS_ENSURE_SUCCESS(rv, rv); + ReflowChild(rangeProgressFrame, aPresContext, + progressDesiredSize, progressReflowState, 0, 0, + 0, frameStatus); MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(frameStatus), "We gave our child unconstrained height, so it should be complete"); - rv = FinishReflowChild(rangeProgressFrame, aPresContext, - progressDesiredSize, &progressReflowState, 0, 0, 0); - NS_ENSURE_SUCCESS(rv, rv); - + FinishReflowChild(rangeProgressFrame, aPresContext, + progressDesiredSize, &progressReflowState, 0, 0, 0); DoUpdateRangeProgressFrame(rangeProgressFrame, nsSize(aDesiredSize.Width(), aDesiredSize.Height())); } - - return NS_OK; } #ifdef ACCESSIBILITY diff --git a/layout/forms/nsRangeFrame.h b/layout/forms/nsRangeFrame.h index bd48ffda6a9d..5a083cfeaae9 100644 --- a/layout/forms/nsRangeFrame.h +++ b/layout/forms/nsRangeFrame.h @@ -45,10 +45,10 @@ public: const nsRect& aDirtyRect, const nsDisplayListSet& aLists) MOZ_OVERRIDE; - virtual nsresult Reflow(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus) MOZ_OVERRIDE; + virtual void Reflow(nsPresContext* aPresContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) MOZ_OVERRIDE; #ifdef DEBUG_FRAME_DUMP virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE { @@ -140,9 +140,9 @@ private: nsTArray& aElements); // Helper function which reflows the anonymous div frames. - nsresult ReflowAnonymousContent(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState); + void ReflowAnonymousContent(nsPresContext* aPresContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState); void DoUpdateThumbPosition(nsIFrame* aThumbFrame, const nsSize& aRangeSize); diff --git a/layout/forms/nsSelectsAreaFrame.cpp b/layout/forms/nsSelectsAreaFrame.cpp index c57c3f83c025..abbe689e905e 100644 --- a/layout/forms/nsSelectsAreaFrame.cpp +++ b/layout/forms/nsSelectsAreaFrame.cpp @@ -151,7 +151,7 @@ nsSelectsAreaFrame::BuildDisplayListInternal(nsDisplayListBuilder* aBuilder, } } -nsresult +void nsSelectsAreaFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, @@ -177,9 +177,7 @@ nsSelectsAreaFrame::Reflow(nsPresContext* aPresContext, } } - nsresult rv = nsBlockFrame::Reflow(aPresContext, aDesiredSize, - aReflowState, aStatus); - NS_ENSURE_SUCCESS(rv, rv); + nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus); // Check whether we need to suppress scrollbar updates. We want to do that if // we're in a possible first pass and our height of a row has changed. @@ -195,6 +193,4 @@ nsSelectsAreaFrame::Reflow(nsPresContext* aPresContext, list->SetSuppressScrollbarUpdate(true); } } - - return rv; } diff --git a/layout/forms/nsSelectsAreaFrame.h b/layout/forms/nsSelectsAreaFrame.h index 1dd1b3d4b93e..145e6ab46373 100644 --- a/layout/forms/nsSelectsAreaFrame.h +++ b/layout/forms/nsSelectsAreaFrame.h @@ -23,10 +23,10 @@ public: const nsRect& aDirtyRect, const nsDisplayListSet& aLists); - virtual nsresult Reflow(nsPresContext* aCX, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus) MOZ_OVERRIDE; + virtual void Reflow(nsPresContext* aCX, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) MOZ_OVERRIDE; nscoord HeightOfARow() const { return mHeightOfARow; } diff --git a/layout/forms/nsTextControlFrame.cpp b/layout/forms/nsTextControlFrame.cpp index c5aff5a45a54..6047256ad7c0 100644 --- a/layout/forms/nsTextControlFrame.cpp +++ b/layout/forms/nsTextControlFrame.cpp @@ -462,7 +462,7 @@ nsTextControlFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext, return autoSize; } -nsresult +void nsTextControlFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, @@ -490,10 +490,8 @@ nsTextControlFrame::Reflow(nsPresContext* aPresContext, NS_AUTOHEIGHT, inflation); } nsRefPtr fontMet; - nsresult rv = nsLayoutUtils::GetFontMetricsForFrame(this, - getter_AddRefs(fontMet), - inflation); - NS_ENSURE_SUCCESS(rv, rv); + nsLayoutUtils::GetFontMetricsForFrame(this, getter_AddRefs(fontMet), + inflation); // now adjust for our borders and padding aDesiredSize.SetTopAscent( nsLayoutUtils::GetCenteredFontBaseline(fontMet, lineHeight) @@ -513,7 +511,6 @@ nsTextControlFrame::Reflow(nsPresContext* aPresContext, aStatus = NS_FRAME_COMPLETE; NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize); - return NS_OK; } void diff --git a/layout/forms/nsTextControlFrame.h b/layout/forms/nsTextControlFrame.h index a00dacecf183..8c9c4e3fc8bb 100644 --- a/layout/forms/nsTextControlFrame.h +++ b/layout/forms/nsTextControlFrame.h @@ -50,10 +50,10 @@ public: nsSize aMargin, nsSize aBorder, nsSize aPadding, bool aShrinkWrap) MOZ_OVERRIDE; - virtual nsresult Reflow(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus) MOZ_OVERRIDE; + virtual void Reflow(nsPresContext* aPresContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) MOZ_OVERRIDE; virtual nsSize GetMinSize(nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE; virtual bool IsCollapsed() MOZ_OVERRIDE; diff --git a/layout/generic/nsAbsoluteContainingBlock.cpp b/layout/generic/nsAbsoluteContainingBlock.cpp index cb427b09ce8e..b3d9c0f10d51 100644 --- a/layout/generic/nsAbsoluteContainingBlock.cpp +++ b/layout/generic/nsAbsoluteContainingBlock.cpp @@ -343,7 +343,7 @@ nsAbsoluteContainingBlock::DoMarkFramesDirty(bool aMarkAllDirty) // mChildListID == kFixedList, the height is unconstrained. // since we don't allow replicated frames to split. -nsresult +void nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegatingFrame, nsPresContext* aPresContext, const nsHTMLReflowState& aReflowState, @@ -412,7 +412,7 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat } // Do the reflow - nsresult rv = aKidFrame->Reflow(aPresContext, kidDesiredSize, kidReflowState, aStatus); + aKidFrame->Reflow(aPresContext, kidDesiredSize, kidReflowState, aStatus); // If we're solving for 'left' or 'top', then compute it now that we know the // width/height @@ -497,6 +497,4 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat if (aOverflowAreas) { aOverflowAreas->UnionWith(kidDesiredSize.mOverflowAreas + rect.TopLeft()); } - - return rv; } diff --git a/layout/generic/nsAbsoluteContainingBlock.h b/layout/generic/nsAbsoluteContainingBlock.h index 245e6a17e5d6..6e9c3e828bcb 100644 --- a/layout/generic/nsAbsoluteContainingBlock.h +++ b/layout/generic/nsAbsoluteContainingBlock.h @@ -117,14 +117,14 @@ protected: bool FrameDependsOnContainer(nsIFrame* aFrame, bool aCBWidthChanged, bool aCBHeightChanged); - nsresult ReflowAbsoluteFrame(nsIFrame* aDelegatingFrame, - nsPresContext* aPresContext, - const nsHTMLReflowState& aReflowState, - const nsRect& aContainingBlockRect, - bool aConstrainHeight, - nsIFrame* aKidFrame, - nsReflowStatus& aStatus, - nsOverflowAreas* aOverflowAreas); + void ReflowAbsoluteFrame(nsIFrame* aDelegatingFrame, + nsPresContext* aPresContext, + const nsHTMLReflowState& aReflowState, + const nsRect& aContainingBlockRect, + bool aConstrainHeight, + nsIFrame* aKidFrame, + nsReflowStatus& aStatus, + nsOverflowAreas* aOverflowAreas); /** * Mark our absolute frames dirty. diff --git a/layout/generic/nsBRFrame.cpp b/layout/generic/nsBRFrame.cpp index 3f954ec036be..ca7d62842ee2 100644 --- a/layout/generic/nsBRFrame.cpp +++ b/layout/generic/nsBRFrame.cpp @@ -35,7 +35,7 @@ public: bool aIsKeyboardSelect, int32_t* aOffset, PeekWordState* aState) MOZ_OVERRIDE; - virtual nsresult Reflow(nsPresContext* aPresContext, + virtual void Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus) MOZ_OVERRIDE; @@ -77,7 +77,7 @@ BRFrame::~BRFrame() { } -nsresult +void BRFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aMetrics, const nsHTMLReflowState& aReflowState, @@ -154,7 +154,6 @@ BRFrame::Reflow(nsPresContext* aPresContext, mAscent = aMetrics.TopAscent(); NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aMetrics); - return NS_OK; } /* virtual */ void diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index 63b7040de965..557a818e6b21 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -933,7 +933,7 @@ CalculateContainingBlockSizeForAbsolutes(const nsHTMLReflowState& aReflowState, return cbSize; } -nsresult +void nsBlockFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aMetrics, const nsHTMLReflowState& aReflowState, @@ -1009,7 +1009,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext, ClearLineCursor(); if (IsFrameTreeTooDeep(*reflowState, aMetrics, aStatus)) { - return NS_OK; + return; } bool topMarginRoot, bottomMarginRoot; @@ -1028,8 +1028,6 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext, AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN); } - nsresult rv = NS_OK; - // ALWAYS drain overflow. We never want to leave the previnflow's // overflow lines hanging around; block reflow depends on the // overflow line lists being cleared out between reflow passes. @@ -1066,7 +1064,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext, mState &= ~NS_FRAME_FIRST_REFLOW; // Now reflow... - rv = ReflowDirtyLines(state); + ReflowDirtyLines(state); // If we have a next-in-flow, and that next-in-flow has pushed floats from // this frame from a previous iteration of reflow, then we should not return @@ -1088,9 +1086,6 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext, } } - NS_ASSERTION(NS_SUCCEEDED(rv), "reflow dirty lines failed"); - if (NS_FAILED(rv)) return rv; - NS_MergeReflowStatusInto(&state.mReflowStatus, ocStatus); NS_MergeReflowStatusInto(&state.mReflowStatus, fcStatus); @@ -1295,7 +1290,6 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext, #endif NS_FRAME_SET_TRUNCATION(aStatus, (*reflowState), aMetrics); - return rv; } bool @@ -2073,8 +2067,7 @@ nsBlockFrame::ReflowDirtyLines(nsBlockReflowState& aState) // Reflow the dirty line. If it's an incremental reflow, then force // it to invalidate the dirty area if necessary - rv = ReflowLine(aState, line, &keepGoing); - NS_ENSURE_SUCCESS(rv, rv); + ReflowLine(aState, line, &keepGoing); if (aState.mReflowState.WillReflowAgainForClearance()) { line->MarkDirty(); @@ -2359,8 +2352,7 @@ nsBlockFrame::ReflowDirtyLines(nsBlockReflowState& aState) // line to be created; see SplitLine's callers for examples of // when this happens). while (line != end_lines()) { - rv = ReflowLine(aState, line, &keepGoing); - NS_ENSURE_SUCCESS(rv, rv); + ReflowLine(aState, line, &keepGoing); if (aState.mReflowState.WillReflowAgainForClearance()) { line->MarkDirty(); @@ -2538,13 +2530,11 @@ nsBlockFrame::DeleteLine(nsBlockReflowState& aState, * or contain 1 or more inline frames. aKeepReflowGoing indicates * whether or not the caller should continue to reflow more lines. */ -nsresult +void nsBlockFrame::ReflowLine(nsBlockReflowState& aState, line_iterator aLine, bool* aKeepReflowGoing) { - nsresult rv = NS_OK; - NS_ABORT_IF_FALSE(aLine->GetChildCount(), "reflowing empty line"); // Setup the line-layout for the new line @@ -2555,13 +2545,11 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState, // Now that we know what kind of line we have, reflow it if (aLine->IsBlock()) { - rv = ReflowBlockFrame(aState, aLine, aKeepReflowGoing); + ReflowBlockFrame(aState, aLine, aKeepReflowGoing); } else { aLine->SetLineWrapped(false); - rv = ReflowInlineFrames(aState, aLine, aKeepReflowGoing); + ReflowInlineFrames(aState, aLine, aKeepReflowGoing); } - - return rv; } nsIFrame* @@ -2875,19 +2863,17 @@ nsBlockFrame::ShouldApplyTopMargin(nsBlockReflowState& aState, return false; } -nsresult +void nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState, line_iterator aLine, bool* aKeepReflowGoing) { NS_PRECONDITION(*aKeepReflowGoing, "bad caller"); - nsresult rv = NS_OK; - nsIFrame* frame = aLine->mFirstChild; if (!frame) { NS_ASSERTION(false, "program error - unexpected empty line"); - return NS_ERROR_NULL_POINTER; + return; } // Prepare the block reflow engine @@ -2948,7 +2934,7 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState, aState.mPrevChild = frame; // Exactly what we do now is flexible since we'll definitely be // reflowed. - return NS_OK; + return; } } if (treatWithClearance) { @@ -3102,7 +3088,7 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState, PushLines(aState, aLine.prev()); NS_FRAME_SET_INCOMPLETE(aState.mReflowStatus); } - return NS_OK; + return; } // Now put the Y coordinate back to the top of the top-margin + @@ -3129,11 +3115,9 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState, } nsReflowStatus frameReflowStatus = NS_FRAME_COMPLETE; - rv = brc.ReflowBlock(availSpace, applyTopMargin, aState.mPrevBottomMargin, + brc.ReflowBlock(availSpace, applyTopMargin, aState.mPrevBottomMargin, clearance, aState.IsAdjacentWithTop(), aLine.get(), blockHtmlRS, frameReflowStatus, aState); - - NS_ENSURE_SUCCESS(rv, rv); if (mayNeedRetry && clearanceFrame) { aState.mFloatManager->PopState(&floatManagerState); @@ -3152,7 +3136,7 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState, // all of the child block, including the lines it didn't reflow. NS_ASSERTION(originalPosition == frame->GetPosition(), "we need to call PositionChildViews"); - return NS_OK; + return; } #if defined(REFLOW_STATUS_COVERAGE) @@ -3224,8 +3208,10 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState, nsOverflowContinuationTracker::AutoFinish fini(aState.mOverflowTracker, frame); nsContainerFrame* parent = static_cast(nextFrame->GetParent()); - rv = parent->StealFrame(nextFrame); - NS_ENSURE_SUCCESS(rv, rv); + nsresult rv = parent->StealFrame(nextFrame); + if (NS_FAILED(rv)) { + return; + } if (parent != this) ReparentFrame(nextFrame, parent, this); mFrames.InsertFrame(nullptr, frame, nextFrame); @@ -3291,8 +3277,10 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState, // to dig it out of the child lists. nsContainerFrame* parent = static_cast (nextFrame->GetParent()); - rv = parent->StealFrame(nextFrame); - NS_ENSURE_SUCCESS(rv, rv); + nsresult rv = parent->StealFrame(nextFrame); + if (NS_FAILED(rv)) { + return; + } } else if (madeContinuation) { mFrames.RemoveFrame(nextFrame); @@ -3359,15 +3347,13 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState, #ifdef DEBUG VerifyLines(true); #endif - return rv; } -nsresult +void nsBlockFrame::ReflowInlineFrames(nsBlockReflowState& aState, line_iterator aLine, bool* aKeepReflowGoing) { - nsresult rv = NS_OK; *aKeepReflowGoing = true; aLine->SetLineIsImpactedByFloat(false); @@ -3405,16 +3391,12 @@ nsBlockFrame::ReflowInlineFrames(nsBlockReflowState& aState, if (forceBreakInContent) { lineLayout.ForceBreakAtPosition(forceBreakInContent, forceBreakOffset); } - rv = DoReflowInlineFrames(aState, lineLayout, aLine, - floatAvailableSpace, availableSpaceHeight, - &floatManagerState, aKeepReflowGoing, - &lineReflowStatus, allowPullUp); + DoReflowInlineFrames(aState, lineLayout, aLine, + floatAvailableSpace, availableSpaceHeight, + &floatManagerState, aKeepReflowGoing, + &lineReflowStatus, allowPullUp); lineLayout.EndLineReflow(); - if (NS_FAILED(rv)) { - return rv; - } - if (LINE_REFLOW_REDO_NO_PULL == lineReflowStatus || LINE_REFLOW_REDO_MORE_FLOATS == lineReflowStatus || LINE_REFLOW_REDO_NEXT_BAND == lineReflowStatus) { @@ -3439,8 +3421,6 @@ nsBlockFrame::ReflowInlineFrames(nsBlockReflowState& aState, } while (LINE_REFLOW_REDO_NO_PULL == lineReflowStatus); } while (LINE_REFLOW_REDO_MORE_FLOATS == lineReflowStatus); } while (LINE_REFLOW_REDO_NEXT_BAND == lineReflowStatus); - - return rv; } void @@ -3461,7 +3441,7 @@ static const char* LineReflowStatusNames[] = { }; #endif -nsresult +void nsBlockFrame::DoReflowInlineFrames(nsBlockReflowState& aState, nsLineLayout& aLineLayout, line_iterator aLine, @@ -3525,7 +3505,6 @@ nsBlockFrame::DoReflowInlineFrames(nsBlockReflowState& aState, "first letter child bit should only be on first continuation"); // Reflow the frames that are already on the line first - nsresult rv = NS_OK; LineReflowStatus lineReflowStatus = LINE_REFLOW_OK; int32_t i; nsIFrame* frame = aLine->mFirstChild; @@ -3542,9 +3521,7 @@ nsBlockFrame::DoReflowInlineFrames(nsBlockReflowState& aState, // count can change during the loop! for (i = 0; LINE_REFLOW_OK == lineReflowStatus && i < aLine->GetChildCount(); i++, frame = frame->GetNextSibling()) { - rv = ReflowInlineFrame(aState, aLineLayout, aLine, frame, - &lineReflowStatus); - NS_ENSURE_SUCCESS(rv, rv); + ReflowInlineFrame(aState, aLineLayout, aLine, frame, &lineReflowStatus); if (LINE_REFLOW_OK != lineReflowStatus) { // It is possible that one or more of next lines are empty // (because of DeleteNextInFlowChild). If so, delete them now @@ -3577,9 +3554,7 @@ nsBlockFrame::DoReflowInlineFrames(nsBlockReflowState& aState, while (LINE_REFLOW_OK == lineReflowStatus) { int32_t oldCount = aLine->GetChildCount(); - rv = ReflowInlineFrame(aState, aLineLayout, aLine, frame, - &lineReflowStatus); - NS_ENSURE_SUCCESS(rv, rv); + ReflowInlineFrame(aState, aLineLayout, aLine, frame, &lineReflowStatus); if (aLine->GetChildCount() != oldCount) { // We just created a continuation for aFrame AND its going // to end up on this line (e.g. :first-letter @@ -3711,8 +3686,6 @@ nsBlockFrame::DoReflowInlineFrames(nsBlockReflowState& aState, } *aLineReflowStatus = lineReflowStatus; - - return rv; } /** @@ -3723,14 +3696,17 @@ nsBlockFrame::DoReflowInlineFrames(nsBlockReflowState& aState, * has some sort of breaking affect then aLine's break-type will be set * to something other than NS_STYLE_CLEAR_NONE. */ -nsresult +void nsBlockFrame::ReflowInlineFrame(nsBlockReflowState& aState, nsLineLayout& aLineLayout, line_iterator aLine, nsIFrame* aFrame, LineReflowStatus* aLineReflowStatus) { - NS_ENSURE_ARG_POINTER(aFrame); + if (!aFrame) { // XXX change to MOZ_ASSERT(aFrame) + NS_ERROR("why call me?"); + return; + } *aLineReflowStatus = LINE_REFLOW_OK; @@ -3745,15 +3721,12 @@ nsBlockFrame::ReflowInlineFrame(nsBlockReflowState& aState, // Reflow the inline frame nsReflowStatus frameReflowStatus; bool pushedFrame; - nsresult rv = aLineLayout.ReflowFrame(aFrame, frameReflowStatus, - nullptr, pushedFrame); - NS_ENSURE_SUCCESS(rv, rv); + aLineLayout.ReflowFrame(aFrame, frameReflowStatus, nullptr, pushedFrame); if (frameReflowStatus & NS_FRAME_REFLOW_NEXTINFLOW) { aLineLayout.SetDirtyNextLine(); } - NS_ENSURE_SUCCESS(rv, rv); #ifdef REALLY_NOISY_REFLOW_CHILD nsFrame::ListTag(stdout, aFrame); printf(": status=%x\n", frameReflowStatus); @@ -3862,8 +3835,6 @@ nsBlockFrame::ReflowInlineFrame(nsBlockReflowState& aState, SplitLine(aState, aLineLayout, aLine, aFrame->GetNextSibling(), aLineReflowStatus); } } - - return NS_OK; } bool @@ -5789,7 +5760,7 @@ nsBlockFrame::ComputeFloatWidth(nsBlockReflowState& aState, floatRS.ComputedPhysicalMargin().LeftRight(); } -nsresult +void nsBlockFrame::ReflowFloat(nsBlockReflowState& aState, const nsRect& aAdjustedAvailableSpace, nsIFrame* aFloat, @@ -5836,7 +5807,6 @@ nsBlockFrame::ReflowFloat(nsBlockReflowState& aState, bool isAdjacentWithTop = aState.IsAdjacentWithTop(); nsIFrame* clearanceFrame = nullptr; - nsresult rv; do { nsCollapsingMargin margin; bool mayNeedRetry = false; @@ -5853,11 +5823,11 @@ nsBlockFrame::ReflowFloat(nsBlockReflowState& aState, } } - rv = brc.ReflowBlock(aAdjustedAvailableSpace, true, margin, - 0, isAdjacentWithTop, - nullptr, floatRS, - aReflowStatus, aState); - } while (NS_SUCCEEDED(rv) && clearanceFrame); + brc.ReflowBlock(aAdjustedAvailableSpace, true, margin, + 0, isAdjacentWithTop, + nullptr, floatRS, + aReflowStatus, aState); + } while (clearanceFrame); if (!NS_FRAME_IS_FULLY_COMPLETE(aReflowStatus) && ShouldAvoidBreakInside(floatRS)) { @@ -5881,10 +5851,6 @@ nsBlockFrame::ReflowFloat(nsBlockReflowState& aState, aReflowStatus = NS_FRAME_COMPLETE; } - if (NS_FAILED(rv)) { - return rv; - } - // Capture the margin and offsets information for the caller aFloatMargin = floatRS.ComputedPhysicalMargin(); // float margins don't collapse aFloatOffsets = floatRS.ComputedPhysicalOffsets(); @@ -5912,8 +5878,6 @@ nsBlockFrame::ReflowFloat(nsBlockReflowState& aState, printf("end ReflowFloat %p, sized to %d,%d\n", aFloat, metrics.Width(), metrics.Height()); #endif - - return NS_OK; } uint8_t diff --git a/layout/generic/nsBlockFrame.h b/layout/generic/nsBlockFrame.h index 1a6bb1e8531d..1e49f97f14ec 100644 --- a/layout/generic/nsBlockFrame.h +++ b/layout/generic/nsBlockFrame.h @@ -261,10 +261,10 @@ public: nsHTMLReflowMetrics& aMetrics, nscoord aConsumed); - virtual nsresult Reflow(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus) MOZ_OVERRIDE; + virtual void Reflow(nsPresContext* aPresContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) MOZ_OVERRIDE; virtual nsresult AttributeChanged(int32_t aNameSpaceID, nsIAtom* aAttribute, @@ -594,9 +594,9 @@ protected: * or contain 1 or more inline frames. * @param aKeepReflowGoing [OUT] indicates whether the caller should continue to reflow more lines */ - nsresult ReflowLine(nsBlockReflowState& aState, - line_iterator aLine, - bool* aKeepReflowGoing); + void ReflowLine(nsBlockReflowState& aState, + line_iterator aLine, + bool* aKeepReflowGoing); // Return false if it needs another reflow because of reduced space // between floats that are next to it (but not next to its top), and @@ -639,30 +639,30 @@ protected: bool ShouldApplyTopMargin(nsBlockReflowState& aState, nsLineBox* aLine); - nsresult ReflowBlockFrame(nsBlockReflowState& aState, + void ReflowBlockFrame(nsBlockReflowState& aState, + line_iterator aLine, + bool* aKeepGoing); + + void ReflowInlineFrames(nsBlockReflowState& aState, + line_iterator aLine, + bool* aKeepLineGoing); + + void DoReflowInlineFrames(nsBlockReflowState& aState, + nsLineLayout& aLineLayout, line_iterator aLine, - bool* aKeepGoing); + nsFlowAreaRect& aFloatAvailableSpace, + nscoord& aAvailableSpaceHeight, + nsFloatManager::SavedState* + aFloatStateBeforeLine, + bool* aKeepReflowGoing, + LineReflowStatus* aLineReflowStatus, + bool aAllowPullUp); - nsresult ReflowInlineFrames(nsBlockReflowState& aState, - line_iterator aLine, - bool* aKeepLineGoing); - - nsresult DoReflowInlineFrames(nsBlockReflowState& aState, - nsLineLayout& aLineLayout, - line_iterator aLine, - nsFlowAreaRect& aFloatAvailableSpace, - nscoord& aAvailableSpaceHeight, - nsFloatManager::SavedState* - aFloatStateBeforeLine, - bool* aKeepReflowGoing, - LineReflowStatus* aLineReflowStatus, - bool aAllowPullUp); - - nsresult ReflowInlineFrame(nsBlockReflowState& aState, - nsLineLayout& aLineLayout, - line_iterator aLine, - nsIFrame* aFrame, - LineReflowStatus* aLineReflowStatus); + void ReflowInlineFrame(nsBlockReflowState& aState, + nsLineLayout& aLineLayout, + line_iterator aLine, + nsIFrame* aFrame, + LineReflowStatus* aLineReflowStatus); // Compute the available width for a float. nsRect AdjustFloatAvailableSpace(nsBlockReflowState& aState, @@ -676,16 +676,16 @@ protected: // but only if the available height is constrained. // aAdjustedAvailableSpace is the result of calling // nsBlockFrame::AdjustFloatAvailableSpace. - nsresult ReflowFloat(nsBlockReflowState& aState, - const nsRect& aAdjustedAvailableSpace, - nsIFrame* aFloat, - nsMargin& aFloatMargin, - nsMargin& aFloatOffsets, - // Whether the float's position - // (aAdjustedAvailableSpace) has been pushed down - // due to the presence of other floats. - bool aFloatPushedDown, - nsReflowStatus& aReflowStatus); + void ReflowFloat(nsBlockReflowState& aState, + const nsRect& aAdjustedAvailableSpace, + nsIFrame* aFloat, + nsMargin& aFloatMargin, + nsMargin& aFloatOffsets, + // Whether the float's position + // (aAdjustedAvailableSpace) has been pushed down + // due to the presence of other floats. + bool aFloatPushedDown, + nsReflowStatus& aReflowStatus); //---------------------------------------- // Methods for pushing/pulling lines/frames diff --git a/layout/generic/nsBlockReflowContext.cpp b/layout/generic/nsBlockReflowContext.cpp index 5e59705e373d..cf5b020ba02d 100644 --- a/layout/generic/nsBlockReflowContext.cpp +++ b/layout/generic/nsBlockReflowContext.cpp @@ -195,7 +195,7 @@ nsBlockReflowContext::ComputeCollapsedTopMargin(const nsHTMLReflowState& aRS, return dirtiedLine; } -nsresult +void nsBlockReflowContext::ReflowBlock(const nsRect& aSpace, bool aApplyTopMargin, nsCollapsingMargin& aPrevMargin, @@ -206,7 +206,6 @@ nsBlockReflowContext::ReflowBlock(const nsRect& aSpace, nsReflowStatus& aFrameReflowStatus, nsBlockReflowState& aState) { - nsresult rv = NS_OK; mFrame = aFrameRS.frame; mSpace = aSpace; @@ -258,7 +257,7 @@ nsBlockReflowContext::ReflowBlock(const nsRect& aSpace, #endif mOuterReflowState.mFloatManager->Translate(tx, ty); - rv = mFrame->Reflow(mPresContext, mMetrics, aFrameRS, aFrameReflowStatus); + mFrame->Reflow(mPresContext, mMetrics, aFrameRS, aFrameReflowStatus); mOuterReflowState.mFloatManager->Translate(-tx, -ty); #ifdef DEBUG @@ -301,8 +300,6 @@ nsBlockReflowContext::ReflowBlock(const nsRect& aSpace, } } } - - return rv; } /** diff --git a/layout/generic/nsBlockReflowContext.h b/layout/generic/nsBlockReflowContext.h index 12f0810e48fb..2831ad0cc4b7 100644 --- a/layout/generic/nsBlockReflowContext.h +++ b/layout/generic/nsBlockReflowContext.h @@ -28,15 +28,15 @@ public: const nsHTMLReflowState& aParentRS); ~nsBlockReflowContext() { } - nsresult ReflowBlock(const nsRect& aSpace, - bool aApplyTopMargin, - nsCollapsingMargin& aPrevMargin, - nscoord aClearance, - bool aIsAdjacentWithTop, - nsLineBox* aLine, - nsHTMLReflowState& aReflowState, - nsReflowStatus& aReflowStatus, - nsBlockReflowState& aState); + void ReflowBlock(const nsRect& aSpace, + bool aApplyTopMargin, + nsCollapsingMargin& aPrevMargin, + nscoord aClearance, + bool aIsAdjacentWithTop, + nsLineBox* aLine, + nsHTMLReflowState& aReflowState, + nsReflowStatus& aReflowStatus, + nsBlockReflowState& aState); bool PlaceBlock(const nsHTMLReflowState& aReflowState, bool aForceFit, diff --git a/layout/generic/nsBulletFrame.cpp b/layout/generic/nsBulletFrame.cpp index 65c1712939d4..02fc4ee74f8e 100644 --- a/layout/generic/nsBulletFrame.cpp +++ b/layout/generic/nsBulletFrame.cpp @@ -1653,7 +1653,7 @@ nsBulletFrame::GetDesiredSize(nsPresContext* aCX, } } -nsresult +void nsBulletFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aMetrics, const nsHTMLReflowState& aReflowState, @@ -1694,7 +1694,6 @@ nsBulletFrame::Reflow(nsPresContext* aPresContext, aStatus = NS_FRAME_COMPLETE; NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aMetrics); - return NS_OK; } /* virtual */ nscoord diff --git a/layout/generic/nsBulletFrame.h b/layout/generic/nsBulletFrame.h index 4d640230ccaf..24bb82e8d428 100644 --- a/layout/generic/nsBulletFrame.h +++ b/layout/generic/nsBulletFrame.h @@ -65,10 +65,10 @@ public: #endif // nsIHTMLReflow - virtual nsresult Reflow(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aMetrics, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus) MOZ_OVERRIDE; + virtual void Reflow(nsPresContext* aPresContext, + nsHTMLReflowMetrics& aMetrics, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) MOZ_OVERRIDE; virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE; virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE; diff --git a/layout/generic/nsCanvasFrame.cpp b/layout/generic/nsCanvasFrame.cpp index 1e8e9d95a540..a2dfc41c69ee 100644 --- a/layout/generic/nsCanvasFrame.cpp +++ b/layout/generic/nsCanvasFrame.cpp @@ -453,7 +453,7 @@ nsCanvasFrame::GetPrefWidth(nsRenderingContext *aRenderingContext) return result; } -nsresult +void nsCanvasFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, @@ -585,7 +585,6 @@ nsCanvasFrame::Reflow(nsPresContext* aPresContext, NS_FRAME_TRACE_REFLOW_OUT("nsCanvasFrame::Reflow", aStatus); NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize); - return NS_OK; } nsIAtom* diff --git a/layout/generic/nsCanvasFrame.h b/layout/generic/nsCanvasFrame.h index 1d7c3c5ddc90..615e224411b0 100644 --- a/layout/generic/nsCanvasFrame.h +++ b/layout/generic/nsCanvasFrame.h @@ -52,10 +52,10 @@ public: virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE; virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE; - virtual nsresult Reflow(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus) MOZ_OVERRIDE; + virtual void Reflow(nsPresContext* aPresContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) MOZ_OVERRIDE; virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE { return nsContainerFrame::IsFrameOfType(aFlags & diff --git a/layout/generic/nsColumnSetFrame.cpp b/layout/generic/nsColumnSetFrame.cpp index 24047ef2271f..9c9ce0b1f7a3 100644 --- a/layout/generic/nsColumnSetFrame.cpp +++ b/layout/generic/nsColumnSetFrame.cpp @@ -949,7 +949,7 @@ nsColumnSetFrame::FindBestBalanceHeight(const nsHTMLReflowState& aReflowState, aRunWasFeasible = feasible; } -nsresult +void nsColumnSetFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, @@ -1019,8 +1019,6 @@ nsColumnSetFrame::Reflow(nsPresContext* aPresContext, NS_ASSERTION(NS_FRAME_IS_FULLY_COMPLETE(aStatus) || aReflowState.AvailableHeight() != NS_UNCONSTRAINEDSIZE, "Column set should be complete if the available height is unconstrained"); - - return NS_OK; } void diff --git a/layout/generic/nsColumnSetFrame.h b/layout/generic/nsColumnSetFrame.h index 4b288b35e52c..0806880464e9 100644 --- a/layout/generic/nsColumnSetFrame.h +++ b/layout/generic/nsColumnSetFrame.h @@ -17,10 +17,10 @@ public: virtual nsresult SetInitialChildList(ChildListID aListID, nsFrameList& aChildList) MOZ_OVERRIDE; - virtual nsresult Reflow(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus) MOZ_OVERRIDE; + virtual void Reflow(nsPresContext* aPresContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) MOZ_OVERRIDE; virtual nsresult AppendFrames(ChildListID aListID, nsFrameList& aFrameList) MOZ_OVERRIDE; diff --git a/layout/generic/nsContainerFrame.cpp b/layout/generic/nsContainerFrame.cpp index 43ccd5f91ae1..0dcdde9ad01e 100644 --- a/layout/generic/nsContainerFrame.cpp +++ b/layout/generic/nsContainerFrame.cpp @@ -945,8 +945,6 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame, { NS_PRECONDITION(aReflowState.frame == aKidFrame, "bad reflow state"); - nsresult result; - // Send the WillReflow() notification, and position the child frame // and its view if requested aKidFrame->WillReflow(aPresContext); @@ -960,12 +958,11 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame, } // Reflow the child frame - result = aKidFrame->Reflow(aPresContext, aDesiredSize, aReflowState, - aStatus); + aKidFrame->Reflow(aPresContext, aDesiredSize, aReflowState, aStatus); - // If the reflow was successful and the child frame is complete, delete any - // next-in-flows, but only if the NO_DELETE_NEXT_IN_FLOW flag isn't set. - if (NS_SUCCEEDED(result) && NS_FRAME_IS_FULLY_COMPLETE(aStatus) && + // If the child frame is complete, delete any next-in-flows, + // but only if the NO_DELETE_NEXT_IN_FLOW flag isn't set. + if (NS_FRAME_IS_FULLY_COMPLETE(aStatus) && !(aFlags & NS_FRAME_NO_DELETE_NEXT_IN_FLOW_CHILD)) { nsIFrame* kidNextInFlow = aKidFrame->GetNextInFlow(); if (kidNextInFlow) { @@ -977,7 +974,7 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame, ->DeleteNextInFlowChild(kidNextInFlow, true); } } - return result; + return NS_OK; } diff --git a/layout/generic/nsFirstLetterFrame.cpp b/layout/generic/nsFirstLetterFrame.cpp index ab82391d95d3..f2e23fd686d0 100644 --- a/layout/generic/nsFirstLetterFrame.cpp +++ b/layout/generic/nsFirstLetterFrame.cpp @@ -154,7 +154,7 @@ nsFirstLetterFrame::ComputeSize(nsRenderingContext *aRenderingContext, aCBSize, aAvailableWidth, aMargin, aBorder, aPadding, aFlags); } -nsresult +void nsFirstLetterFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aMetrics, const nsHTMLReflowState& aReflowState, @@ -256,7 +256,7 @@ nsFirstLetterFrame::Reflow(nsPresContext* aPresContext, nsIFrame* nextInFlow; rv = CreateNextInFlow(kid, nextInFlow); if (NS_FAILED(rv)) { - return rv; + return; } // And then push it to our overflow list @@ -269,8 +269,8 @@ nsFirstLetterFrame::Reflow(nsPresContext* aPresContext, // created for us) we need to put the continuation with the rest of the // text that the first letter frame was made out of. nsIFrame* continuation; - rv = CreateContinuationForFloatingParent(aPresContext, kid, - &continuation, true); + CreateContinuationForFloatingParent(aPresContext, kid, + &continuation, true); } } } @@ -278,7 +278,6 @@ nsFirstLetterFrame::Reflow(nsPresContext* aPresContext, FinishAndStoreOverflow(&aMetrics); NS_FRAME_SET_TRUNCATION(aReflowStatus, aReflowState, aMetrics); - return rv; } /* virtual */ bool diff --git a/layout/generic/nsFirstLetterFrame.h b/layout/generic/nsFirstLetterFrame.h index 7f63b7a32372..68a3730249ab 100644 --- a/layout/generic/nsFirstLetterFrame.h +++ b/layout/generic/nsFirstLetterFrame.h @@ -53,10 +53,10 @@ public: nsSize aCBSize, nscoord aAvailableWidth, nsSize aMargin, nsSize aBorder, nsSize aPadding, uint32_t aFlags) MOZ_OVERRIDE; - virtual nsresult Reflow(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus) MOZ_OVERRIDE; + virtual void Reflow(nsPresContext* aPresContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) MOZ_OVERRIDE; virtual bool CanContinueTextRun() const MOZ_OVERRIDE; virtual nscoord GetBaseline() const MOZ_OVERRIDE; diff --git a/layout/generic/nsFlexContainerFrame.cpp b/layout/generic/nsFlexContainerFrame.cpp index d8b04ef1e900..f685018486ca 100644 --- a/layout/generic/nsFlexContainerFrame.cpp +++ b/layout/generic/nsFlexContainerFrame.cpp @@ -2988,7 +2988,7 @@ FlexLine::PositionItemsInCrossAxis(nscoord aLineStartPosition, } } -nsresult +void nsFlexContainerFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, @@ -3000,7 +3000,7 @@ nsFlexContainerFrame::Reflow(nsPresContext* aPresContext, ("Reflow() for nsFlexContainerFrame %p\n", this)); if (IsFrameTreeTooDeep(aReflowState, aDesiredSize, aStatus)) { - return NS_OK; + return; } // We (and our children) can only depend on our ancestor's height if we have @@ -3063,12 +3063,10 @@ nsFlexContainerFrame::Reflow(nsPresContext* aPresContext, if (NS_SUCCEEDED(rv) && !struts.IsEmpty()) { // We're restarting flex layout, with new knowledge of collapsed items. - rv = DoFlexLayout(aPresContext, aDesiredSize, aReflowState, aStatus, - contentBoxMainSize, availableHeightForContent, - struts, axisTracker); + DoFlexLayout(aPresContext, aDesiredSize, aReflowState, aStatus, + contentBoxMainSize, availableHeightForContent, + struts, axisTracker); } - - return rv; } // RAII class to clean up a list of FlexLines. diff --git a/layout/generic/nsFlexContainerFrame.h b/layout/generic/nsFlexContainerFrame.h index 242ae549e4da..4d022438e4ce 100644 --- a/layout/generic/nsFlexContainerFrame.h +++ b/layout/generic/nsFlexContainerFrame.h @@ -42,10 +42,10 @@ public: const nsRect& aDirtyRect, const nsDisplayListSet& aLists) MOZ_OVERRIDE; - virtual nsresult Reflow(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus) MOZ_OVERRIDE; + virtual void Reflow(nsPresContext* aPresContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) MOZ_OVERRIDE; virtual nscoord GetMinWidth(nsRenderingContext* aRenderingContext) MOZ_OVERRIDE; diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index c2bb7843f65a..35718cafb105 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -4364,7 +4364,7 @@ nsFrame::CanContinueTextRun() const return false; } -nsresult +void nsFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, @@ -4375,7 +4375,6 @@ nsFrame::Reflow(nsPresContext* aPresContext, aDesiredSize.Height() = 0; aStatus = NS_FRAME_COMPLETE; NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize); - return NS_OK; } nsresult diff --git a/layout/generic/nsFrame.h b/layout/generic/nsFrame.h index f2a82a8b2a8d..5718ae9a6881 100644 --- a/layout/generic/nsFrame.h +++ b/layout/generic/nsFrame.h @@ -318,10 +318,10 @@ public: * Note: if it's only the overflow rect(s) of a frame that need to be * updated, then UpdateOverflow should be called instead of Reflow. */ - virtual nsresult Reflow(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus) MOZ_OVERRIDE; + virtual void Reflow(nsPresContext* aPresContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) MOZ_OVERRIDE; virtual nsresult DidReflow(nsPresContext* aPresContext, const nsHTMLReflowState* aReflowState, nsDidReflowStatus aStatus) MOZ_OVERRIDE; diff --git a/layout/generic/nsFrameSetFrame.cpp b/layout/generic/nsFrameSetFrame.cpp index 23d178e1469c..65176358cf86 100644 --- a/layout/generic/nsFrameSetFrame.cpp +++ b/layout/generic/nsFrameSetFrame.cpp @@ -97,7 +97,7 @@ public: const nsRect& aDirtyRect, const nsDisplayListSet& aLists) MOZ_OVERRIDE; - virtual nsresult Reflow(nsPresContext* aPresContext, + virtual void Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus) MOZ_OVERRIDE; @@ -147,7 +147,7 @@ public: const nsRect& aDirtyRect, const nsDisplayListSet& aLists) MOZ_OVERRIDE; - virtual nsresult Reflow(nsPresContext* aPresContext, + virtual void Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus) MOZ_OVERRIDE; @@ -839,7 +839,7 @@ nscolor nsHTMLFramesetFrame::GetBorderColor(nsIContent* aContent) return GetBorderColor(); } -nsresult +void nsHTMLFramesetFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, @@ -893,7 +893,7 @@ nsHTMLFramesetFrame::Reflow(nsPresContext* aPresContext, aStatus = NS_FRAME_COMPLETE; mDrag.UnSet(); NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize); - return NS_OK; + return; } CalculateRowCol(aPresContext, width, mNumCols, colSpecs, mColSizes); @@ -913,18 +913,14 @@ nsHTMLFramesetFrame::Reflow(nsPresContext* aPresContext, PR_STATIC_ASSERT(NS_MAX_FRAMESET_SPEC_COUNT < UINT_MAX / sizeof(nscolor)); verBordersVis = new bool[mNumCols]; - NS_ENSURE_TRUE(verBordersVis, NS_ERROR_OUT_OF_MEMORY); verBorderColors = new nscolor[mNumCols]; - NS_ENSURE_TRUE(verBorderColors, NS_ERROR_OUT_OF_MEMORY); for (int verX = 0; verX < mNumCols; verX++) { verBordersVis[verX] = false; verBorderColors[verX] = NO_COLOR; } horBordersVis = new bool[mNumRows]; - NS_ENSURE_TRUE(horBordersVis, NS_ERROR_OUT_OF_MEMORY); horBorderColors = new nscolor[mNumRows]; - NS_ENSURE_TRUE(horBorderColors, NS_ERROR_OUT_OF_MEMORY); for (int horX = 0; horX < mNumRows; horX++) { horBordersVis[horX] = false; horBorderColors[horX] = NO_COLOR; @@ -1140,7 +1136,6 @@ nsHTMLFramesetFrame::Reflow(nsPresContext* aPresContext, FinishAndStoreOverflow(&aDesiredSize); NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize); - return NS_OK; } nsIAtom* @@ -1437,7 +1432,7 @@ void nsHTMLFramesetBorderFrame::SetColor(nscolor aColor) } -nsresult +void nsHTMLFramesetBorderFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, @@ -1452,7 +1447,6 @@ nsHTMLFramesetBorderFrame::Reflow(nsPresContext* aPresContext, aDesiredSize.SetOverflowAreasToDesiredBounds(); aStatus = NS_FRAME_COMPLETE; - return NS_OK; } class nsDisplayFramesetBorder : public nsDisplayItem { @@ -1645,7 +1639,7 @@ nscoord nsHTMLFramesetBlankFrame::GetIntrinsicHeight() return 0; } -nsresult +void nsHTMLFramesetBlankFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, @@ -1659,7 +1653,6 @@ nsHTMLFramesetBlankFrame::Reflow(nsPresContext* aPresContext, aDesiredSize.SetOverflowAreasToDesiredBounds(); aStatus = NS_FRAME_COMPLETE; - return NS_OK; } class nsDisplayFramesetBlank : public nsDisplayItem { diff --git a/layout/generic/nsFrameSetFrame.h b/layout/generic/nsFrameSetFrame.h index db33903729cd..414092d74e3e 100644 --- a/layout/generic/nsFrameSetFrame.h +++ b/layout/generic/nsFrameSetFrame.h @@ -98,10 +98,10 @@ public: const nsRect& aDirtyRect, const nsDisplayListSet& aLists) MOZ_OVERRIDE; - virtual nsresult Reflow(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus) MOZ_OVERRIDE; + virtual void Reflow(nsPresContext* aPresContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) MOZ_OVERRIDE; virtual nsIAtom* GetType() const MOZ_OVERRIDE; #ifdef DEBUG_FRAME_DUMP diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index f4423e0223c3..374079d5d84b 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -286,10 +286,8 @@ bool nsHTMLScrollFrame::TryLayout(ScrollReflowState* aState, nsHTMLReflowMetrics* aKidMetrics, bool aAssumeHScroll, bool aAssumeVScroll, - bool aForce, nsresult* aResult) + bool aForce) { - *aResult = NS_OK; - if ((aState->mStyles.mVertical == NS_STYLE_OVERFLOW_HIDDEN && aAssumeVScroll) || (aState->mStyles.mHorizontal == NS_STYLE_OVERFLOW_HIDDEN && aAssumeHScroll)) { NS_ASSERTION(!aForce, "Shouldn't be forcing a hidden scrollbar to show!"); @@ -299,12 +297,8 @@ nsHTMLScrollFrame::TryLayout(ScrollReflowState* aState, if (aAssumeVScroll != aState->mReflowedContentsWithVScrollbar || (aAssumeHScroll != aState->mReflowedContentsWithHScrollbar && ScrolledContentDependsOnHeight(aState))) { - nsresult rv = ReflowScrolledFrame(aState, aAssumeHScroll, aAssumeVScroll, - aKidMetrics, false); - if (NS_FAILED(rv)) { - *aResult = rv; - return false; - } + ReflowScrolledFrame(aState, aAssumeHScroll, aAssumeVScroll, aKidMetrics, + false); } nsSize vScrollbarMinSize(0, 0); @@ -394,7 +388,7 @@ nsHTMLScrollFrame::ScrolledContentDependsOnHeight(ScrollReflowState* aState) aState->mReflowState.ComputedMaxHeight() != NS_UNCONSTRAINEDSIZE; } -nsresult +void nsHTMLScrollFrame::ReflowScrolledFrame(ScrollReflowState* aState, bool aAssumeHScroll, bool aAssumeVScroll, @@ -457,9 +451,9 @@ nsHTMLScrollFrame::ReflowScrolledFrame(ScrollReflowState* aState, mHelper.mHasVerticalScrollbar = aAssumeVScroll; nsReflowStatus status; - nsresult rv = ReflowChild(mHelper.mScrolledFrame, presContext, *aMetrics, - kidReflowState, 0, 0, - NS_FRAME_NO_MOVE_FRAME, status); + ReflowChild(mHelper.mScrolledFrame, presContext, *aMetrics, + kidReflowState, 0, 0, + NS_FRAME_NO_MOVE_FRAME, status); mHelper.mHasHorizontalScrollbar = didHaveHorizontalScrollbar; mHelper.mHasVerticalScrollbar = didHaveVerticalScrollbar; @@ -497,8 +491,6 @@ nsHTMLScrollFrame::ReflowScrolledFrame(ScrollReflowState* aState, aState->mContentsOverflowAreas = aMetrics->mOverflowAreas; aState->mReflowedContentsWithHScrollbar = aAssumeHScroll; aState->mReflowedContentsWithVScrollbar = aAssumeVScroll; - - return rv; } bool @@ -563,14 +555,13 @@ nsHTMLScrollFrame::InInitialReflow() const return !mHelper.mIsRoot && (GetStateBits() & NS_FRAME_FIRST_REFLOW); } -nsresult +void nsHTMLScrollFrame::ReflowContents(ScrollReflowState* aState, const nsHTMLReflowMetrics& aDesiredSize) { nsHTMLReflowMetrics kidDesiredSize(aDesiredSize.GetWritingMode(), aDesiredSize.mFlags); - nsresult rv = ReflowScrolledFrame(aState, GuessHScrollbarNeeded(*aState), - GuessVScrollbarNeeded(*aState), &kidDesiredSize, true); - NS_ENSURE_SUCCESS(rv, rv); + ReflowScrolledFrame(aState, GuessHScrollbarNeeded(*aState), + GuessVScrollbarNeeded(*aState), &kidDesiredSize, true); // There's an important special case ... if the child appears to fit // in the inside-border rect (but overflows the scrollport), we @@ -602,9 +593,7 @@ nsHTMLScrollFrame::ReflowContents(ScrollReflowState* aState, insideBorderSize); if (nsRect(nsPoint(0, 0), insideBorderSize).Contains(scrolledRect)) { // Let's pretend we had no scrollbars coming in here - rv = ReflowScrolledFrame(aState, false, false, - &kidDesiredSize, false); - NS_ENSURE_SUCCESS(rv, rv); + ReflowScrolledFrame(aState, false, false, &kidDesiredSize, false); } } @@ -615,21 +604,21 @@ nsHTMLScrollFrame::ReflowContents(ScrollReflowState* aState, // Try leaving the horizontal scrollbar unchanged first. This will be more // efficient. if (TryLayout(aState, &kidDesiredSize, aState->mReflowedContentsWithHScrollbar, - aState->mReflowedContentsWithVScrollbar, false, &rv)) - return NS_OK; + aState->mReflowedContentsWithVScrollbar, false)) + return; if (TryLayout(aState, &kidDesiredSize, !aState->mReflowedContentsWithHScrollbar, - aState->mReflowedContentsWithVScrollbar, false, &rv)) - return NS_OK; + aState->mReflowedContentsWithVScrollbar, false)) + return; // OK, now try toggling the vertical scrollbar. The performance advantage // of trying the status-quo horizontal scrollbar state // does not exist here (we'll have to reflow due to the vertical scrollbar // change), so always try no horizontal scrollbar first. bool newVScrollbarState = !aState->mReflowedContentsWithVScrollbar; - if (TryLayout(aState, &kidDesiredSize, false, newVScrollbarState, false, &rv)) - return NS_OK; - if (TryLayout(aState, &kidDesiredSize, true, newVScrollbarState, false, &rv)) - return NS_OK; + if (TryLayout(aState, &kidDesiredSize, false, newVScrollbarState, false)) + return; + if (TryLayout(aState, &kidDesiredSize, true, newVScrollbarState, false)) + return; // OK, we're out of ideas. Try again enabling whatever scrollbars we can // enable and force the layout to stick even if it's inconsistent. @@ -637,8 +626,7 @@ nsHTMLScrollFrame::ReflowContents(ScrollReflowState* aState, TryLayout(aState, &kidDesiredSize, aState->mStyles.mHorizontal != NS_STYLE_OVERFLOW_HIDDEN, aState->mStyles.mVertical != NS_STYLE_OVERFLOW_HIDDEN, - true, &rv); - return rv; + true); } void @@ -753,7 +741,7 @@ GetBrowserRoot(nsIContent* aContent) return nullptr; } -nsresult +void nsHTMLScrollFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, @@ -807,9 +795,7 @@ nsHTMLScrollFrame::Reflow(nsPresContext* aPresContext, state.mComputedBorder = aReflowState.ComputedPhysicalBorderPadding() - aReflowState.ComputedPhysicalPadding(); - nsresult rv = ReflowContents(&state, aDesiredSize); - if (NS_FAILED(rv)) - return rv; + ReflowContents(&state, aDesiredSize); // Restore the old scroll position, for now, even if that's not valid anymore // because we changed size. We'll fix it up in a post-reflow callback, because @@ -875,7 +861,6 @@ nsHTMLScrollFrame::Reflow(nsPresContext* aPresContext, aStatus = NS_FRAME_COMPLETE; NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize); mHelper.PostOverflowEvent(); - return rv; } diff --git a/layout/generic/nsGfxScrollFrame.h b/layout/generic/nsGfxScrollFrame.h index 70273eb204c3..ed33b2355e9e 100644 --- a/layout/generic/nsGfxScrollFrame.h +++ b/layout/generic/nsGfxScrollFrame.h @@ -465,15 +465,15 @@ public: bool TryLayout(ScrollReflowState* aState, nsHTMLReflowMetrics* aKidMetrics, bool aAssumeVScroll, bool aAssumeHScroll, - bool aForce, nsresult* aResult); + bool aForce); bool ScrolledContentDependsOnHeight(ScrollReflowState* aState); - nsresult ReflowScrolledFrame(ScrollReflowState* aState, - bool aAssumeHScroll, - bool aAssumeVScroll, - nsHTMLReflowMetrics* aMetrics, - bool aFirstPass); - nsresult ReflowContents(ScrollReflowState* aState, - const nsHTMLReflowMetrics& aDesiredSize); + void ReflowScrolledFrame(ScrollReflowState* aState, + bool aAssumeHScroll, + bool aAssumeVScroll, + nsHTMLReflowMetrics* aMetrics, + bool aFirstPass); + void ReflowContents(ScrollReflowState* aState, + const nsHTMLReflowMetrics& aDesiredSize); void PlaceScrollArea(const ScrollReflowState& aState, const nsPoint& aScrollPosition); nscoord GetIntrinsicVScrollbarWidth(nsRenderingContext *aRenderingContext); @@ -488,10 +488,10 @@ public: virtual nsresult GetPadding(nsMargin& aPadding) MOZ_OVERRIDE; virtual bool IsCollapsed() MOZ_OVERRIDE; - virtual nsresult Reflow(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus) MOZ_OVERRIDE; + virtual void Reflow(nsPresContext* aPresContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) MOZ_OVERRIDE; virtual bool UpdateOverflow() MOZ_OVERRIDE { return mHelper.UpdateOverflow(); diff --git a/layout/generic/nsHTMLCanvasFrame.cpp b/layout/generic/nsHTMLCanvasFrame.cpp index fffdfc370f69..883abe3676bf 100644 --- a/layout/generic/nsHTMLCanvasFrame.cpp +++ b/layout/generic/nsHTMLCanvasFrame.cpp @@ -171,7 +171,7 @@ nsHTMLCanvasFrame::ComputeSize(nsRenderingContext *aRenderingContext, aMargin, aBorder, aPadding); } -nsresult +void nsHTMLCanvasFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aMetrics, const nsHTMLReflowState& aReflowState, @@ -222,8 +222,6 @@ nsHTMLCanvasFrame::Reflow(nsPresContext* aPresContext, ("exit nsHTMLCanvasFrame::Reflow: size=%d,%d", aMetrics.Width(), aMetrics.Height())); NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aMetrics); - - return NS_OK; } // FIXME taken from nsImageFrame, but then had splittable frame stuff diff --git a/layout/generic/nsHTMLCanvasFrame.h b/layout/generic/nsHTMLCanvasFrame.h index 92d7ef78f8b0..8aef71ec9a61 100644 --- a/layout/generic/nsHTMLCanvasFrame.h +++ b/layout/generic/nsHTMLCanvasFrame.h @@ -63,10 +63,10 @@ public: nsSize aMargin, nsSize aBorder, nsSize aPadding, uint32_t aFlags) MOZ_OVERRIDE; - virtual nsresult Reflow(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus) MOZ_OVERRIDE; + virtual void Reflow(nsPresContext* aPresContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) MOZ_OVERRIDE; nsRect GetInnerArea() const; diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h index 493ce003e26d..834a9aeac159 100644 --- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -1865,10 +1865,10 @@ public: * @param aStatus a return value indicating whether the frame is complete * and whether the next-in-flow is dirty and needs to be reflowed */ - virtual nsresult Reflow(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aReflowMetrics, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus) = 0; + virtual void Reflow(nsPresContext* aPresContext, + nsHTMLReflowMetrics& aReflowMetrics, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) = 0; /** * Post-reflow hook. After a frame is reflowed this method will be called diff --git a/layout/generic/nsImageFrame.cpp b/layout/generic/nsImageFrame.cpp index 78c37692b5fe..592860292422 100644 --- a/layout/generic/nsImageFrame.cpp +++ b/layout/generic/nsImageFrame.cpp @@ -797,7 +797,7 @@ nsImageFrame::GetIntrinsicRatio() return mIntrinsicRatio; } -nsresult +void nsImageFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aMetrics, const nsHTMLReflowState& aReflowState, @@ -900,7 +900,6 @@ nsImageFrame::Reflow(nsPresContext* aPresContext, ("exit nsImageFrame::Reflow: size=%d,%d", aMetrics.Width(), aMetrics.Height())); NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aMetrics); - return NS_OK; } bool diff --git a/layout/generic/nsImageFrame.h b/layout/generic/nsImageFrame.h index 7b961df6543f..c8b531a69702 100644 --- a/layout/generic/nsImageFrame.h +++ b/layout/generic/nsImageFrame.h @@ -81,10 +81,10 @@ public: virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE; virtual mozilla::IntrinsicSize GetIntrinsicSize() MOZ_OVERRIDE; virtual nsSize GetIntrinsicRatio() MOZ_OVERRIDE; - virtual nsresult Reflow(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus) MOZ_OVERRIDE; + virtual void Reflow(nsPresContext* aPresContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) MOZ_OVERRIDE; virtual nsresult GetContentForEvent(mozilla::WidgetEvent* aEvent, nsIContent** aContent) MOZ_OVERRIDE; diff --git a/layout/generic/nsInlineFrame.cpp b/layout/generic/nsInlineFrame.cpp index a59003c8d03c..54144728b818 100644 --- a/layout/generic/nsInlineFrame.cpp +++ b/layout/generic/nsInlineFrame.cpp @@ -294,7 +294,7 @@ ReparentChildListStyle(nsPresContext* aPresContext, } } -nsresult +void nsInlineFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aMetrics, const nsHTMLReflowState& aReflowState, @@ -303,10 +303,11 @@ nsInlineFrame::Reflow(nsPresContext* aPresContext, DO_GLOBAL_REFLOW_COUNT("nsInlineFrame"); DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aStatus); if (nullptr == aReflowState.mLineLayout) { - return NS_ERROR_INVALID_ARG; + NS_ERROR("must have non-null aReflowState.mLineLayout"); + return; } if (IsFrameTreeTooDeep(aReflowState, aMetrics, aStatus)) { - return NS_OK; + return; } bool lazilySetParentPointer = false; @@ -389,7 +390,6 @@ nsInlineFrame::Reflow(nsPresContext* aPresContext, irs.mNextInFlow = (nsInlineFrame*) GetNextInFlow(); irs.mSetParentPointer = lazilySetParentPointer; - nsresult rv; if (mFrames.IsEmpty()) { // Try to pull over one frame before starting so that we know // whether we have an anonymous block or not. @@ -397,7 +397,7 @@ nsInlineFrame::Reflow(nsPresContext* aPresContext, (void) PullOneFrame(aPresContext, irs, &complete); } - rv = ReflowFrames(aPresContext, aReflowState, irs, aMetrics, aStatus); + ReflowFrames(aPresContext, aReflowState, irs, aMetrics, aStatus); ReflowAbsoluteFrames(aPresContext, aMetrics, aReflowState, aStatus); @@ -405,7 +405,6 @@ nsInlineFrame::Reflow(nsPresContext* aPresContext, // overflow-rect state for us. NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aMetrics); - return rv; } bool @@ -480,14 +479,13 @@ nsInlineFrame::PullOverflowsFromPrevInFlow() } } -nsresult +void nsInlineFrame::ReflowFrames(nsPresContext* aPresContext, const nsHTMLReflowState& aReflowState, InlineReflowState& irs, nsHTMLReflowMetrics& aMetrics, nsReflowStatus& aStatus) { - nsresult rv = NS_OK; aStatus = NS_FRAME_COMPLETE; nsLineLayout* lineLayout = aReflowState.mLineLayout; @@ -598,9 +596,8 @@ nsInlineFrame::ReflowFrames(nsPresContext* aPresContext, if (!done) { bool reflowingFirstLetter = lineLayout->GetFirstLetterStyleOK(); - rv = ReflowInlineFrame(aPresContext, aReflowState, irs, frame, aStatus); - done = NS_FAILED(rv) || - NS_INLINE_IS_BREAK(aStatus) || + ReflowInlineFrame(aPresContext, aReflowState, irs, frame, aStatus); + done = NS_INLINE_IS_BREAK(aStatus) || (!reflowingFirstLetter && NS_FRAME_IS_NOT_COMPLETE(aStatus)); if (done) { if (!irs.mSetParentPointer) { @@ -637,9 +634,8 @@ nsInlineFrame::ReflowFrames(nsPresContext* aPresContext, } break; } - rv = ReflowInlineFrame(aPresContext, aReflowState, irs, frame, aStatus); - if (NS_FAILED(rv) || - NS_INLINE_IS_BREAK(aStatus) || + ReflowInlineFrame(aPresContext, aReflowState, irs, frame, aStatus); + if (NS_INLINE_IS_BREAK(aStatus) || (!reflowingFirstLetter && NS_FRAME_IS_NOT_COMPLETE(aStatus))) { break; } @@ -721,11 +717,9 @@ nsInlineFrame::ReflowFrames(nsPresContext* aPresContext, printf(": metrics=%d,%d ascent=%d\n", aMetrics.Width(), aMetrics.Height(), aMetrics.TopAscent()); #endif - - return rv; } -nsresult +void nsInlineFrame::ReflowInlineFrame(nsPresContext* aPresContext, const nsHTMLReflowState& aReflowState, InlineReflowState& irs, @@ -735,13 +729,8 @@ nsInlineFrame::ReflowInlineFrame(nsPresContext* aPresContext, nsLineLayout* lineLayout = aReflowState.mLineLayout; bool reflowingFirstLetter = lineLayout->GetFirstLetterStyleOK(); bool pushedFrame; - nsresult rv = - lineLayout->ReflowFrame(aFrame, aStatus, nullptr, pushedFrame); + lineLayout->ReflowFrame(aFrame, aStatus, nullptr, pushedFrame); - if (NS_FAILED(rv)) { - return rv; - } - if (NS_INLINE_IS_BREAK_BEFORE(aStatus)) { if (aFrame != mFrames.FirstChild()) { // Change break-before status into break-after since we have @@ -756,15 +745,15 @@ nsInlineFrame::ReflowInlineFrame(nsPresContext* aPresContext, // Preserve reflow status when breaking-before our first child // and propagate it upward without modification. } - return NS_OK; + return; } // Create a next-in-flow if needed. if (!NS_FRAME_IS_FULLY_COMPLETE(aStatus)) { nsIFrame* newFrame; - rv = CreateNextInFlow(aFrame, newFrame); + nsresult rv = CreateNextInFlow(aFrame, newFrame); if (NS_FAILED(rv)) { - return rv; + return; } } @@ -786,7 +775,7 @@ nsInlineFrame::ReflowInlineFrame(nsPresContext* aPresContext, nextInFlow = static_cast(nextInFlow->GetNextInFlow()); } } - return NS_OK; + return; } if (!NS_FRAME_IS_FULLY_COMPLETE(aStatus) && !reflowingFirstLetter) { @@ -795,7 +784,6 @@ nsInlineFrame::ReflowInlineFrame(nsPresContext* aPresContext, PushFrames(aPresContext, nextFrame, aFrame, irs); } } - return NS_OK; } nsIFrame* @@ -1033,14 +1021,14 @@ nsFirstLineFrame::PullOneFrame(nsPresContext* aPresContext, InlineReflowState& i return frame; } -nsresult +void nsFirstLineFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aMetrics, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus) { if (nullptr == aReflowState.mLineLayout) { - return NS_ERROR_INVALID_ARG; + return; // XXX does this happen? why? } nsIFrame* lineContainer = aReflowState.mLineLayout->LineContainerFrame(); @@ -1074,7 +1062,6 @@ nsFirstLineFrame::Reflow(nsPresContext* aPresContext, irs.mLineLayout = aReflowState.mLineLayout; irs.mNextInFlow = (nsInlineFrame*) GetNextInFlow(); - nsresult rv; bool wasEmpty = mFrames.IsEmpty(); if (wasEmpty) { // Try to pull over one frame before starting so that we know @@ -1105,14 +1092,12 @@ nsFirstLineFrame::Reflow(nsPresContext* aPresContext, NS_ASSERTION(!aReflowState.mLineLayout->GetInFirstLine(), "Nested first-line frames? BOGUS"); aReflowState.mLineLayout->SetInFirstLine(true); - rv = ReflowFrames(aPresContext, aReflowState, irs, aMetrics, aStatus); + ReflowFrames(aPresContext, aReflowState, irs, aMetrics, aStatus); aReflowState.mLineLayout->SetInFirstLine(false); ReflowAbsoluteFrames(aPresContext, aMetrics, aReflowState, aStatus); // Note: the line layout code will properly compute our overflow state for us - - return rv; } /* virtual */ void diff --git a/layout/generic/nsInlineFrame.h b/layout/generic/nsInlineFrame.h index 1a9899ea5bff..2466870b54b8 100644 --- a/layout/generic/nsInlineFrame.h +++ b/layout/generic/nsInlineFrame.h @@ -72,10 +72,10 @@ public: nsSize aMargin, nsSize aBorder, nsSize aPadding, uint32_t aFlags) MOZ_OVERRIDE; virtual nsRect ComputeTightBounds(gfxContext* aContext) const MOZ_OVERRIDE; - virtual nsresult Reflow(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus) MOZ_OVERRIDE; + virtual void Reflow(nsPresContext* aPresContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) MOZ_OVERRIDE; virtual bool CanContinueTextRun() const MOZ_OVERRIDE; @@ -128,17 +128,17 @@ protected: virtual int GetLogicalSkipSides(const nsHTMLReflowState* aReflowState = nullptr) const MOZ_OVERRIDE; - nsresult ReflowFrames(nsPresContext* aPresContext, - const nsHTMLReflowState& aReflowState, - InlineReflowState& rs, - nsHTMLReflowMetrics& aMetrics, - nsReflowStatus& aStatus); + void ReflowFrames(nsPresContext* aPresContext, + const nsHTMLReflowState& aReflowState, + InlineReflowState& rs, + nsHTMLReflowMetrics& aMetrics, + nsReflowStatus& aStatus); - nsresult ReflowInlineFrame(nsPresContext* aPresContext, - const nsHTMLReflowState& aReflowState, - InlineReflowState& rs, - nsIFrame* aFrame, - nsReflowStatus& aStatus); + void ReflowInlineFrame(nsPresContext* aPresContext, + const nsHTMLReflowState& aReflowState, + InlineReflowState& rs, + nsIFrame* aFrame, + nsReflowStatus& aStatus); /** * Reparent floats whose placeholders are inline descendants of aFrame from @@ -193,10 +193,10 @@ public: virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE; #endif virtual nsIAtom* GetType() const MOZ_OVERRIDE; - virtual nsresult Reflow(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus) MOZ_OVERRIDE; + virtual void Reflow(nsPresContext* aPresContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) MOZ_OVERRIDE; virtual void Init(nsIContent* aContent, nsIFrame* aParent, nsIFrame* aPrevInFlow) MOZ_OVERRIDE; diff --git a/layout/generic/nsLeafFrame.cpp b/layout/generic/nsLeafFrame.cpp index 1a356d5aecbc..cf8e01ad66c3 100644 --- a/layout/generic/nsLeafFrame.cpp +++ b/layout/generic/nsLeafFrame.cpp @@ -42,7 +42,7 @@ nsLeafFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext, return nsSize(GetIntrinsicWidth(), GetIntrinsicHeight()); } -nsresult +void nsLeafFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aMetrics, const nsHTMLReflowState& aReflowState, @@ -58,7 +58,6 @@ nsLeafFrame::Reflow(nsPresContext* aPresContext, DoReflow(aPresContext, aMetrics, aReflowState, aStatus); FinishAndStoreOverflow(&aMetrics); - return NS_OK; } nsresult diff --git a/layout/generic/nsLeafFrame.h b/layout/generic/nsLeafFrame.h index 1e2ad43cbb31..b5e256f0100b 100644 --- a/layout/generic/nsLeafFrame.h +++ b/layout/generic/nsLeafFrame.h @@ -51,10 +51,10 @@ public: * borderpadding for the desired height. Ascent will be set to the height, * and descent will be set to 0. */ - virtual nsresult Reflow(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus) MOZ_OVERRIDE; + virtual void Reflow(nsPresContext* aPresContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) MOZ_OVERRIDE; /** * This method does most of the work that Reflow() above need done. diff --git a/layout/generic/nsLineLayout.cpp b/layout/generic/nsLineLayout.cpp index 9b74ede0278a..802a0e5b470b 100644 --- a/layout/generic/nsLineLayout.cpp +++ b/layout/generic/nsLineLayout.cpp @@ -839,12 +839,8 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame, &savedOptionalBreakPriority); if (!isText) { - nsresult rv = aFrame->Reflow(mPresContext, metrics, reflowStateHolder.ref(), - aReflowStatus); - if (NS_FAILED(rv)) { - NS_WARNING( "Reflow of frame failed in nsLineLayout" ); - return rv; - } + aFrame->Reflow(mPresContext, metrics, reflowStateHolder.ref(), + aReflowStatus); } else { static_cast(aFrame)-> ReflowText(*this, availableSpaceOnLine, psd->mReflowState->rendContext, diff --git a/layout/generic/nsObjectFrame.cpp b/layout/generic/nsObjectFrame.cpp index 2a1b634ff69c..6c970938e3c6 100644 --- a/layout/generic/nsObjectFrame.cpp +++ b/layout/generic/nsObjectFrame.cpp @@ -497,7 +497,7 @@ nsObjectFrame::GetDesiredSize(nsPresContext* aPresContext, // call the superclass in all cases. } -nsresult +void nsObjectFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aMetrics, const nsHTMLReflowState& aReflowState, @@ -516,13 +516,13 @@ nsObjectFrame::Reflow(nsPresContext* aPresContext, // plugin needs to see that haven't arrived yet. if (!GetContent()->IsDoneAddingChildren()) { aStatus = NS_FRAME_COMPLETE; - return NS_OK; + return; } // if we are printing or print previewing, bail for now if (aPresContext->Medium() == nsGkAtoms::print) { aStatus = NS_FRAME_COMPLETE; - return NS_OK; + return; } nsRect r(0, 0, aMetrics.Width(), aMetrics.Height()); @@ -543,7 +543,6 @@ nsObjectFrame::Reflow(nsPresContext* aPresContext, aStatus = NS_FRAME_COMPLETE; NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aMetrics); - return NS_OK; } ///////////// nsIReflowCallback /////////////// diff --git a/layout/generic/nsObjectFrame.h b/layout/generic/nsObjectFrame.h index 9d7d201b62e7..7e845be74441 100644 --- a/layout/generic/nsObjectFrame.h +++ b/layout/generic/nsObjectFrame.h @@ -58,10 +58,10 @@ public: nsIFrame* aPrevInFlow) MOZ_OVERRIDE; virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE; virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE; - virtual nsresult Reflow(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus) MOZ_OVERRIDE; + virtual void Reflow(nsPresContext* aPresContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) MOZ_OVERRIDE; virtual nsresult DidReflow(nsPresContext* aPresContext, const nsHTMLReflowState* aReflowState, nsDidReflowStatus aStatus) MOZ_OVERRIDE; diff --git a/layout/generic/nsPageContentFrame.cpp b/layout/generic/nsPageContentFrame.cpp index 547b4153b890..7bba96e1542e 100644 --- a/layout/generic/nsPageContentFrame.cpp +++ b/layout/generic/nsPageContentFrame.cpp @@ -17,7 +17,7 @@ NS_NewPageContentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) NS_IMPL_FRAMEARENA_HELPERS(nsPageContentFrame) -nsresult +void nsPageContentFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, @@ -26,12 +26,13 @@ nsPageContentFrame::Reflow(nsPresContext* aPresContext, DO_GLOBAL_REFLOW_COUNT("nsPageContentFrame"); DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus); aStatus = NS_FRAME_COMPLETE; // initialize out parameter - nsresult rv = NS_OK; if (GetPrevInFlow() && (GetStateBits() & NS_FRAME_FIRST_REFLOW)) { nsresult rv = aPresContext->PresShell()->FrameConstructor() ->ReplicateFixedFrames(this); - NS_ENSURE_SUCCESS(rv, rv); + if (NS_FAILED(rv)) { + return; + } } // Set our size up front, since some parts of reflow depend on it @@ -50,8 +51,7 @@ nsPageContentFrame::Reflow(nsPresContext* aPresContext, kidReflowState.SetComputedHeight(maxSize.height); // Reflow the page content area - rv = ReflowChild(frame, aPresContext, aDesiredSize, kidReflowState, 0, 0, 0, aStatus); - NS_ENSURE_SUCCESS(rv, rv); + ReflowChild(frame, aPresContext, aDesiredSize, kidReflowState, 0, 0, 0, aStatus); // The document element's background should cover the entire canvas, so // take into account the combined area and any space taken up by @@ -100,7 +100,6 @@ nsPageContentFrame::Reflow(nsPresContext* aPresContext, FinishAndStoreOverflow(&aDesiredSize); NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize); - return NS_OK; } nsIAtom* diff --git a/layout/generic/nsPageContentFrame.h b/layout/generic/nsPageContentFrame.h index a7fb4b68b4db..eaf142bc4067 100644 --- a/layout/generic/nsPageContentFrame.h +++ b/layout/generic/nsPageContentFrame.h @@ -20,10 +20,10 @@ public: friend class nsPageFrame; // nsIFrame - virtual nsresult Reflow(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aMaxSize, - nsReflowStatus& aStatus) MOZ_OVERRIDE; + virtual void Reflow(nsPresContext* aPresContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aMaxSize, + nsReflowStatus& aStatus) MOZ_OVERRIDE; virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE { diff --git a/layout/generic/nsPageFrame.cpp b/layout/generic/nsPageFrame.cpp index bac956dfd4a1..24d48c679302 100644 --- a/layout/generic/nsPageFrame.cpp +++ b/layout/generic/nsPageFrame.cpp @@ -43,7 +43,8 @@ nsPageFrame::~nsPageFrame() { } -nsresult nsPageFrame::Reflow(nsPresContext* aPresContext, +void +nsPageFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus) @@ -84,7 +85,7 @@ nsresult nsPageFrame::Reflow(nsPresContext* aPresContext, aDesiredSize.Width() = 0; aDesiredSize.Height() = 0; NS_WARNING("Reflow aborted; no space for content"); - return NS_OK; + return; } nsHTMLReflowState kidReflowState(aPresContext, aReflowState, frame, maxSize); @@ -157,7 +158,6 @@ nsresult nsPageFrame::Reflow(nsPresContext* aPresContext, PR_PL(("[%d,%d]\n", aReflowState.AvailableWidth(), aReflowState.AvailableHeight())); NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize); - return NS_OK; } nsIAtom* @@ -648,7 +648,7 @@ nsPageBreakFrame::GetIntrinsicHeight() return 0; } -nsresult +void nsPageBreakFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, @@ -670,7 +670,6 @@ nsPageBreakFrame::Reflow(nsPresContext* aPresContext, // DidReflow will always get called before the next Reflow() call. mHaveReflowed = true; aStatus = NS_FRAME_COMPLETE; - return NS_OK; } nsIAtom* diff --git a/layout/generic/nsPageFrame.h b/layout/generic/nsPageFrame.h index 0d9e87d7f7a7..4e13cd4f4c1d 100644 --- a/layout/generic/nsPageFrame.h +++ b/layout/generic/nsPageFrame.h @@ -19,10 +19,10 @@ public: friend nsIFrame* NS_NewPageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); - virtual nsresult Reflow(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aMaxSize, - nsReflowStatus& aStatus) MOZ_OVERRIDE; + virtual void Reflow(nsPresContext* aPresContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aMaxSize, + nsReflowStatus& aStatus) MOZ_OVERRIDE; virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder, const nsRect& aDirtyRect, @@ -103,7 +103,7 @@ class nsPageBreakFrame : public nsLeafFrame nsPageBreakFrame(nsStyleContext* aContext); ~nsPageBreakFrame(); - virtual nsresult Reflow(nsPresContext* aPresContext, + virtual void Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus) MOZ_OVERRIDE; diff --git a/layout/generic/nsPlaceholderFrame.cpp b/layout/generic/nsPlaceholderFrame.cpp index 6722c24d6f8a..fa0354d3d708 100644 --- a/layout/generic/nsPlaceholderFrame.cpp +++ b/layout/generic/nsPlaceholderFrame.cpp @@ -98,7 +98,7 @@ nsPlaceholderFrame::AddInlinePrefWidth(nsRenderingContext* aRenderingContext, } } -nsresult +void nsPlaceholderFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, @@ -143,7 +143,6 @@ nsPlaceholderFrame::Reflow(nsPresContext* aPresContext, aStatus = NS_FRAME_COMPLETE; NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize); - return NS_OK; } void diff --git a/layout/generic/nsPlaceholderFrame.h b/layout/generic/nsPlaceholderFrame.h index 0bc0fcd38349..8a69b757e2ab 100644 --- a/layout/generic/nsPlaceholderFrame.h +++ b/layout/generic/nsPlaceholderFrame.h @@ -96,10 +96,10 @@ public: virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE; virtual nsSize GetMaxSize(nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE; - virtual nsresult Reflow(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus) MOZ_OVERRIDE; + virtual void Reflow(nsPresContext* aPresContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) MOZ_OVERRIDE; virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE; diff --git a/layout/generic/nsSimplePageSequenceFrame.cpp b/layout/generic/nsSimplePageSequenceFrame.cpp index 40198bfb9591..5dbd319a8a69 100644 --- a/layout/generic/nsSimplePageSequenceFrame.cpp +++ b/layout/generic/nsSimplePageSequenceFrame.cpp @@ -117,7 +117,7 @@ nsSimplePageSequenceFrame::SetDesiredSize(nsHTMLReflowMetrics& aDesiredSize, nscoord(aHeight * PresContext()->GetPrintPreviewScale())); } -nsresult +void nsSimplePageSequenceFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, @@ -138,7 +138,7 @@ nsSimplePageSequenceFrame::Reflow(nsPresContext* aPresContext, SetDesiredSize(aDesiredSize, aReflowState, mSize.width, mSize.height); aDesiredSize.SetOverflowAreasToDesiredBounds(); FinishAndStoreOverflow(&aDesiredSize); - return NS_OK; + return; } // See if we can get a Print Settings from the Context @@ -266,11 +266,12 @@ nsSimplePageSequenceFrame::Reflow(nsPresContext* aPresContext, } // Create current Date/Time String - if (!mDateFormatter) + if (!mDateFormatter) { mDateFormatter = do_CreateInstance(NS_DATETIMEFORMAT_CONTRACTID); - - NS_ENSURE_TRUE(mDateFormatter, NS_ERROR_FAILURE); - + } + if (!mDateFormatter) { + return; + } nsAutoString formattedDateString; time_t ltime; time( <ime ); @@ -297,7 +298,6 @@ nsSimplePageSequenceFrame::Reflow(nsPresContext* aPresContext, NS_FRAME_TRACE_REFLOW_OUT("nsSimplePageSequeceFrame::Reflow", aStatus); NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize); - return NS_OK; } //---------------------------------------------------------------------- diff --git a/layout/generic/nsSimplePageSequenceFrame.h b/layout/generic/nsSimplePageSequenceFrame.h index 48c7f82e1094..e71a79f40d71 100644 --- a/layout/generic/nsSimplePageSequenceFrame.h +++ b/layout/generic/nsSimplePageSequenceFrame.h @@ -64,10 +64,10 @@ public: NS_DECL_FRAMEARENA_HELPERS // nsIFrame - virtual nsresult Reflow(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aMaxSize, - nsReflowStatus& aStatus) MOZ_OVERRIDE; + virtual void Reflow(nsPresContext* aPresContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aMaxSize, + nsReflowStatus& aStatus) MOZ_OVERRIDE; virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder, const nsRect& aDirtyRect, diff --git a/layout/generic/nsSubDocumentFrame.cpp b/layout/generic/nsSubDocumentFrame.cpp index 2e7624ccb2d4..fb9288d9beeb 100644 --- a/layout/generic/nsSubDocumentFrame.cpp +++ b/layout/generic/nsSubDocumentFrame.cpp @@ -688,7 +688,7 @@ nsSubDocumentFrame::ComputeSize(nsRenderingContext *aRenderingContext, aMargin, aBorder, aPadding, aFlags); } -nsresult +void nsSubDocumentFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, @@ -709,7 +709,9 @@ nsSubDocumentFrame::Reflow(nsPresContext* aPresContext, // XUL