зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 11 changesets (bug 1008917) for apparently introducing an intermittent failure of B2G Crashtest-2 on a CLOSED TREE
Backed out changeset e2ab653f688a (bug 1008917) Backed out changeset b52154d8d900 (bug 1008917) Backed out changeset 2ab5b01da4de (bug 1008917) Backed out changeset f7a38df1d44f (bug 1008917) Backed out changeset 80304bb9a572 (bug 1008917) Backed out changeset 10ed89a302e9 (bug 1008917) Backed out changeset 161c41991d46 (bug 1008917) Backed out changeset 25b2475d2368 (bug 1008917) Backed out changeset b8000b31277c (bug 1008917) Backed out changeset 9afa5e7715e1 (bug 1008917) Backed out changeset 5c380c21351f (bug 1008917)
This commit is contained in:
Родитель
9de84ea214
Коммит
42253715d7
|
@ -479,13 +479,13 @@ RestyleManager::RecomputePosition(nsIFrame* aFrame)
|
|||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
RestyleManager::StyleChangeReflow(nsIFrame* aFrame, nsChangeHint aHint)
|
||||
{
|
||||
// If the frame hasn't even received an initial reflow, then don't
|
||||
// send it a style-change reflow!
|
||||
if (aFrame->GetStateBits() & NS_FRAME_FIRST_REFLOW)
|
||||
return;
|
||||
return NS_OK;
|
||||
|
||||
nsIPresShell::IntrinsicDirty dirtyType;
|
||||
if (aHint & nsChangeHint_ClearDescendantIntrinsics) {
|
||||
|
@ -510,7 +510,7 @@ RestyleManager::StyleChangeReflow(nsIFrame* aFrame, nsChangeHint aHint)
|
|||
aFrame = nsLayoutUtils::GetNextContinuationOrIBSplitSibling(aFrame);
|
||||
} while (aFrame);
|
||||
|
||||
return;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_DECLARE_FRAME_PROPERTY(ChangeListProperty, nullptr)
|
||||
|
|
|
@ -242,7 +242,7 @@ private:
|
|||
RestyleTracker& aRestyleTracker,
|
||||
bool aRestyleDescendants);
|
||||
|
||||
void StyleChangeReflow(nsIFrame* aFrame, nsChangeHint aHint);
|
||||
nsresult StyleChangeReflow(nsIFrame* aFrame, nsChangeHint aHint);
|
||||
|
||||
// Returns true if this function managed to successfully move a frame, and
|
||||
// false if it could not process the position change, and a reflow should
|
||||
|
|
|
@ -398,7 +398,7 @@ public:
|
|||
nsWeakFrame mFrame;
|
||||
};
|
||||
|
||||
void
|
||||
nsresult
|
||||
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;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// XXXbz this will, for small-height dropdowns, have extra space on the right
|
||||
|
@ -444,12 +444,14 @@ nsComboboxControlFrame::ReflowDropdown(nsPresContext* aPresContext,
|
|||
nsRect rect = mDropdownFrame->GetRect();
|
||||
nsHTMLReflowMetrics desiredSize(aReflowState);
|
||||
nsReflowStatus ignoredStatus;
|
||||
ReflowChild(mDropdownFrame, aPresContext, desiredSize,
|
||||
kidReflowState, rect.x, rect.y, flags, ignoredStatus);
|
||||
nsresult rv = 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
|
||||
|
@ -757,7 +759,7 @@ nsComboboxControlFrame::GetPrefWidth(nsRenderingContext *aRenderingContext)
|
|||
return prefWidth;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsComboboxControlFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -776,7 +778,7 @@ nsComboboxControlFrame::Reflow(nsPresContext* aPresContext,
|
|||
|
||||
if (!mDisplayFrame || !mButtonFrame || !mDropdownFrame) {
|
||||
NS_ERROR("Why did the frame constructor allow this to happen? Fix it!!");
|
||||
return;
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
// Make sure the displayed text is the same as the selected option, bug 297389.
|
||||
|
@ -826,7 +828,9 @@ nsComboboxControlFrame::Reflow(nsPresContext* aPresContext,
|
|||
|
||||
mDisplayWidth = aReflowState.ComputedWidth() - buttonWidth;
|
||||
|
||||
nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
|
||||
nsresult rv = nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowState,
|
||||
aStatus);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// The button should occupy the same space as a scrollbar
|
||||
nsRect buttonRect = mButtonFrame->GetRect();
|
||||
|
@ -855,6 +859,7 @@ nsComboboxControlFrame::Reflow(nsPresContext* aPresContext,
|
|||
// a nsComboboxControlFrame makes no sense, so we override the status here.
|
||||
aStatus = NS_FRAME_COMPLETE;
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
@ -1208,7 +1213,7 @@ public:
|
|||
~(nsIFrame::eReplacedContainsBlock));
|
||||
}
|
||||
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
virtual nsresult Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
@ -1229,7 +1234,7 @@ nsComboboxDisplayFrame::GetType() const
|
|||
return nsGkAtoms::comboboxDisplayFrame;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsComboboxDisplayFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
|
|
@ -69,10 +69,10 @@ public:
|
|||
|
||||
virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
|
||||
|
||||
virtual void Reflow(nsPresContext* aCX,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult 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
|
||||
void ReflowDropdown(nsPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState);
|
||||
nsresult ReflowDropdown(nsPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState);
|
||||
|
||||
enum DropDownPositionState {
|
||||
// can't show the dropdown at its current position
|
||||
|
|
|
@ -339,7 +339,7 @@ nsFieldSetFrame::ComputeSize(nsRenderingContext *aRenderingContext,
|
|||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -554,6 +554,7 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
|||
InvalidateFrame();
|
||||
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
|
@ -33,10 +33,10 @@ public:
|
|||
*/
|
||||
virtual nsRect VisualBorderRectRelativeToSelf() const MOZ_OVERRIDE;
|
||||
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
||||
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
const nsRect& aDirtyRect,
|
||||
|
|
|
@ -73,7 +73,7 @@ nsFormControlFrame::GetBaseline() const
|
|||
return mRect.height - GetUsedBorderAndPadding().bottom;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsFormControlFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -86,7 +86,11 @@ nsFormControlFrame::Reflow(nsPresContext* aPresContext,
|
|||
RegUnRegAccessKey(static_cast<nsIFrame*>(this), true);
|
||||
}
|
||||
|
||||
nsLeafFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
|
||||
nsresult rv = nsLeafFrame::Reflow(aPresContext, aDesiredSize, aReflowState,
|
||||
aStatus);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (nsLayoutUtils::FontSizeInflationEnabled(aPresContext)) {
|
||||
float inflation = nsLayoutUtils::FontSizeInflationFor(this);
|
||||
|
@ -95,6 +99,7 @@ nsFormControlFrame::Reflow(nsPresContext* aPresContext,
|
|||
aDesiredSize.UnionOverflowAreasWithDesiredBounds();
|
||||
FinishAndStoreOverflow(&aDesiredSize);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
|
@ -51,10 +51,10 @@ public:
|
|||
* Respond to the request to resize and/or reflow
|
||||
* @see nsIFrame::Reflow
|
||||
*/
|
||||
virtual void Reflow(nsPresContext* aCX,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult Reflow(nsPresContext* aCX,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
||||
virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
|
||||
|
||||
|
|
|
@ -162,7 +162,7 @@ nsHTMLButtonControlFrame::GetPrefWidth(nsRenderingContext* aRenderingContext)
|
|||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsHTMLButtonControlFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -205,6 +205,7 @@ 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
|
||||
|
|
|
@ -34,10 +34,10 @@ public:
|
|||
|
||||
virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
|
||||
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult HandleEvent(nsPresContext* aPresContext,
|
||||
mozilla::WidgetGUIEvent* aEvent,
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
NS_DECL_QUERYFRAME
|
||||
NS_DECL_FRAMEARENA_HELPERS
|
||||
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
virtual nsresult Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
@ -124,7 +124,7 @@ nsImageControlFrame::GetType() const
|
|||
return nsGkAtoms::imageControlFrame;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsImageControlFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
|
|
@ -47,7 +47,7 @@ NS_QUERYFRAME_HEAD(nsLegendFrame)
|
|||
NS_QUERYFRAME_ENTRY(nsLegendFrame)
|
||||
NS_QUERYFRAME_TAIL_INHERITING(nsBlockFrame)
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsLegendFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
|
|
@ -17,10 +17,10 @@ public:
|
|||
|
||||
nsLegendFrame(nsStyleContext* aContext) : nsBlockFrame(aContext) {}
|
||||
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
||||
virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
|
||||
|
||||
|
|
|
@ -329,7 +329,7 @@ nsListControlFrame::GetMinWidth(nsRenderingContext *aRenderingContext)
|
|||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsListControlFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -358,8 +358,7 @@ nsListControlFrame::Reflow(nsPresContext* aPresContext,
|
|||
}
|
||||
|
||||
if (IsInDropDownMode()) {
|
||||
ReflowAsDropdown(aPresContext, aDesiredSize, aReflowState, aStatus);
|
||||
return;
|
||||
return ReflowAsDropdown(aPresContext, aDesiredSize, aReflowState, aStatus);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -399,7 +398,9 @@ nsListControlFrame::Reflow(nsPresContext* aPresContext,
|
|||
state.SetComputedHeight(computedHeight);
|
||||
}
|
||||
|
||||
nsHTMLScrollFrame::Reflow(aPresContext, aDesiredSize, state, aStatus);
|
||||
nsresult rv = nsHTMLScrollFrame::Reflow(aPresContext, aDesiredSize,
|
||||
state, aStatus);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (!mMightNeedSecondPass) {
|
||||
NS_ASSERTION(!autoHeight || HeightOfARow() == oldHeightOfARow,
|
||||
|
@ -425,7 +426,7 @@ nsListControlFrame::Reflow(nsPresContext* aPresContext,
|
|||
}
|
||||
}
|
||||
|
||||
return;
|
||||
return rv;
|
||||
}
|
||||
|
||||
mMightNeedSecondPass = false;
|
||||
|
@ -437,7 +438,7 @@ nsListControlFrame::Reflow(nsPresContext* aPresContext,
|
|||
NS_ASSERTION(!IsScrollbarUpdateSuppressed(),
|
||||
"Shouldn't be suppressing if the height of a row has not "
|
||||
"changed!");
|
||||
return;
|
||||
return rv;
|
||||
}
|
||||
|
||||
SetSuppressScrollbarUpdate(false);
|
||||
|
@ -460,10 +461,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....
|
||||
nsHTMLScrollFrame::Reflow(aPresContext, aDesiredSize, state, aStatus);
|
||||
return nsHTMLScrollFrame::Reflow(aPresContext, aDesiredSize, state, aStatus);
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsListControlFrame::ReflowAsDropdown(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -492,7 +493,9 @@ nsListControlFrame::ReflowAsDropdown(nsPresContext* aPresContext,
|
|||
state.SetComputedHeight(mLastDropdownComputedHeight);
|
||||
}
|
||||
|
||||
nsHTMLScrollFrame::Reflow(aPresContext, aDesiredSize, state, aStatus);
|
||||
nsresult rv = nsHTMLScrollFrame::Reflow(aPresContext, aDesiredSize,
|
||||
state, aStatus);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (!mMightNeedSecondPass) {
|
||||
NS_ASSERTION(oldVisibleHeight == GetScrolledFrame()->GetSize().height,
|
||||
|
@ -503,7 +506,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;
|
||||
return rv;
|
||||
}
|
||||
|
||||
mMightNeedSecondPass = false;
|
||||
|
@ -514,7 +517,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;
|
||||
return rv;
|
||||
}
|
||||
|
||||
SetSuppressScrollbarUpdate(false);
|
||||
|
@ -576,7 +579,7 @@ nsListControlFrame::ReflowAsDropdown(nsPresContext* aPresContext,
|
|||
mLastDropdownComputedHeight = state.ComputedHeight();
|
||||
|
||||
nsHTMLScrollFrame::WillReflow(aPresContext);
|
||||
nsHTMLScrollFrame::Reflow(aPresContext, aDesiredSize, state, aStatus);
|
||||
return nsHTMLScrollFrame::Reflow(aPresContext, aDesiredSize, state, aStatus);
|
||||
}
|
||||
|
||||
ScrollbarStyles
|
||||
|
@ -1434,15 +1437,16 @@ nsListControlFrame::AboutToRollup()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsListControlFrame::DidReflow(nsPresContext* aPresContext,
|
||||
const nsHTMLReflowState* aReflowState,
|
||||
nsDidReflowStatus aStatus)
|
||||
{
|
||||
nsresult rv;
|
||||
bool wasInterrupted = !mHasPendingInterruptAtStartOfReflow &&
|
||||
aPresContext->HasPendingInterrupt();
|
||||
|
||||
nsHTMLScrollFrame::DidReflow(aPresContext, aReflowState, aStatus);
|
||||
rv = nsHTMLScrollFrame::DidReflow(aPresContext, aReflowState, aStatus);
|
||||
|
||||
if (mNeedToReset && !wasInterrupted) {
|
||||
mNeedToReset = false;
|
||||
|
@ -1459,6 +1463,7 @@ nsListControlFrame::DidReflow(nsPresContext* aPresContext,
|
|||
}
|
||||
|
||||
mHasPendingInterruptAtStartOfReflow = false;
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsIAtom*
|
||||
|
|
|
@ -68,18 +68,18 @@ public:
|
|||
virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
|
||||
virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
|
||||
|
||||
virtual void Reflow(nsPresContext* aCX,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult Reflow(nsPresContext* aCX,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
||||
virtual void Init(nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame* aPrevInFlow) MOZ_OVERRIDE;
|
||||
|
||||
virtual void DidReflow(nsPresContext* aPresContext,
|
||||
const nsHTMLReflowState* aReflowState,
|
||||
nsDidReflowStatus aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult DidReflow(nsPresContext* aPresContext,
|
||||
const nsHTMLReflowState* aReflowState,
|
||||
nsDidReflowStatus aStatus) MOZ_OVERRIDE;
|
||||
virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
|
||||
|
||||
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
|
@ -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.
|
||||
*/
|
||||
void ReflowAsDropdown(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
nsresult ReflowAsDropdown(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
// Selection
|
||||
bool SetOptionsSelectedFromFrame(int32_t aStartIndex,
|
||||
|
|
|
@ -91,8 +91,7 @@ NS_QUERYFRAME_HEAD(nsMeterFrame)
|
|||
NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
|
||||
|
||||
|
||||
void
|
||||
nsMeterFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsresult nsMeterFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
|
@ -126,6 +125,8 @@ nsMeterFrame::Reflow(nsPresContext* aPresContext,
|
|||
aStatus = NS_FRAME_COMPLETE;
|
||||
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -27,10 +27,10 @@ public:
|
|||
|
||||
virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
|
||||
|
||||
virtual void Reflow(nsPresContext* aCX,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult Reflow(nsPresContext* aCX,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
||||
#ifdef DEBUG_FRAME_DUMP
|
||||
virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE {
|
||||
|
|
|
@ -99,7 +99,7 @@ nsNumberControlFrame::GetPrefWidth(nsRenderingContext* aRenderingContext)
|
|||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsNumberControlFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -150,8 +150,10 @@ nsNumberControlFrame::Reflow(nsPresContext* aPresContext,
|
|||
wrapperReflowState.ComputedPhysicalMargin().top;
|
||||
|
||||
nsReflowStatus childStatus;
|
||||
ReflowChild(outerWrapperFrame, aPresContext, wrappersDesiredSize,
|
||||
wrapperReflowState, xoffset, yoffset, 0, childStatus);
|
||||
nsresult rv = ReflowChild(outerWrapperFrame, aPresContext,
|
||||
wrappersDesiredSize, wrapperReflowState,
|
||||
xoffset, yoffset, 0, childStatus);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(childStatus),
|
||||
"We gave our child unconstrained height, so it should be complete");
|
||||
|
||||
|
@ -179,8 +181,10 @@ nsNumberControlFrame::Reflow(nsPresContext* aPresContext,
|
|||
yoffset += std::max(0, extraSpace / 2);
|
||||
|
||||
// Place the child
|
||||
FinishReflowChild(outerWrapperFrame, aPresContext, wrappersDesiredSize,
|
||||
&wrapperReflowState, xoffset, yoffset, 0);
|
||||
rv = FinishReflowChild(outerWrapperFrame, aPresContext,
|
||||
wrappersDesiredSize, &wrapperReflowState,
|
||||
xoffset, yoffset, 0);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
aDesiredSize.SetTopAscent(wrappersDesiredSize.TopAscent() +
|
||||
outerWrapperFrame->GetPosition().y);
|
||||
|
@ -202,6 +206,8 @@ nsNumberControlFrame::Reflow(nsPresContext* aPresContext,
|
|||
aStatus = NS_FRAME_COMPLETE;
|
||||
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -57,10 +57,10 @@ public:
|
|||
|
||||
virtual nscoord GetPrefWidth(nsRenderingContext* aRenderingContext) MOZ_OVERRIDE;
|
||||
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult AttributeChanged(int32_t aNameSpaceID,
|
||||
nsIAtom* aAttribute,
|
||||
|
|
|
@ -96,8 +96,7 @@ nsProgressFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
BuildDisplayListForInline(aBuilder, aDirtyRect, aLists);
|
||||
}
|
||||
|
||||
void
|
||||
nsProgressFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsresult nsProgressFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
|
@ -131,6 +130,8 @@ nsProgressFrame::Reflow(nsPresContext* aPresContext,
|
|||
aStatus = NS_FRAME_COMPLETE;
|
||||
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -32,10 +32,10 @@ public:
|
|||
const nsRect& aDirtyRect,
|
||||
const nsDisplayListSet& aLists) MOZ_OVERRIDE;
|
||||
|
||||
virtual void Reflow(nsPresContext* aCX,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult Reflow(nsPresContext* aCX,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
||||
#ifdef DEBUG_FRAME_DUMP
|
||||
virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE {
|
||||
|
|
|
@ -265,7 +265,7 @@ nsRangeFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
new (aBuilder) nsDisplayRangeFocusRing(aBuilder, this));
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsRangeFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -294,7 +294,9 @@ nsRangeFrame::Reflow(nsPresContext* aPresContext,
|
|||
aDesiredSize.Height() = computedHeight +
|
||||
aReflowState.ComputedPhysicalBorderPadding().TopBottom();
|
||||
|
||||
ReflowAnonymousContent(aPresContext, aDesiredSize, aReflowState);
|
||||
nsresult rv =
|
||||
ReflowAnonymousContent(aPresContext, aDesiredSize, aReflowState);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
||||
|
||||
|
@ -318,9 +320,11 @@ nsRangeFrame::Reflow(nsPresContext* aPresContext,
|
|||
aStatus = NS_FRAME_COMPLETE;
|
||||
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsRangeFrame::ReflowAnonymousContent(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState)
|
||||
|
@ -366,12 +370,14 @@ nsRangeFrame::ReflowAnonymousContent(nsPresContext* aPresContext,
|
|||
|
||||
nsReflowStatus frameStatus;
|
||||
nsHTMLReflowMetrics trackDesiredSize(aReflowState);
|
||||
ReflowChild(trackFrame, aPresContext, trackDesiredSize,
|
||||
trackReflowState, trackX, trackY, 0, frameStatus);
|
||||
nsresult rv = ReflowChild(trackFrame, aPresContext, trackDesiredSize,
|
||||
trackReflowState, trackX, trackY, 0, frameStatus);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(frameStatus),
|
||||
"We gave our child unconstrained height, so it should be complete");
|
||||
FinishReflowChild(trackFrame, aPresContext, trackDesiredSize,
|
||||
&trackReflowState, trackX, trackY, 0);
|
||||
rv = FinishReflowChild(trackFrame, aPresContext, trackDesiredSize,
|
||||
&trackReflowState, trackX, trackY, 0);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
nsIFrame* thumbFrame = mThumbDiv->GetPrimaryFrame();
|
||||
|
@ -386,12 +392,15 @@ nsRangeFrame::ReflowAnonymousContent(nsPresContext* aPresContext,
|
|||
|
||||
nsReflowStatus frameStatus;
|
||||
nsHTMLReflowMetrics thumbDesiredSize(aReflowState);
|
||||
ReflowChild(thumbFrame, aPresContext, thumbDesiredSize,
|
||||
thumbReflowState, 0, 0, 0, frameStatus);
|
||||
nsresult rv = ReflowChild(thumbFrame, aPresContext, thumbDesiredSize,
|
||||
thumbReflowState, 0, 0, 0, frameStatus);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(frameStatus),
|
||||
"We gave our child unconstrained height, so it should be complete");
|
||||
FinishReflowChild(thumbFrame, aPresContext, thumbDesiredSize,
|
||||
&thumbReflowState, 0, 0, 0);
|
||||
rv = FinishReflowChild(thumbFrame, aPresContext, thumbDesiredSize,
|
||||
&thumbReflowState, 0, 0, 0);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
DoUpdateThumbPosition(thumbFrame, nsSize(aDesiredSize.Width(),
|
||||
aDesiredSize.Height()));
|
||||
}
|
||||
|
@ -410,16 +419,21 @@ nsRangeFrame::ReflowAnonymousContent(nsPresContext* aPresContext,
|
|||
|
||||
nsReflowStatus frameStatus;
|
||||
nsHTMLReflowMetrics progressDesiredSize(aReflowState);
|
||||
ReflowChild(rangeProgressFrame, aPresContext,
|
||||
progressDesiredSize, progressReflowState, 0, 0,
|
||||
0, frameStatus);
|
||||
nsresult rv = ReflowChild(rangeProgressFrame, aPresContext,
|
||||
progressDesiredSize, progressReflowState, 0, 0,
|
||||
0, frameStatus);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(frameStatus),
|
||||
"We gave our child unconstrained height, so it should be complete");
|
||||
FinishReflowChild(rangeProgressFrame, aPresContext,
|
||||
progressDesiredSize, &progressReflowState, 0, 0, 0);
|
||||
rv = FinishReflowChild(rangeProgressFrame, aPresContext,
|
||||
progressDesiredSize, &progressReflowState, 0, 0, 0);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
DoUpdateRangeProgressFrame(rangeProgressFrame, nsSize(aDesiredSize.Width(),
|
||||
aDesiredSize.Height()));
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
|
|
|
@ -45,10 +45,10 @@ public:
|
|||
const nsRect& aDirtyRect,
|
||||
const nsDisplayListSet& aLists) MOZ_OVERRIDE;
|
||||
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult 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<ContentInfo>& aElements);
|
||||
|
||||
// Helper function which reflows the anonymous div frames.
|
||||
void ReflowAnonymousContent(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState);
|
||||
nsresult ReflowAnonymousContent(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState);
|
||||
|
||||
void DoUpdateThumbPosition(nsIFrame* aThumbFrame,
|
||||
const nsSize& aRangeSize);
|
||||
|
|
|
@ -151,7 +151,7 @@ nsSelectsAreaFrame::BuildDisplayListInternal(nsDisplayListBuilder* aBuilder,
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsSelectsAreaFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -177,7 +177,9 @@ nsSelectsAreaFrame::Reflow(nsPresContext* aPresContext,
|
|||
}
|
||||
}
|
||||
|
||||
nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
|
||||
nsresult rv = nsBlockFrame::Reflow(aPresContext, aDesiredSize,
|
||||
aReflowState, aStatus);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// 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.
|
||||
|
@ -193,4 +195,6 @@ nsSelectsAreaFrame::Reflow(nsPresContext* aPresContext,
|
|||
list->SetSuppressScrollbarUpdate(true);
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -23,10 +23,10 @@ public:
|
|||
const nsRect& aDirtyRect,
|
||||
const nsDisplayListSet& aLists);
|
||||
|
||||
virtual void Reflow(nsPresContext* aCX,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult Reflow(nsPresContext* aCX,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
||||
nscoord HeightOfARow() const { return mHeightOfARow; }
|
||||
|
||||
|
|
|
@ -462,7 +462,7 @@ nsTextControlFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
|||
return autoSize;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsTextControlFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -490,8 +490,10 @@ nsTextControlFrame::Reflow(nsPresContext* aPresContext,
|
|||
NS_AUTOHEIGHT, inflation);
|
||||
}
|
||||
nsRefPtr<nsFontMetrics> fontMet;
|
||||
nsLayoutUtils::GetFontMetricsForFrame(this, getter_AddRefs(fontMet),
|
||||
inflation);
|
||||
nsresult rv = nsLayoutUtils::GetFontMetricsForFrame(this,
|
||||
getter_AddRefs(fontMet),
|
||||
inflation);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
// now adjust for our borders and padding
|
||||
aDesiredSize.SetTopAscent(
|
||||
nsLayoutUtils::GetCenteredFontBaseline(fontMet, lineHeight)
|
||||
|
@ -511,6 +513,7 @@ nsTextControlFrame::Reflow(nsPresContext* aPresContext,
|
|||
|
||||
aStatus = NS_FRAME_COMPLETE;
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -50,10 +50,10 @@ public:
|
|||
nsSize aMargin, nsSize aBorder,
|
||||
nsSize aPadding, bool aShrinkWrap) MOZ_OVERRIDE;
|
||||
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
||||
virtual nsSize GetMinSize(nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE;
|
||||
virtual bool IsCollapsed() MOZ_OVERRIDE;
|
||||
|
|
|
@ -108,7 +108,7 @@ nsAbsoluteContainingBlock::RemoveFrame(nsIFrame* aDelegatingFrame,
|
|||
mAbsoluteFrames.DestroyFrame(aOldFrame);
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsAbsoluteContainingBlock::Reflow(nsContainerFrame* aDelegatingFrame,
|
||||
nsPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -193,6 +193,7 @@ nsAbsoluteContainingBlock::Reflow(nsContainerFrame* aDelegatingFrame,
|
|||
NS_FRAME_SET_OVERFLOW_INCOMPLETE(reflowStatus);
|
||||
|
||||
NS_MergeReflowStatusInto(&aReflowStatus, reflowStatus);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
static inline bool IsFixedPaddingSize(const nsStyleCoord& aCoord)
|
||||
|
@ -342,7 +343,7 @@ nsAbsoluteContainingBlock::DoMarkFramesDirty(bool aMarkAllDirty)
|
|||
// mChildListID == kFixedList, the height is unconstrained.
|
||||
// since we don't allow replicated frames to split.
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegatingFrame,
|
||||
nsPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -411,7 +412,7 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat
|
|||
}
|
||||
|
||||
// Do the reflow
|
||||
aKidFrame->Reflow(aPresContext, kidDesiredSize, kidReflowState, aStatus);
|
||||
nsresult rv = aKidFrame->Reflow(aPresContext, kidDesiredSize, kidReflowState, aStatus);
|
||||
|
||||
// If we're solving for 'left' or 'top', then compute it now that we know the
|
||||
// width/height
|
||||
|
@ -496,4 +497,6 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat
|
|||
if (aOverflowAreas) {
|
||||
aOverflowAreas->UnionWith(kidDesiredSize.mOverflowAreas + rect.TopLeft());
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -82,15 +82,15 @@ public:
|
|||
* status of the delegating frame's main reflow. This function merges in the
|
||||
* statuses of the absolutely positioned children's reflows.
|
||||
*/
|
||||
void Reflow(nsContainerFrame* aDelegatingFrame,
|
||||
nsPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aReflowStatus,
|
||||
const nsRect& aContainingBlock,
|
||||
bool aConstrainHeight,
|
||||
bool aCBWidthChanged,
|
||||
bool aCBHeightChanged,
|
||||
nsOverflowAreas* aOverflowAreas);
|
||||
nsresult Reflow(nsContainerFrame* aDelegatingFrame,
|
||||
nsPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aReflowStatus,
|
||||
const nsRect& aContainingBlock,
|
||||
bool aConstrainHeight,
|
||||
bool aCBWidthChanged,
|
||||
bool aCBHeightChanged,
|
||||
nsOverflowAreas* aOverflowAreas);
|
||||
|
||||
void DestroyFrames(nsIFrame* aDelegatingFrame,
|
||||
nsIFrame* aDestructRoot);
|
||||
|
@ -117,14 +117,14 @@ protected:
|
|||
bool FrameDependsOnContainer(nsIFrame* aFrame, bool aCBWidthChanged,
|
||||
bool aCBHeightChanged);
|
||||
|
||||
void ReflowAbsoluteFrame(nsIFrame* aDelegatingFrame,
|
||||
nsPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
const nsRect& aContainingBlockRect,
|
||||
bool aConstrainHeight,
|
||||
nsIFrame* aKidFrame,
|
||||
nsReflowStatus& aStatus,
|
||||
nsOverflowAreas* aOverflowAreas);
|
||||
nsresult ReflowAbsoluteFrame(nsIFrame* aDelegatingFrame,
|
||||
nsPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
const nsRect& aContainingBlockRect,
|
||||
bool aConstrainHeight,
|
||||
nsIFrame* aKidFrame,
|
||||
nsReflowStatus& aStatus,
|
||||
nsOverflowAreas* aOverflowAreas);
|
||||
|
||||
/**
|
||||
* Mark our absolute frames dirty.
|
||||
|
|
|
@ -35,7 +35,7 @@ public:
|
|||
bool aIsKeyboardSelect, int32_t* aOffset,
|
||||
PeekWordState* aState) MOZ_OVERRIDE;
|
||||
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
virtual nsresult Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
@ -77,7 +77,7 @@ BRFrame::~BRFrame()
|
|||
{
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
BRFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -154,6 +154,7 @@ BRFrame::Reflow(nsPresContext* aPresContext,
|
|||
mAscent = aMetrics.TopAscent();
|
||||
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aMetrics);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* virtual */ void
|
||||
|
|
|
@ -933,7 +933,7 @@ CalculateContainingBlockSizeForAbsolutes(const nsHTMLReflowState& aReflowState,
|
|||
return cbSize;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -1009,7 +1009,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
|||
ClearLineCursor();
|
||||
|
||||
if (IsFrameTreeTooDeep(*reflowState, aMetrics, aStatus)) {
|
||||
return;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
bool topMarginRoot, bottomMarginRoot;
|
||||
|
@ -1028,6 +1028,8 @@ 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.
|
||||
|
@ -1064,7 +1066,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
|||
mState &= ~NS_FRAME_FIRST_REFLOW;
|
||||
|
||||
// Now reflow...
|
||||
ReflowDirtyLines(state);
|
||||
rv = 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
|
||||
|
@ -1086,6 +1088,9 @@ 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);
|
||||
|
||||
|
@ -1290,6 +1295,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
|||
#endif
|
||||
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, (*reflowState), aMetrics);
|
||||
return rv;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -1846,9 +1852,13 @@ static void DumpLine(const nsBlockReflowState& aState, nsLineBox* aLine,
|
|||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
/**
|
||||
* Reflow the dirty lines
|
||||
*/
|
||||
nsresult
|
||||
nsBlockFrame::ReflowDirtyLines(nsBlockReflowState& aState)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
bool keepGoing = true;
|
||||
bool repositionViews = false; // should we really need this?
|
||||
bool foundAnyClears = aState.mFloatBreakType != NS_STYLE_CLEAR_NONE;
|
||||
|
@ -2063,7 +2073,8 @@ nsBlockFrame::ReflowDirtyLines(nsBlockReflowState& aState)
|
|||
|
||||
// Reflow the dirty line. If it's an incremental reflow, then force
|
||||
// it to invalidate the dirty area if necessary
|
||||
ReflowLine(aState, line, &keepGoing);
|
||||
rv = ReflowLine(aState, line, &keepGoing);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (aState.mReflowState.WillReflowAgainForClearance()) {
|
||||
line->MarkDirty();
|
||||
|
@ -2348,7 +2359,8 @@ nsBlockFrame::ReflowDirtyLines(nsBlockReflowState& aState)
|
|||
// line to be created; see SplitLine's callers for examples of
|
||||
// when this happens).
|
||||
while (line != end_lines()) {
|
||||
ReflowLine(aState, line, &keepGoing);
|
||||
rv = ReflowLine(aState, line, &keepGoing);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (aState.mReflowState.WillReflowAgainForClearance()) {
|
||||
line->MarkDirty();
|
||||
|
@ -2443,6 +2455,8 @@ nsBlockFrame::ReflowDirtyLines(nsBlockReflowState& aState)
|
|||
aState.mReflowStatus);
|
||||
}
|
||||
#endif
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
static void MarkAllDescendantLinesDirty(nsBlockFrame* aBlock)
|
||||
|
@ -2524,11 +2538,13 @@ nsBlockFrame::DeleteLine(nsBlockReflowState& aState,
|
|||
* or contain 1 or more inline frames. aKeepReflowGoing indicates
|
||||
* whether or not the caller should continue to reflow more lines.
|
||||
*/
|
||||
void
|
||||
nsresult
|
||||
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
|
||||
|
@ -2539,11 +2555,13 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState,
|
|||
|
||||
// Now that we know what kind of line we have, reflow it
|
||||
if (aLine->IsBlock()) {
|
||||
ReflowBlockFrame(aState, aLine, aKeepReflowGoing);
|
||||
rv = ReflowBlockFrame(aState, aLine, aKeepReflowGoing);
|
||||
} else {
|
||||
aLine->SetLineWrapped(false);
|
||||
ReflowInlineFrames(aState, aLine, aKeepReflowGoing);
|
||||
rv = ReflowInlineFrames(aState, aLine, aKeepReflowGoing);
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsIFrame*
|
||||
|
@ -2857,17 +2875,19 @@ nsBlockFrame::ShouldApplyTopMargin(nsBlockReflowState& aState,
|
|||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
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;
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
// Prepare the block reflow engine
|
||||
|
@ -2928,7 +2948,7 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
|
|||
aState.mPrevChild = frame;
|
||||
// Exactly what we do now is flexible since we'll definitely be
|
||||
// reflowed.
|
||||
return;
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
if (treatWithClearance) {
|
||||
|
@ -3082,7 +3102,7 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
|
|||
PushLines(aState, aLine.prev());
|
||||
NS_FRAME_SET_INCOMPLETE(aState.mReflowStatus);
|
||||
}
|
||||
return;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Now put the Y coordinate back to the top of the top-margin +
|
||||
|
@ -3109,9 +3129,11 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
|
|||
}
|
||||
|
||||
nsReflowStatus frameReflowStatus = NS_FRAME_COMPLETE;
|
||||
brc.ReflowBlock(availSpace, applyTopMargin, aState.mPrevBottomMargin,
|
||||
rv = 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);
|
||||
|
@ -3130,7 +3152,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;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#if defined(REFLOW_STATUS_COVERAGE)
|
||||
|
@ -3202,10 +3224,8 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
|
|||
nsOverflowContinuationTracker::AutoFinish fini(aState.mOverflowTracker, frame);
|
||||
nsContainerFrame* parent =
|
||||
static_cast<nsContainerFrame*>(nextFrame->GetParent());
|
||||
nsresult rv = parent->StealFrame(nextFrame);
|
||||
if (NS_FAILED(rv)) {
|
||||
return;
|
||||
}
|
||||
rv = parent->StealFrame(nextFrame);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (parent != this)
|
||||
ReparentFrame(nextFrame, parent, this);
|
||||
mFrames.InsertFrame(nullptr, frame, nextFrame);
|
||||
|
@ -3271,10 +3291,8 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
|
|||
// to dig it out of the child lists.
|
||||
nsContainerFrame* parent = static_cast<nsContainerFrame*>
|
||||
(nextFrame->GetParent());
|
||||
nsresult rv = parent->StealFrame(nextFrame);
|
||||
if (NS_FAILED(rv)) {
|
||||
return;
|
||||
}
|
||||
rv = parent->StealFrame(nextFrame);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
else if (madeContinuation) {
|
||||
mFrames.RemoveFrame(nextFrame);
|
||||
|
@ -3341,13 +3359,15 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
|
|||
#ifdef DEBUG
|
||||
VerifyLines(true);
|
||||
#endif
|
||||
return rv;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsBlockFrame::ReflowInlineFrames(nsBlockReflowState& aState,
|
||||
line_iterator aLine,
|
||||
bool* aKeepReflowGoing)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
*aKeepReflowGoing = true;
|
||||
|
||||
aLine->SetLineIsImpactedByFloat(false);
|
||||
|
@ -3385,12 +3405,16 @@ nsBlockFrame::ReflowInlineFrames(nsBlockReflowState& aState,
|
|||
if (forceBreakInContent) {
|
||||
lineLayout.ForceBreakAtPosition(forceBreakInContent, forceBreakOffset);
|
||||
}
|
||||
DoReflowInlineFrames(aState, lineLayout, aLine,
|
||||
floatAvailableSpace, availableSpaceHeight,
|
||||
&floatManagerState, aKeepReflowGoing,
|
||||
&lineReflowStatus, allowPullUp);
|
||||
rv = 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) {
|
||||
|
@ -3415,6 +3439,8 @@ 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
|
||||
|
@ -3435,7 +3461,7 @@ static const char* LineReflowStatusNames[] = {
|
|||
};
|
||||
#endif
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsBlockFrame::DoReflowInlineFrames(nsBlockReflowState& aState,
|
||||
nsLineLayout& aLineLayout,
|
||||
line_iterator aLine,
|
||||
|
@ -3499,6 +3525,7 @@ 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;
|
||||
|
@ -3515,7 +3542,9 @@ nsBlockFrame::DoReflowInlineFrames(nsBlockReflowState& aState,
|
|||
// count can change during the loop!
|
||||
for (i = 0; LINE_REFLOW_OK == lineReflowStatus && i < aLine->GetChildCount();
|
||||
i++, frame = frame->GetNextSibling()) {
|
||||
ReflowInlineFrame(aState, aLineLayout, aLine, frame, &lineReflowStatus);
|
||||
rv = ReflowInlineFrame(aState, aLineLayout, aLine, frame,
|
||||
&lineReflowStatus);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
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
|
||||
|
@ -3548,7 +3577,9 @@ nsBlockFrame::DoReflowInlineFrames(nsBlockReflowState& aState,
|
|||
|
||||
while (LINE_REFLOW_OK == lineReflowStatus) {
|
||||
int32_t oldCount = aLine->GetChildCount();
|
||||
ReflowInlineFrame(aState, aLineLayout, aLine, frame, &lineReflowStatus);
|
||||
rv = ReflowInlineFrame(aState, aLineLayout, aLine, frame,
|
||||
&lineReflowStatus);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (aLine->GetChildCount() != oldCount) {
|
||||
// We just created a continuation for aFrame AND its going
|
||||
// to end up on this line (e.g. :first-letter
|
||||
|
@ -3680,6 +3711,8 @@ nsBlockFrame::DoReflowInlineFrames(nsBlockReflowState& aState,
|
|||
}
|
||||
|
||||
*aLineReflowStatus = lineReflowStatus;
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3690,17 +3723,14 @@ 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.
|
||||
*/
|
||||
void
|
||||
nsresult
|
||||
nsBlockFrame::ReflowInlineFrame(nsBlockReflowState& aState,
|
||||
nsLineLayout& aLineLayout,
|
||||
line_iterator aLine,
|
||||
nsIFrame* aFrame,
|
||||
LineReflowStatus* aLineReflowStatus)
|
||||
{
|
||||
if (!aFrame) { // XXX change to MOZ_ASSERT(aFrame)
|
||||
NS_ERROR("why call me?");
|
||||
return;
|
||||
}
|
||||
NS_ENSURE_ARG_POINTER(aFrame);
|
||||
|
||||
*aLineReflowStatus = LINE_REFLOW_OK;
|
||||
|
||||
|
@ -3715,12 +3745,15 @@ nsBlockFrame::ReflowInlineFrame(nsBlockReflowState& aState,
|
|||
// Reflow the inline frame
|
||||
nsReflowStatus frameReflowStatus;
|
||||
bool pushedFrame;
|
||||
aLineLayout.ReflowFrame(aFrame, frameReflowStatus, nullptr, pushedFrame);
|
||||
nsresult rv = aLineLayout.ReflowFrame(aFrame, frameReflowStatus,
|
||||
nullptr, pushedFrame);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
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);
|
||||
|
@ -3829,6 +3862,8 @@ nsBlockFrame::ReflowInlineFrame(nsBlockReflowState& aState,
|
|||
SplitLine(aState, aLineLayout, aLine, aFrame->GetNextSibling(), aLineReflowStatus);
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -5754,7 +5789,7 @@ nsBlockFrame::ComputeFloatWidth(nsBlockReflowState& aState,
|
|||
floatRS.ComputedPhysicalMargin().LeftRight();
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsBlockFrame::ReflowFloat(nsBlockReflowState& aState,
|
||||
const nsRect& aAdjustedAvailableSpace,
|
||||
nsIFrame* aFloat,
|
||||
|
@ -5801,6 +5836,7 @@ nsBlockFrame::ReflowFloat(nsBlockReflowState& aState,
|
|||
bool isAdjacentWithTop = aState.IsAdjacentWithTop();
|
||||
|
||||
nsIFrame* clearanceFrame = nullptr;
|
||||
nsresult rv;
|
||||
do {
|
||||
nsCollapsingMargin margin;
|
||||
bool mayNeedRetry = false;
|
||||
|
@ -5817,11 +5853,11 @@ nsBlockFrame::ReflowFloat(nsBlockReflowState& aState,
|
|||
}
|
||||
}
|
||||
|
||||
brc.ReflowBlock(aAdjustedAvailableSpace, true, margin,
|
||||
0, isAdjacentWithTop,
|
||||
nullptr, floatRS,
|
||||
aReflowStatus, aState);
|
||||
} while (clearanceFrame);
|
||||
rv = brc.ReflowBlock(aAdjustedAvailableSpace, true, margin,
|
||||
0, isAdjacentWithTop,
|
||||
nullptr, floatRS,
|
||||
aReflowStatus, aState);
|
||||
} while (NS_SUCCEEDED(rv) && clearanceFrame);
|
||||
|
||||
if (!NS_FRAME_IS_FULLY_COMPLETE(aReflowStatus) &&
|
||||
ShouldAvoidBreakInside(floatRS)) {
|
||||
|
@ -5845,6 +5881,10 @@ 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();
|
||||
|
@ -5872,6 +5912,8 @@ nsBlockFrame::ReflowFloat(nsBlockReflowState& aState,
|
|||
printf("end ReflowFloat %p, sized to %d,%d\n",
|
||||
aFloat, metrics.Width(), metrics.Height());
|
||||
#endif
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
uint8_t
|
||||
|
|
|
@ -261,10 +261,10 @@ public:
|
|||
nsHTMLReflowMetrics& aMetrics,
|
||||
nscoord aConsumed);
|
||||
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult AttributeChanged(int32_t aNameSpaceID,
|
||||
nsIAtom* aAttribute,
|
||||
|
@ -580,7 +580,7 @@ protected:
|
|||
void PrepareResizeReflow(nsBlockReflowState& aState);
|
||||
|
||||
/** reflow all lines that have been marked dirty */
|
||||
void ReflowDirtyLines(nsBlockReflowState& aState);
|
||||
nsresult ReflowDirtyLines(nsBlockReflowState& aState);
|
||||
|
||||
/** Mark a given line dirty due to reflow being interrupted on or before it */
|
||||
void MarkLineDirtyForInterrupt(nsLineBox* aLine);
|
||||
|
@ -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
|
||||
*/
|
||||
void ReflowLine(nsBlockReflowState& aState,
|
||||
line_iterator aLine,
|
||||
bool* aKeepReflowGoing);
|
||||
nsresult 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);
|
||||
|
||||
void ReflowBlockFrame(nsBlockReflowState& aState,
|
||||
line_iterator aLine,
|
||||
bool* aKeepGoing);
|
||||
|
||||
void ReflowInlineFrames(nsBlockReflowState& aState,
|
||||
line_iterator aLine,
|
||||
bool* aKeepLineGoing);
|
||||
|
||||
void DoReflowInlineFrames(nsBlockReflowState& aState,
|
||||
nsLineLayout& aLineLayout,
|
||||
nsresult ReflowBlockFrame(nsBlockReflowState& aState,
|
||||
line_iterator aLine,
|
||||
nsFlowAreaRect& aFloatAvailableSpace,
|
||||
nscoord& aAvailableSpaceHeight,
|
||||
nsFloatManager::SavedState*
|
||||
aFloatStateBeforeLine,
|
||||
bool* aKeepReflowGoing,
|
||||
LineReflowStatus* aLineReflowStatus,
|
||||
bool aAllowPullUp);
|
||||
bool* aKeepGoing);
|
||||
|
||||
void ReflowInlineFrame(nsBlockReflowState& aState,
|
||||
nsLineLayout& aLineLayout,
|
||||
line_iterator aLine,
|
||||
nsIFrame* aFrame,
|
||||
LineReflowStatus* aLineReflowStatus);
|
||||
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);
|
||||
|
||||
// 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.
|
||||
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);
|
||||
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);
|
||||
|
||||
//----------------------------------------
|
||||
// Methods for pushing/pulling lines/frames
|
||||
|
|
|
@ -195,7 +195,7 @@ nsBlockReflowContext::ComputeCollapsedTopMargin(const nsHTMLReflowState& aRS,
|
|||
return dirtiedLine;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsBlockReflowContext::ReflowBlock(const nsRect& aSpace,
|
||||
bool aApplyTopMargin,
|
||||
nsCollapsingMargin& aPrevMargin,
|
||||
|
@ -206,6 +206,7 @@ nsBlockReflowContext::ReflowBlock(const nsRect& aSpace,
|
|||
nsReflowStatus& aFrameReflowStatus,
|
||||
nsBlockReflowState& aState)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
mFrame = aFrameRS.frame;
|
||||
mSpace = aSpace;
|
||||
|
||||
|
@ -257,7 +258,7 @@ nsBlockReflowContext::ReflowBlock(const nsRect& aSpace,
|
|||
#endif
|
||||
|
||||
mOuterReflowState.mFloatManager->Translate(tx, ty);
|
||||
mFrame->Reflow(mPresContext, mMetrics, aFrameRS, aFrameReflowStatus);
|
||||
rv = mFrame->Reflow(mPresContext, mMetrics, aFrameRS, aFrameReflowStatus);
|
||||
mOuterReflowState.mFloatManager->Translate(-tx, -ty);
|
||||
|
||||
#ifdef DEBUG
|
||||
|
@ -300,6 +301,8 @@ nsBlockReflowContext::ReflowBlock(const nsRect& aSpace,
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -28,15 +28,15 @@ public:
|
|||
const nsHTMLReflowState& aParentRS);
|
||||
~nsBlockReflowContext() { }
|
||||
|
||||
void ReflowBlock(const nsRect& aSpace,
|
||||
bool aApplyTopMargin,
|
||||
nsCollapsingMargin& aPrevMargin,
|
||||
nscoord aClearance,
|
||||
bool aIsAdjacentWithTop,
|
||||
nsLineBox* aLine,
|
||||
nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aReflowStatus,
|
||||
nsBlockReflowState& aState);
|
||||
nsresult 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,
|
||||
|
|
|
@ -1653,7 +1653,7 @@ nsBulletFrame::GetDesiredSize(nsPresContext* aCX,
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsBulletFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -1694,6 +1694,7 @@ nsBulletFrame::Reflow(nsPresContext* aPresContext,
|
|||
|
||||
aStatus = NS_FRAME_COMPLETE;
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aMetrics);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* virtual */ nscoord
|
||||
|
|
|
@ -65,10 +65,10 @@ public:
|
|||
#endif
|
||||
|
||||
// nsIHTMLReflow
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult 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;
|
||||
|
||||
|
|
|
@ -453,7 +453,7 @@ nsCanvasFrame::GetPrefWidth(nsRenderingContext *aRenderingContext)
|
|||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsCanvasFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -585,6 +585,7 @@ nsCanvasFrame::Reflow(nsPresContext* aPresContext,
|
|||
|
||||
NS_FRAME_TRACE_REFLOW_OUT("nsCanvasFrame::Reflow", aStatus);
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsIAtom*
|
||||
|
|
|
@ -52,10 +52,10 @@ public:
|
|||
|
||||
virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
|
||||
virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult 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 &
|
||||
|
|
|
@ -949,7 +949,7 @@ nsColumnSetFrame::FindBestBalanceHeight(const nsHTMLReflowState& aReflowState,
|
|||
aRunWasFeasible = feasible;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsColumnSetFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -1019,6 +1019,8 @@ 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
|
||||
|
|
|
@ -17,10 +17,10 @@ public:
|
|||
virtual nsresult SetInitialChildList(ChildListID aListID,
|
||||
nsFrameList& aChildList) MOZ_OVERRIDE;
|
||||
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult AppendFrames(ChildListID aListID,
|
||||
nsFrameList& aFrameList) MOZ_OVERRIDE;
|
||||
|
|
|
@ -932,7 +932,7 @@ nsContainerFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
|||
* requested), and then calls Reflow(). If the reflow succeeds and the child
|
||||
* frame is complete, deletes any next-in-flows using DeleteNextInFlowChild()
|
||||
*/
|
||||
void
|
||||
nsresult
|
||||
nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
|
||||
nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
|
@ -945,6 +945,8 @@ 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);
|
||||
|
@ -958,11 +960,12 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
|
|||
}
|
||||
|
||||
// Reflow the child frame
|
||||
aKidFrame->Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
|
||||
result = aKidFrame->Reflow(aPresContext, aDesiredSize, aReflowState,
|
||||
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) &&
|
||||
// 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) &&
|
||||
!(aFlags & NS_FRAME_NO_DELETE_NEXT_IN_FLOW_CHILD)) {
|
||||
nsIFrame* kidNextInFlow = aKidFrame->GetNextInFlow();
|
||||
if (kidNextInFlow) {
|
||||
|
@ -974,6 +977,7 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
|
|||
->DeleteNextInFlowChild(kidNextInFlow, true);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1029,7 +1033,7 @@ nsContainerFrame::PositionChildViews(nsIFrame* aFrame)
|
|||
* don't want to automatically sync the frame and view
|
||||
* NS_FRAME_NO_SIZE_VIEW - don't size the frame's view
|
||||
*/
|
||||
void
|
||||
nsresult
|
||||
nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
|
||||
nsPresContext* aPresContext,
|
||||
const nsHTMLReflowMetrics& aDesiredSize,
|
||||
|
@ -1063,10 +1067,10 @@ nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
|
|||
}
|
||||
}
|
||||
|
||||
aKidFrame->DidReflow(aPresContext, aReflowState, nsDidReflowStatus::FINISHED);
|
||||
return aKidFrame->DidReflow(aPresContext, aReflowState, nsDidReflowStatus::FINISHED);
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsOverflowAreas& aOverflowRects,
|
||||
|
@ -1074,6 +1078,7 @@ nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext* aPres
|
|||
nsReflowStatus& aStatus)
|
||||
{
|
||||
NS_PRECONDITION(aPresContext, "null pointer");
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
nsFrameList* overflowContainers =
|
||||
GetPropTableFrames(OverflowContainersProperty());
|
||||
|
@ -1112,7 +1117,7 @@ nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext* aPres
|
|||
}
|
||||
}
|
||||
if (!overflowContainers) {
|
||||
return; // nothing to reflow
|
||||
return NS_OK; // nothing to reflow
|
||||
}
|
||||
|
||||
nsOverflowContinuationTracker tracker(this, false, false);
|
||||
|
@ -1144,12 +1149,14 @@ nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext* aPres
|
|||
nsReflowStatus frameStatus;
|
||||
|
||||
// Reflow
|
||||
ReflowChild(frame, aPresContext, desiredSize, frameState,
|
||||
prevRect.x, 0, aFlags, frameStatus, &tracker);
|
||||
rv = ReflowChild(frame, aPresContext, desiredSize, frameState,
|
||||
prevRect.x, 0, aFlags, frameStatus, &tracker);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
//XXXfr Do we need to override any shrinkwrap effects here?
|
||||
// e.g. desiredSize.Width() = prevRect.width;
|
||||
FinishReflowChild(frame, aPresContext, desiredSize, &frameState,
|
||||
prevRect.x, 0, aFlags);
|
||||
rv = FinishReflowChild(frame, aPresContext, desiredSize, &frameState,
|
||||
prevRect.x, 0, aFlags);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Handle continuations
|
||||
if (!NS_FRAME_IS_FULLY_COMPLETE(frameStatus)) {
|
||||
|
@ -1173,11 +1180,9 @@ nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext* aPres
|
|||
}
|
||||
else if (!(nif->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER)) {
|
||||
// used to be a normal next-in-flow; steal it from the child list
|
||||
nsresult rv = static_cast<nsContainerFrame*>(nif->GetParent())
|
||||
rv = static_cast<nsContainerFrame*>(nif->GetParent())
|
||||
->StealFrame(nif);
|
||||
if (NS_FAILED(rv)) {
|
||||
return;
|
||||
}
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
tracker.Insert(nif, frameStatus);
|
||||
|
@ -1194,6 +1199,8 @@ nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext* aPres
|
|||
}
|
||||
ConsiderChildOverflow(aOverflowRects, frame);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -190,15 +190,15 @@ public:
|
|||
* NS_FRAME_NO_MOVE_FRAME - don't move the frame. aX and aY are ignored in this
|
||||
* case. Also implies NS_FRAME_NO_MOVE_VIEW
|
||||
*/
|
||||
void ReflowChild(nsIFrame* aKidFrame,
|
||||
nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nscoord aX,
|
||||
nscoord aY,
|
||||
uint32_t aFlags,
|
||||
nsReflowStatus& aStatus,
|
||||
nsOverflowContinuationTracker* aTracker = nullptr);
|
||||
nsresult ReflowChild(nsIFrame* aKidFrame,
|
||||
nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nscoord aX,
|
||||
nscoord aY,
|
||||
uint32_t aFlags,
|
||||
nsReflowStatus& aStatus,
|
||||
nsOverflowContinuationTracker* aTracker = nullptr);
|
||||
|
||||
/**
|
||||
* The second half of frame reflow. Does the following:
|
||||
|
@ -217,13 +217,13 @@ public:
|
|||
* don't want to automatically sync the frame and view
|
||||
* NS_FRAME_NO_SIZE_VIEW - don't size the frame's view
|
||||
*/
|
||||
static void FinishReflowChild(nsIFrame* aKidFrame,
|
||||
nsPresContext* aPresContext,
|
||||
const nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState* aReflowState,
|
||||
nscoord aX,
|
||||
nscoord aY,
|
||||
uint32_t aFlags);
|
||||
static nsresult FinishReflowChild(nsIFrame* aKidFrame,
|
||||
nsPresContext* aPresContext,
|
||||
const nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState* aReflowState,
|
||||
nscoord aX,
|
||||
nscoord aY,
|
||||
uint32_t aFlags);
|
||||
|
||||
|
||||
static void PositionChildViews(nsIFrame* aFrame);
|
||||
|
@ -291,11 +291,11 @@ public:
|
|||
*
|
||||
* (aFlags just gets passed through to ReflowChild)
|
||||
*/
|
||||
void ReflowOverflowContainerChildren(nsPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsOverflowAreas& aOverflowRects,
|
||||
uint32_t aFlags,
|
||||
nsReflowStatus& aStatus);
|
||||
nsresult ReflowOverflowContainerChildren(nsPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsOverflowAreas& aOverflowRects,
|
||||
uint32_t aFlags,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
/**
|
||||
* Move any frames on our overflow list to the end of our principal list.
|
||||
|
|
|
@ -154,7 +154,7 @@ nsFirstLetterFrame::ComputeSize(nsRenderingContext *aRenderingContext,
|
|||
aCBSize, aAvailableWidth, aMargin, aBorder, aPadding, aFlags);
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
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;
|
||||
return rv;
|
||||
}
|
||||
|
||||
// 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;
|
||||
CreateContinuationForFloatingParent(aPresContext, kid,
|
||||
&continuation, true);
|
||||
rv = CreateContinuationForFloatingParent(aPresContext, kid,
|
||||
&continuation, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -278,6 +278,7 @@ nsFirstLetterFrame::Reflow(nsPresContext* aPresContext,
|
|||
FinishAndStoreOverflow(&aMetrics);
|
||||
|
||||
NS_FRAME_SET_TRUNCATION(aReflowStatus, aReflowState, aMetrics);
|
||||
return rv;
|
||||
}
|
||||
|
||||
/* virtual */ bool
|
||||
|
|
|
@ -53,10 +53,10 @@ public:
|
|||
nsSize aCBSize, nscoord aAvailableWidth,
|
||||
nsSize aMargin, nsSize aBorder, nsSize aPadding,
|
||||
uint32_t aFlags) MOZ_OVERRIDE;
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool CanContinueTextRun() const MOZ_OVERRIDE;
|
||||
virtual nscoord GetBaseline() const MOZ_OVERRIDE;
|
||||
|
|
|
@ -1116,17 +1116,19 @@ nsFlexContainerFrame::
|
|||
nsHTMLReflowMetrics childDesiredSize(childRSForMeasuringHeight);
|
||||
nsReflowStatus childReflowStatus;
|
||||
const uint32_t flags = NS_FRAME_NO_MOVE_FRAME;
|
||||
ReflowChild(aFlexItem.Frame(), aPresContext,
|
||||
childDesiredSize, childRSForMeasuringHeight,
|
||||
0, 0, flags, childReflowStatus);
|
||||
nsresult rv = ReflowChild(aFlexItem.Frame(), aPresContext,
|
||||
childDesiredSize, childRSForMeasuringHeight,
|
||||
0, 0, flags, childReflowStatus);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
MOZ_ASSERT(NS_FRAME_IS_COMPLETE(childReflowStatus),
|
||||
"We gave flex item unconstrained available height, so it "
|
||||
"should be complete");
|
||||
|
||||
FinishReflowChild(aFlexItem.Frame(), aPresContext,
|
||||
childDesiredSize, &childRSForMeasuringHeight,
|
||||
0, 0, flags);
|
||||
rv = FinishReflowChild(aFlexItem.Frame(), aPresContext,
|
||||
childDesiredSize, &childRSForMeasuringHeight,
|
||||
0, 0, flags);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Subtract border/padding in vertical axis, to get _just_
|
||||
// the effective computed value of the "height" property.
|
||||
|
@ -2905,10 +2907,11 @@ nsFlexContainerFrame::SizeItemInCrossAxis(
|
|||
nsHTMLReflowMetrics childDesiredSize(aChildReflowState);
|
||||
nsReflowStatus childReflowStatus;
|
||||
const uint32_t flags = NS_FRAME_NO_MOVE_FRAME;
|
||||
ReflowChild(aItem.Frame(), aPresContext,
|
||||
childDesiredSize, aChildReflowState,
|
||||
0, 0, flags, childReflowStatus);
|
||||
nsresult rv = ReflowChild(aItem.Frame(), aPresContext,
|
||||
childDesiredSize, aChildReflowState,
|
||||
0, 0, flags, childReflowStatus);
|
||||
aItem.SetHadMeasuringReflow();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// XXXdholbert Once we do pagination / splitting, we'll need to actually
|
||||
// handle incomplete childReflowStatuses. But for now, we give our kids
|
||||
|
@ -2919,8 +2922,9 @@ nsFlexContainerFrame::SizeItemInCrossAxis(
|
|||
|
||||
// Tell the child we're done with its initial reflow.
|
||||
// (Necessary for e.g. GetBaseline() to work below w/out asserting)
|
||||
FinishReflowChild(aItem.Frame(), aPresContext,
|
||||
childDesiredSize, &aChildReflowState, 0, 0, flags);
|
||||
rv = FinishReflowChild(aItem.Frame(), aPresContext,
|
||||
childDesiredSize, &aChildReflowState, 0, 0, flags);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Save the sizing info that we learned from this reflow
|
||||
// -----------------------------------------------------
|
||||
|
@ -2984,7 +2988,7 @@ FlexLine::PositionItemsInCrossAxis(nscoord aLineStartPosition,
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsFlexContainerFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -2996,7 +3000,7 @@ nsFlexContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||
("Reflow() for nsFlexContainerFrame %p\n", this));
|
||||
|
||||
if (IsFrameTreeTooDeep(aReflowState, aDesiredSize, aStatus)) {
|
||||
return;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// We (and our children) can only depend on our ancestor's height if we have
|
||||
|
@ -3059,10 +3063,12 @@ nsFlexContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||
|
||||
if (NS_SUCCEEDED(rv) && !struts.IsEmpty()) {
|
||||
// We're restarting flex layout, with new knowledge of collapsed items.
|
||||
DoFlexLayout(aPresContext, aDesiredSize, aReflowState, aStatus,
|
||||
contentBoxMainSize, availableHeightForContent,
|
||||
struts, axisTracker);
|
||||
rv = DoFlexLayout(aPresContext, aDesiredSize, aReflowState, aStatus,
|
||||
contentBoxMainSize, availableHeightForContent,
|
||||
struts, axisTracker);
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
// RAII class to clean up a list of FlexLines.
|
||||
|
@ -3312,10 +3318,11 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
|
|||
|
||||
nsHTMLReflowMetrics childDesiredSize(childReflowState);
|
||||
nsReflowStatus childReflowStatus;
|
||||
ReflowChild(item->Frame(), aPresContext,
|
||||
childDesiredSize, childReflowState,
|
||||
physicalPosn.x, physicalPosn.y,
|
||||
0, childReflowStatus);
|
||||
nsresult rv = ReflowChild(item->Frame(), aPresContext,
|
||||
childDesiredSize, childReflowState,
|
||||
physicalPosn.x, physicalPosn.y,
|
||||
0, childReflowStatus);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// XXXdholbert Once we do pagination / splitting, we'll need to actually
|
||||
// handle incomplete childReflowStatuses. But for now, we give our kids
|
||||
|
@ -3327,9 +3334,10 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
|
|||
|
||||
childReflowState.ApplyRelativePositioning(&physicalPosn);
|
||||
|
||||
FinishReflowChild(item->Frame(), aPresContext,
|
||||
childDesiredSize, &childReflowState,
|
||||
physicalPosn.x, physicalPosn.y, 0);
|
||||
rv = FinishReflowChild(item->Frame(), aPresContext,
|
||||
childDesiredSize, &childReflowState,
|
||||
physicalPosn.x, physicalPosn.y, 0);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// If this is our first child and we haven't established a baseline for
|
||||
// the container yet (i.e. if we don't have 'align-self: baseline' on any
|
||||
|
|
|
@ -42,10 +42,10 @@ public:
|
|||
const nsRect& aDirtyRect,
|
||||
const nsDisplayListSet& aLists) MOZ_OVERRIDE;
|
||||
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
||||
virtual nscoord
|
||||
GetMinWidth(nsRenderingContext* aRenderingContext) MOZ_OVERRIDE;
|
||||
|
|
|
@ -4267,7 +4267,7 @@ nsFrame::ShrinkWidthToFit(nsRenderingContext *aRenderingContext,
|
|||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsFrame::WillReflow(nsPresContext* aPresContext)
|
||||
{
|
||||
#ifdef DEBUG_dbaron_off
|
||||
|
@ -4279,9 +4279,10 @@ nsFrame::WillReflow(nsPresContext* aPresContext)
|
|||
NS_FRAME_TRACE_MSG(NS_FRAME_TRACE_CALLS,
|
||||
("WillReflow: oldState=%x", mState));
|
||||
mState |= NS_FRAME_IN_REFLOW;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsFrame::DidReflow(nsPresContext* aPresContext,
|
||||
const nsHTMLReflowState* aReflowState,
|
||||
nsDidReflowStatus aStatus)
|
||||
|
@ -4307,6 +4308,8 @@ nsFrame::DidReflow(nsPresContext* aPresContext,
|
|||
aReflowState->mPercentHeightObserver->NotifyPercentHeight(*aReflowState);
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -4361,7 +4364,7 @@ nsFrame::CanContinueTextRun() const
|
|||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -4372,6 +4375,7 @@ nsFrame::Reflow(nsPresContext* aPresContext,
|
|||
aDesiredSize.Height() = 0;
|
||||
aStatus = NS_FRAME_COMPLETE;
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -7843,6 +7847,7 @@ nsFrame::RefreshSizeCache(nsBoxLayoutState& aState)
|
|||
// line height. This can be done with the line iterator.
|
||||
|
||||
// if we do have a rendering context
|
||||
nsresult rv = NS_OK;
|
||||
nsRenderingContext* rendContext = aState.GetRenderingContext();
|
||||
if (rendContext) {
|
||||
nsPresContext* presContext = aState.PresContext();
|
||||
|
@ -7874,9 +7879,9 @@ nsFrame::RefreshSizeCache(nsBoxLayoutState& aState)
|
|||
const WritingMode wm = aState.OuterReflowState() ?
|
||||
aState.OuterReflowState()->GetWritingMode() : GetWritingMode();
|
||||
nsHTMLReflowMetrics desiredSize(wm);
|
||||
BoxReflow(aState, presContext, desiredSize, rendContext,
|
||||
rect.x, rect.y,
|
||||
metrics->mBlockPrefSize.width, NS_UNCONSTRAINEDSIZE);
|
||||
rv = BoxReflow(aState, presContext, desiredSize, rendContext,
|
||||
rect.x, rect.y,
|
||||
metrics->mBlockPrefSize.width, NS_UNCONSTRAINEDSIZE);
|
||||
|
||||
metrics->mBlockMinSize.height = 0;
|
||||
// ok we need the max ascent of the items on the line. So to do this
|
||||
|
@ -7921,7 +7926,7 @@ nsFrame::RefreshSizeCache(nsBoxLayoutState& aState)
|
|||
#endif
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
return rv;
|
||||
}
|
||||
|
||||
/* virtual */ nsILineIterator*
|
||||
|
@ -8062,11 +8067,12 @@ nsFrame::DoLayout(nsBoxLayoutState& aState)
|
|||
const WritingMode wm = aState.OuterReflowState() ?
|
||||
aState.OuterReflowState()->GetWritingMode() : GetWritingMode();
|
||||
nsHTMLReflowMetrics desiredSize(wm);
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
if (rendContext) {
|
||||
|
||||
BoxReflow(aState, presContext, desiredSize, rendContext,
|
||||
ourRect.x, ourRect.y, ourRect.width, ourRect.height);
|
||||
rv = BoxReflow(aState, presContext, desiredSize, rendContext,
|
||||
ourRect.x, ourRect.y, ourRect.width, ourRect.height);
|
||||
|
||||
if (IsCollapsed()) {
|
||||
SetSize(nsSize(0, 0));
|
||||
|
@ -8125,10 +8131,10 @@ nsFrame::DoLayout(nsBoxLayoutState& aState)
|
|||
|
||||
SyncLayout(aState);
|
||||
|
||||
return NS_OK;
|
||||
return rv;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsFrame::BoxReflow(nsBoxLayoutState& aState,
|
||||
nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
|
@ -8373,6 +8379,8 @@ nsFrame::BoxReflow(nsBoxLayoutState& aState,
|
|||
#ifdef DEBUG_REFLOW
|
||||
gIndent2--;
|
||||
#endif
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -295,7 +295,7 @@ public:
|
|||
nscoord ShrinkWidthToFit(nsRenderingContext *aRenderingContext,
|
||||
nscoord aWidthInCB);
|
||||
|
||||
virtual void WillReflow(nsPresContext* aPresContext) MOZ_OVERRIDE;
|
||||
virtual nsresult WillReflow(nsPresContext* aPresContext) MOZ_OVERRIDE;
|
||||
/**
|
||||
* Calculates the size of this frame after reflowing (calling Reflow on, and
|
||||
* updating the size and position of) its children, as necessary. The
|
||||
|
@ -318,13 +318,13 @@ 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 void Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual void DidReflow(nsPresContext* aPresContext,
|
||||
const nsHTMLReflowState* aReflowState,
|
||||
nsDidReflowStatus aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult DidReflow(nsPresContext* aPresContext,
|
||||
const nsHTMLReflowState* aReflowState,
|
||||
nsDidReflowStatus aStatus) MOZ_OVERRIDE;
|
||||
|
||||
/**
|
||||
* NOTE: aStatus is assumed to be already-initialized. The reflow statuses of
|
||||
|
@ -636,15 +636,15 @@ protected:
|
|||
void FireDOMEvent(const nsAString& aDOMEventName, nsIContent *aContent = nullptr);
|
||||
|
||||
private:
|
||||
void BoxReflow(nsBoxLayoutState& aState,
|
||||
nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
nsRenderingContext* aRenderingContext,
|
||||
nscoord aX,
|
||||
nscoord aY,
|
||||
nscoord aWidth,
|
||||
nscoord aHeight,
|
||||
bool aMoveFrame = true);
|
||||
nsresult BoxReflow(nsBoxLayoutState& aState,
|
||||
nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
nsRenderingContext* aRenderingContext,
|
||||
nscoord aX,
|
||||
nscoord aY,
|
||||
nscoord aWidth,
|
||||
nscoord aHeight,
|
||||
bool aMoveFrame = true);
|
||||
|
||||
NS_IMETHODIMP RefreshSizeCache(nsBoxLayoutState& aState);
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ public:
|
|||
const nsRect& aDirtyRect,
|
||||
const nsDisplayListSet& aLists) MOZ_OVERRIDE;
|
||||
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
virtual nsresult 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 void Reflow(nsPresContext* aPresContext,
|
||||
virtual nsresult Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
@ -839,7 +839,7 @@ nscolor nsHTMLFramesetFrame::GetBorderColor(nsIContent* aContent)
|
|||
return GetBorderColor();
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
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;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
CalculateRowCol(aPresContext, width, mNumCols, colSpecs, mColSizes);
|
||||
|
@ -913,14 +913,18 @@ 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;
|
||||
|
@ -1136,6 +1140,7 @@ nsHTMLFramesetFrame::Reflow(nsPresContext* aPresContext,
|
|||
FinishAndStoreOverflow(&aDesiredSize);
|
||||
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsIAtom*
|
||||
|
@ -1432,7 +1437,7 @@ void nsHTMLFramesetBorderFrame::SetColor(nscolor aColor)
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsHTMLFramesetBorderFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -1447,6 +1452,7 @@ nsHTMLFramesetBorderFrame::Reflow(nsPresContext* aPresContext,
|
|||
|
||||
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
||||
aStatus = NS_FRAME_COMPLETE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
class nsDisplayFramesetBorder : public nsDisplayItem {
|
||||
|
@ -1639,7 +1645,7 @@ nscoord nsHTMLFramesetBlankFrame::GetIntrinsicHeight()
|
|||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsHTMLFramesetBlankFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -1653,6 +1659,7 @@ nsHTMLFramesetBlankFrame::Reflow(nsPresContext* aPresContext,
|
|||
|
||||
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
||||
aStatus = NS_FRAME_COMPLETE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
class nsDisplayFramesetBlank : public nsDisplayItem {
|
||||
|
|
|
@ -98,10 +98,10 @@ public:
|
|||
const nsRect& aDirtyRect,
|
||||
const nsDisplayListSet& aLists) MOZ_OVERRIDE;
|
||||
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
||||
virtual nsIAtom* GetType() const MOZ_OVERRIDE;
|
||||
#ifdef DEBUG_FRAME_DUMP
|
||||
|
|
|
@ -286,8 +286,10 @@ bool
|
|||
nsHTMLScrollFrame::TryLayout(ScrollReflowState* aState,
|
||||
nsHTMLReflowMetrics* aKidMetrics,
|
||||
bool aAssumeHScroll, bool aAssumeVScroll,
|
||||
bool aForce)
|
||||
bool aForce, nsresult* aResult)
|
||||
{
|
||||
*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!");
|
||||
|
@ -297,8 +299,12 @@ nsHTMLScrollFrame::TryLayout(ScrollReflowState* aState,
|
|||
if (aAssumeVScroll != aState->mReflowedContentsWithVScrollbar ||
|
||||
(aAssumeHScroll != aState->mReflowedContentsWithHScrollbar &&
|
||||
ScrolledContentDependsOnHeight(aState))) {
|
||||
ReflowScrolledFrame(aState, aAssumeHScroll, aAssumeVScroll, aKidMetrics,
|
||||
false);
|
||||
nsresult rv = ReflowScrolledFrame(aState, aAssumeHScroll, aAssumeVScroll,
|
||||
aKidMetrics, false);
|
||||
if (NS_FAILED(rv)) {
|
||||
*aResult = rv;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
nsSize vScrollbarMinSize(0, 0);
|
||||
|
@ -388,7 +394,7 @@ nsHTMLScrollFrame::ScrolledContentDependsOnHeight(ScrollReflowState* aState)
|
|||
aState->mReflowState.ComputedMaxHeight() != NS_UNCONSTRAINEDSIZE;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsHTMLScrollFrame::ReflowScrolledFrame(ScrollReflowState* aState,
|
||||
bool aAssumeHScroll,
|
||||
bool aAssumeVScroll,
|
||||
|
@ -451,9 +457,9 @@ nsHTMLScrollFrame::ReflowScrolledFrame(ScrollReflowState* aState,
|
|||
mHelper.mHasVerticalScrollbar = aAssumeVScroll;
|
||||
|
||||
nsReflowStatus status;
|
||||
ReflowChild(mHelper.mScrolledFrame, presContext, *aMetrics,
|
||||
kidReflowState, 0, 0,
|
||||
NS_FRAME_NO_MOVE_FRAME, status);
|
||||
nsresult rv = ReflowChild(mHelper.mScrolledFrame, presContext, *aMetrics,
|
||||
kidReflowState, 0, 0,
|
||||
NS_FRAME_NO_MOVE_FRAME, status);
|
||||
|
||||
mHelper.mHasHorizontalScrollbar = didHaveHorizontalScrollbar;
|
||||
mHelper.mHasVerticalScrollbar = didHaveVerticalScrollbar;
|
||||
|
@ -491,6 +497,8 @@ nsHTMLScrollFrame::ReflowScrolledFrame(ScrollReflowState* aState,
|
|||
aState->mContentsOverflowAreas = aMetrics->mOverflowAreas;
|
||||
aState->mReflowedContentsWithHScrollbar = aAssumeHScroll;
|
||||
aState->mReflowedContentsWithVScrollbar = aAssumeVScroll;
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -555,13 +563,14 @@ nsHTMLScrollFrame::InInitialReflow() const
|
|||
return !mHelper.mIsRoot && (GetStateBits() & NS_FRAME_FIRST_REFLOW);
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsHTMLScrollFrame::ReflowContents(ScrollReflowState* aState,
|
||||
const nsHTMLReflowMetrics& aDesiredSize)
|
||||
{
|
||||
nsHTMLReflowMetrics kidDesiredSize(aDesiredSize.GetWritingMode(), aDesiredSize.mFlags);
|
||||
ReflowScrolledFrame(aState, GuessHScrollbarNeeded(*aState),
|
||||
GuessVScrollbarNeeded(*aState), &kidDesiredSize, true);
|
||||
nsresult rv = ReflowScrolledFrame(aState, GuessHScrollbarNeeded(*aState),
|
||||
GuessVScrollbarNeeded(*aState), &kidDesiredSize, true);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// There's an important special case ... if the child appears to fit
|
||||
// in the inside-border rect (but overflows the scrollport), we
|
||||
|
@ -593,7 +602,9 @@ nsHTMLScrollFrame::ReflowContents(ScrollReflowState* aState,
|
|||
insideBorderSize);
|
||||
if (nsRect(nsPoint(0, 0), insideBorderSize).Contains(scrolledRect)) {
|
||||
// Let's pretend we had no scrollbars coming in here
|
||||
ReflowScrolledFrame(aState, false, false, &kidDesiredSize, false);
|
||||
rv = ReflowScrolledFrame(aState, false, false,
|
||||
&kidDesiredSize, false);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -604,21 +615,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))
|
||||
return;
|
||||
aState->mReflowedContentsWithVScrollbar, false, &rv))
|
||||
return NS_OK;
|
||||
if (TryLayout(aState, &kidDesiredSize, !aState->mReflowedContentsWithHScrollbar,
|
||||
aState->mReflowedContentsWithVScrollbar, false))
|
||||
return;
|
||||
aState->mReflowedContentsWithVScrollbar, false, &rv))
|
||||
return NS_OK;
|
||||
|
||||
// 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))
|
||||
return;
|
||||
if (TryLayout(aState, &kidDesiredSize, true, newVScrollbarState, false))
|
||||
return;
|
||||
if (TryLayout(aState, &kidDesiredSize, false, newVScrollbarState, false, &rv))
|
||||
return NS_OK;
|
||||
if (TryLayout(aState, &kidDesiredSize, true, newVScrollbarState, false, &rv))
|
||||
return NS_OK;
|
||||
|
||||
// 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.
|
||||
|
@ -626,7 +637,8 @@ nsHTMLScrollFrame::ReflowContents(ScrollReflowState* aState,
|
|||
TryLayout(aState, &kidDesiredSize,
|
||||
aState->mStyles.mHorizontal != NS_STYLE_OVERFLOW_HIDDEN,
|
||||
aState->mStyles.mVertical != NS_STYLE_OVERFLOW_HIDDEN,
|
||||
true);
|
||||
true, &rv);
|
||||
return rv;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -741,7 +753,7 @@ GetBrowserRoot(nsIContent* aContent)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsHTMLScrollFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -795,7 +807,9 @@ nsHTMLScrollFrame::Reflow(nsPresContext* aPresContext,
|
|||
state.mComputedBorder = aReflowState.ComputedPhysicalBorderPadding() -
|
||||
aReflowState.ComputedPhysicalPadding();
|
||||
|
||||
ReflowContents(&state, aDesiredSize);
|
||||
nsresult rv = ReflowContents(&state, aDesiredSize);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
// 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
|
||||
|
@ -861,6 +875,7 @@ nsHTMLScrollFrame::Reflow(nsPresContext* aPresContext,
|
|||
aStatus = NS_FRAME_COMPLETE;
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
||||
mHelper.PostOverflowEvent();
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -465,15 +465,15 @@ public:
|
|||
bool TryLayout(ScrollReflowState* aState,
|
||||
nsHTMLReflowMetrics* aKidMetrics,
|
||||
bool aAssumeVScroll, bool aAssumeHScroll,
|
||||
bool aForce);
|
||||
bool aForce, nsresult* aResult);
|
||||
bool ScrolledContentDependsOnHeight(ScrollReflowState* aState);
|
||||
void ReflowScrolledFrame(ScrollReflowState* aState,
|
||||
bool aAssumeHScroll,
|
||||
bool aAssumeVScroll,
|
||||
nsHTMLReflowMetrics* aMetrics,
|
||||
bool aFirstPass);
|
||||
void ReflowContents(ScrollReflowState* aState,
|
||||
const nsHTMLReflowMetrics& aDesiredSize);
|
||||
nsresult ReflowScrolledFrame(ScrollReflowState* aState,
|
||||
bool aAssumeHScroll,
|
||||
bool aAssumeVScroll,
|
||||
nsHTMLReflowMetrics* aMetrics,
|
||||
bool aFirstPass);
|
||||
nsresult 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 void Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool UpdateOverflow() MOZ_OVERRIDE {
|
||||
return mHelper.UpdateOverflow();
|
||||
|
|
|
@ -171,7 +171,7 @@ nsHTMLCanvasFrame::ComputeSize(nsRenderingContext *aRenderingContext,
|
|||
aMargin, aBorder, aPadding);
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsHTMLCanvasFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -222,6 +222,8 @@ 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
|
||||
|
|
|
@ -63,10 +63,10 @@ public:
|
|||
nsSize aMargin, nsSize aBorder, nsSize aPadding,
|
||||
uint32_t aFlags) MOZ_OVERRIDE;
|
||||
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
||||
nsRect GetInnerArea() const;
|
||||
|
||||
|
|
|
@ -1820,7 +1820,7 @@ public:
|
|||
* XXX Is this really the semantics we want? Because we have the NS_FRAME_IN_REFLOW
|
||||
* bit we can ensure we don't call it more than once...
|
||||
*/
|
||||
virtual void WillReflow(nsPresContext* aPresContext) = 0;
|
||||
virtual nsresult WillReflow(nsPresContext* aPresContext) = 0;
|
||||
|
||||
/**
|
||||
* The frame is given an available size and asked for its desired
|
||||
|
@ -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 void Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aReflowMetrics,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) = 0;
|
||||
virtual nsresult Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aReflowMetrics,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) = 0;
|
||||
|
||||
/**
|
||||
* Post-reflow hook. After a frame is reflowed this method will be called
|
||||
|
@ -1885,9 +1885,9 @@ public:
|
|||
* XXX Don't we want the semantics to dictate that we only call this once for
|
||||
* a given reflow?
|
||||
*/
|
||||
virtual void DidReflow(nsPresContext* aPresContext,
|
||||
const nsHTMLReflowState* aReflowState,
|
||||
nsDidReflowStatus aStatus) = 0;
|
||||
virtual nsresult DidReflow(nsPresContext* aPresContext,
|
||||
const nsHTMLReflowState* aReflowState,
|
||||
nsDidReflowStatus aStatus) = 0;
|
||||
|
||||
// XXX Maybe these three should be a separate interface?
|
||||
|
||||
|
|
|
@ -797,7 +797,7 @@ nsImageFrame::GetIntrinsicRatio()
|
|||
return mIntrinsicRatio;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsImageFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -900,6 +900,7 @@ 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
|
||||
|
|
|
@ -81,10 +81,10 @@ public:
|
|||
virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
|
||||
virtual mozilla::IntrinsicSize GetIntrinsicSize() MOZ_OVERRIDE;
|
||||
virtual nsSize GetIntrinsicRatio() MOZ_OVERRIDE;
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult GetContentForEvent(mozilla::WidgetEvent* aEvent,
|
||||
nsIContent** aContent) MOZ_OVERRIDE;
|
||||
|
|
|
@ -294,7 +294,7 @@ ReparentChildListStyle(nsPresContext* aPresContext,
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsInlineFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -303,11 +303,10 @@ nsInlineFrame::Reflow(nsPresContext* aPresContext,
|
|||
DO_GLOBAL_REFLOW_COUNT("nsInlineFrame");
|
||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aStatus);
|
||||
if (nullptr == aReflowState.mLineLayout) {
|
||||
NS_ERROR("must have non-null aReflowState.mLineLayout");
|
||||
return;
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
if (IsFrameTreeTooDeep(aReflowState, aMetrics, aStatus)) {
|
||||
return;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
bool lazilySetParentPointer = false;
|
||||
|
@ -390,6 +389,7 @@ 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);
|
||||
}
|
||||
|
||||
ReflowFrames(aPresContext, aReflowState, irs, aMetrics, aStatus);
|
||||
rv = ReflowFrames(aPresContext, aReflowState, irs, aMetrics, aStatus);
|
||||
|
||||
ReflowAbsoluteFrames(aPresContext, aMetrics, aReflowState, aStatus);
|
||||
|
||||
|
@ -405,6 +405,7 @@ nsInlineFrame::Reflow(nsPresContext* aPresContext,
|
|||
// overflow-rect state for us.
|
||||
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aMetrics);
|
||||
return rv;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -479,13 +480,14 @@ nsInlineFrame::PullOverflowsFromPrevInFlow()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
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;
|
||||
|
@ -596,8 +598,9 @@ nsInlineFrame::ReflowFrames(nsPresContext* aPresContext,
|
|||
|
||||
if (!done) {
|
||||
bool reflowingFirstLetter = lineLayout->GetFirstLetterStyleOK();
|
||||
ReflowInlineFrame(aPresContext, aReflowState, irs, frame, aStatus);
|
||||
done = NS_INLINE_IS_BREAK(aStatus) ||
|
||||
rv = ReflowInlineFrame(aPresContext, aReflowState, irs, frame, aStatus);
|
||||
done = NS_FAILED(rv) ||
|
||||
NS_INLINE_IS_BREAK(aStatus) ||
|
||||
(!reflowingFirstLetter && NS_FRAME_IS_NOT_COMPLETE(aStatus));
|
||||
if (done) {
|
||||
if (!irs.mSetParentPointer) {
|
||||
|
@ -634,8 +637,9 @@ nsInlineFrame::ReflowFrames(nsPresContext* aPresContext,
|
|||
}
|
||||
break;
|
||||
}
|
||||
ReflowInlineFrame(aPresContext, aReflowState, irs, frame, aStatus);
|
||||
if (NS_INLINE_IS_BREAK(aStatus) ||
|
||||
rv = ReflowInlineFrame(aPresContext, aReflowState, irs, frame, aStatus);
|
||||
if (NS_FAILED(rv) ||
|
||||
NS_INLINE_IS_BREAK(aStatus) ||
|
||||
(!reflowingFirstLetter && NS_FRAME_IS_NOT_COMPLETE(aStatus))) {
|
||||
break;
|
||||
}
|
||||
|
@ -717,9 +721,11 @@ nsInlineFrame::ReflowFrames(nsPresContext* aPresContext,
|
|||
printf(": metrics=%d,%d ascent=%d\n",
|
||||
aMetrics.Width(), aMetrics.Height(), aMetrics.TopAscent());
|
||||
#endif
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsInlineFrame::ReflowInlineFrame(nsPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
InlineReflowState& irs,
|
||||
|
@ -729,8 +735,13 @@ nsInlineFrame::ReflowInlineFrame(nsPresContext* aPresContext,
|
|||
nsLineLayout* lineLayout = aReflowState.mLineLayout;
|
||||
bool reflowingFirstLetter = lineLayout->GetFirstLetterStyleOK();
|
||||
bool pushedFrame;
|
||||
lineLayout->ReflowFrame(aFrame, aStatus, nullptr, pushedFrame);
|
||||
nsresult rv =
|
||||
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
|
||||
|
@ -745,15 +756,15 @@ nsInlineFrame::ReflowInlineFrame(nsPresContext* aPresContext,
|
|||
// Preserve reflow status when breaking-before our first child
|
||||
// and propagate it upward without modification.
|
||||
}
|
||||
return;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Create a next-in-flow if needed.
|
||||
if (!NS_FRAME_IS_FULLY_COMPLETE(aStatus)) {
|
||||
nsIFrame* newFrame;
|
||||
nsresult rv = CreateNextInFlow(aFrame, newFrame);
|
||||
rv = CreateNextInFlow(aFrame, newFrame);
|
||||
if (NS_FAILED(rv)) {
|
||||
return;
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -775,7 +786,7 @@ nsInlineFrame::ReflowInlineFrame(nsPresContext* aPresContext,
|
|||
nextInFlow = static_cast<nsInlineFrame*>(nextInFlow->GetNextInFlow());
|
||||
}
|
||||
}
|
||||
return;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (!NS_FRAME_IS_FULLY_COMPLETE(aStatus) && !reflowingFirstLetter) {
|
||||
|
@ -784,6 +795,7 @@ nsInlineFrame::ReflowInlineFrame(nsPresContext* aPresContext,
|
|||
PushFrames(aPresContext, nextFrame, aFrame, irs);
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsIFrame*
|
||||
|
@ -1021,14 +1033,14 @@ nsFirstLineFrame::PullOneFrame(nsPresContext* aPresContext, InlineReflowState& i
|
|||
return frame;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsFirstLineFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
if (nullptr == aReflowState.mLineLayout) {
|
||||
return; // XXX does this happen? why?
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
nsIFrame* lineContainer = aReflowState.mLineLayout->LineContainerFrame();
|
||||
|
@ -1062,6 +1074,7 @@ 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
|
||||
|
@ -1092,12 +1105,14 @@ nsFirstLineFrame::Reflow(nsPresContext* aPresContext,
|
|||
NS_ASSERTION(!aReflowState.mLineLayout->GetInFirstLine(),
|
||||
"Nested first-line frames? BOGUS");
|
||||
aReflowState.mLineLayout->SetInFirstLine(true);
|
||||
ReflowFrames(aPresContext, aReflowState, irs, aMetrics, aStatus);
|
||||
rv = 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
|
||||
|
|
|
@ -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 void Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult 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;
|
||||
|
||||
void ReflowFrames(nsPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
InlineReflowState& rs,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
nsReflowStatus& aStatus);
|
||||
nsresult ReflowFrames(nsPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
InlineReflowState& rs,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
void ReflowInlineFrame(nsPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
InlineReflowState& rs,
|
||||
nsIFrame* aFrame,
|
||||
nsReflowStatus& aStatus);
|
||||
nsresult 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 void Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
||||
virtual void Init(nsIContent* aContent, nsIFrame* aParent,
|
||||
nsIFrame* aPrevInFlow) MOZ_OVERRIDE;
|
||||
|
|
|
@ -42,7 +42,7 @@ nsLeafFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
|||
return nsSize(GetIntrinsicWidth(), GetIntrinsicHeight());
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsLeafFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -58,9 +58,10 @@ nsLeafFrame::Reflow(nsPresContext* aPresContext,
|
|||
DoReflow(aPresContext, aMetrics, aReflowState, aStatus);
|
||||
|
||||
FinishAndStoreOverflow(&aMetrics);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsLeafFrame::DoReflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -85,6 +86,8 @@ nsLeafFrame::DoReflow(nsPresContext* aPresContext,
|
|||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aMetrics);
|
||||
|
||||
aMetrics.SetOverflowAreasToDesiredBounds();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nscoord
|
||||
|
|
|
@ -51,18 +51,18 @@ public:
|
|||
* borderpadding for the desired height. Ascent will be set to the height,
|
||||
* and descent will be set to 0.
|
||||
*/
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
||||
/**
|
||||
* This method does most of the work that Reflow() above need done.
|
||||
*/
|
||||
virtual void DoReflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
virtual nsresult DoReflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE
|
||||
{
|
||||
|
|
|
@ -711,7 +711,7 @@ IsPercentageAware(const nsIFrame* aFrame)
|
|||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
||||
nsReflowStatus& aReflowStatus,
|
||||
nsHTMLReflowMetrics* aMetrics,
|
||||
|
@ -839,8 +839,12 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
|||
&savedOptionalBreakPriority);
|
||||
|
||||
if (!isText) {
|
||||
aFrame->Reflow(mPresContext, metrics, reflowStateHolder.ref(),
|
||||
aReflowStatus);
|
||||
nsresult rv = aFrame->Reflow(mPresContext, metrics, reflowStateHolder.ref(),
|
||||
aReflowStatus);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_WARNING( "Reflow of frame failed in nsLineLayout" );
|
||||
return rv;
|
||||
}
|
||||
} else {
|
||||
static_cast<nsTextFrame*>(aFrame)->
|
||||
ReflowText(*this, availableSpaceOnLine, psd->mReflowState->rendContext,
|
||||
|
@ -1052,6 +1056,8 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
|||
nsFrame::ListTag(stdout, aFrame);
|
||||
printf(" status=%x\n", aReflowStatus);
|
||||
#endif
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -78,11 +78,11 @@ public:
|
|||
bool IsZeroBSize();
|
||||
|
||||
// Reflows the frame and returns the reflow status. aPushedFrame is true
|
||||
// if the frame is pushed to the next line because it doesn't fit.
|
||||
void ReflowFrame(nsIFrame* aFrame,
|
||||
nsReflowStatus& aReflowStatus,
|
||||
nsHTMLReflowMetrics* aMetrics,
|
||||
bool& aPushedFrame);
|
||||
// if the frame is pushed to the next line because it doesn't fit
|
||||
nsresult ReflowFrame(nsIFrame* aFrame,
|
||||
nsReflowStatus& aReflowStatus,
|
||||
nsHTMLReflowMetrics* aMetrics,
|
||||
bool& aPushedFrame);
|
||||
|
||||
void AddBulletFrame(nsIFrame* aFrame, const nsHTMLReflowMetrics& aMetrics);
|
||||
|
||||
|
|
|
@ -497,7 +497,7 @@ nsObjectFrame::GetDesiredSize(nsPresContext* aPresContext,
|
|||
// call the superclass in all cases.
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
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;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// if we are printing or print previewing, bail for now
|
||||
if (aPresContext->Medium() == nsGkAtoms::print) {
|
||||
aStatus = NS_FRAME_COMPLETE;
|
||||
return;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsRect r(0, 0, aMetrics.Width(), aMetrics.Height());
|
||||
|
@ -543,6 +543,7 @@ nsObjectFrame::Reflow(nsPresContext* aPresContext,
|
|||
aStatus = NS_FRAME_COMPLETE;
|
||||
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aMetrics);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
///////////// nsIReflowCallback ///////////////
|
||||
|
@ -800,7 +801,7 @@ nsIntPoint nsObjectFrame::GetWindowOriginInPixels(bool aWindowless)
|
|||
PresContext()->AppUnitsToDevPixels(origin.y));
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsObjectFrame::DidReflow(nsPresContext* aPresContext,
|
||||
const nsHTMLReflowState* aReflowState,
|
||||
nsDidReflowStatus aStatus)
|
||||
|
@ -814,12 +815,12 @@ nsObjectFrame::DidReflow(nsPresContext* aPresContext,
|
|||
objContent->HasNewFrame(this);
|
||||
}
|
||||
|
||||
nsObjectFrameSuper::DidReflow(aPresContext, aReflowState, aStatus);
|
||||
nsresult rv = nsObjectFrameSuper::DidReflow(aPresContext, aReflowState, aStatus);
|
||||
|
||||
// The view is created hidden; once we have reflowed it and it has been
|
||||
// positioned then we show it.
|
||||
if (aStatus != nsDidReflowStatus::FINISHED)
|
||||
return;
|
||||
return rv;
|
||||
|
||||
if (HasView()) {
|
||||
nsView* view = GetView();
|
||||
|
@ -827,6 +828,8 @@ nsObjectFrame::DidReflow(nsPresContext* aPresContext,
|
|||
if (vm)
|
||||
vm->SetViewVisibility(view, IsHidden() ? nsViewVisibility_kHide : nsViewVisibility_kShow);
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
|
|
|
@ -58,13 +58,13 @@ public:
|
|||
nsIFrame* aPrevInFlow) MOZ_OVERRIDE;
|
||||
virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
|
||||
virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual void DidReflow(nsPresContext* aPresContext,
|
||||
const nsHTMLReflowState* aReflowState,
|
||||
nsDidReflowStatus aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult DidReflow(nsPresContext* aPresContext,
|
||||
const nsHTMLReflowState* aReflowState,
|
||||
nsDidReflowStatus aStatus) MOZ_OVERRIDE;
|
||||
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
const nsRect& aDirtyRect,
|
||||
const nsDisplayListSet& aLists) MOZ_OVERRIDE;
|
||||
|
|
|
@ -17,7 +17,7 @@ NS_NewPageContentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
|
|||
|
||||
NS_IMPL_FRAMEARENA_HELPERS(nsPageContentFrame)
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsPageContentFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -26,13 +26,12 @@ 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);
|
||||
if (NS_FAILED(rv)) {
|
||||
return;
|
||||
}
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
// Set our size up front, since some parts of reflow depend on it
|
||||
|
@ -51,7 +50,8 @@ nsPageContentFrame::Reflow(nsPresContext* aPresContext,
|
|||
kidReflowState.SetComputedHeight(maxSize.height);
|
||||
|
||||
// Reflow the page content area
|
||||
ReflowChild(frame, aPresContext, aDesiredSize, kidReflowState, 0, 0, 0, aStatus);
|
||||
rv = ReflowChild(frame, aPresContext, aDesiredSize, kidReflowState, 0, 0, 0, aStatus);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// The document element's background should cover the entire canvas, so
|
||||
// take into account the combined area and any space taken up by
|
||||
|
@ -100,6 +100,7 @@ nsPageContentFrame::Reflow(nsPresContext* aPresContext,
|
|||
FinishAndStoreOverflow(&aDesiredSize);
|
||||
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsIAtom*
|
||||
|
|
|
@ -20,10 +20,10 @@ public:
|
|||
friend class nsPageFrame;
|
||||
|
||||
// nsIFrame
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aMaxSize,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aMaxSize,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE
|
||||
{
|
||||
|
|
|
@ -43,8 +43,7 @@ nsPageFrame::~nsPageFrame()
|
|||
{
|
||||
}
|
||||
|
||||
void
|
||||
nsPageFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsresult nsPageFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
|
@ -85,7 +84,7 @@ nsPageFrame::Reflow(nsPresContext* aPresContext,
|
|||
aDesiredSize.Width() = 0;
|
||||
aDesiredSize.Height() = 0;
|
||||
NS_WARNING("Reflow aborted; no space for content");
|
||||
return;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsHTMLReflowState kidReflowState(aPresContext, aReflowState, frame, maxSize);
|
||||
|
@ -158,6 +157,7 @@ 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;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsPageBreakFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -670,6 +670,7 @@ nsPageBreakFrame::Reflow(nsPresContext* aPresContext,
|
|||
// DidReflow will always get called before the next Reflow() call.
|
||||
mHaveReflowed = true;
|
||||
aStatus = NS_FRAME_COMPLETE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsIAtom*
|
||||
|
|
|
@ -19,10 +19,10 @@ public:
|
|||
|
||||
friend nsIFrame* NS_NewPageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
||||
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aMaxSize,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult 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 void Reflow(nsPresContext* aPresContext,
|
||||
virtual nsresult Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
|
|
@ -98,7 +98,7 @@ nsPlaceholderFrame::AddInlinePrefWidth(nsRenderingContext* aRenderingContext,
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsPlaceholderFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -143,6 +143,7 @@ nsPlaceholderFrame::Reflow(nsPresContext* aPresContext,
|
|||
|
||||
aStatus = NS_FRAME_COMPLETE;
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -96,10 +96,10 @@ public:
|
|||
virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE;
|
||||
virtual nsSize GetMaxSize(nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE;
|
||||
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
||||
virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ nsSimplePageSequenceFrame::SetDesiredSize(nsHTMLReflowMetrics& aDesiredSize,
|
|||
nscoord(aHeight * PresContext()->GetPrintPreviewScale()));
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
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;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// See if we can get a Print Settings from the Context
|
||||
|
@ -266,12 +266,11 @@ nsSimplePageSequenceFrame::Reflow(nsPresContext* aPresContext,
|
|||
}
|
||||
|
||||
// Create current Date/Time String
|
||||
if (!mDateFormatter) {
|
||||
if (!mDateFormatter)
|
||||
mDateFormatter = do_CreateInstance(NS_DATETIMEFORMAT_CONTRACTID);
|
||||
}
|
||||
if (!mDateFormatter) {
|
||||
return;
|
||||
}
|
||||
|
||||
NS_ENSURE_TRUE(mDateFormatter, NS_ERROR_FAILURE);
|
||||
|
||||
nsAutoString formattedDateString;
|
||||
time_t ltime;
|
||||
time( <ime );
|
||||
|
@ -298,6 +297,7 @@ nsSimplePageSequenceFrame::Reflow(nsPresContext* aPresContext,
|
|||
|
||||
NS_FRAME_TRACE_REFLOW_OUT("nsSimplePageSequeceFrame::Reflow", aStatus);
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -64,10 +64,10 @@ public:
|
|||
NS_DECL_FRAMEARENA_HELPERS
|
||||
|
||||
// nsIFrame
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aMaxSize,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aMaxSize,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
||||
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
const nsRect& aDirtyRect,
|
||||
|
|
|
@ -688,7 +688,7 @@ nsSubDocumentFrame::ComputeSize(nsRenderingContext *aRenderingContext,
|
|||
aMargin, aBorder, aPadding, aFlags);
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsSubDocumentFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -707,7 +707,9 @@ nsSubDocumentFrame::Reflow(nsPresContext* aPresContext,
|
|||
"Shouldn't happen");
|
||||
|
||||
// XUL <iframe> or <browser>, or HTML <iframe>, <object> or <embed>
|
||||
nsLeafFrame::DoReflow(aPresContext, aDesiredSize, aReflowState, aStatus);
|
||||
nsresult rv = nsLeafFrame::DoReflow(aPresContext, aDesiredSize, aReflowState,
|
||||
aStatus);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// "offset" is the offset of our content area from our frame's
|
||||
// top-left corner.
|
||||
|
@ -747,6 +749,7 @@ nsSubDocumentFrame::Reflow(nsPresContext* aPresContext,
|
|||
aDesiredSize.Width(), aDesiredSize.Height(), aStatus));
|
||||
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -61,10 +61,10 @@ public:
|
|||
nsSize aMargin, nsSize aBorder, nsSize aPadding,
|
||||
uint32_t aFlags) MOZ_OVERRIDE;
|
||||
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
||||
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
const nsRect& aDirtyRect,
|
||||
|
|
|
@ -7561,7 +7561,7 @@ struct NewlineProperty {
|
|||
int32_t mNewlineOffset;
|
||||
};
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsTextFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -7576,13 +7576,14 @@ nsTextFrame::Reflow(nsPresContext* aPresContext,
|
|||
if (!aReflowState.mLineLayout) {
|
||||
ClearMetrics(aMetrics);
|
||||
aStatus = NS_FRAME_COMPLETE;
|
||||
return;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
ReflowText(*aReflowState.mLineLayout, aReflowState.AvailableWidth(),
|
||||
aReflowState.rendContext, aMetrics, aStatus);
|
||||
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aMetrics);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
|
|
|
@ -215,10 +215,10 @@ public:
|
|||
virtual nsresult GetPrefWidthTightBounds(nsRenderingContext* aContext,
|
||||
nscoord* aX,
|
||||
nscoord* aXMost) MOZ_OVERRIDE;
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual bool CanContinueTextRun() const MOZ_OVERRIDE;
|
||||
// Method that is called for a text frame that is logically
|
||||
// adjacent to the end of the line (i.e. followed only by empty text frames,
|
||||
|
|
|
@ -239,7 +239,7 @@ public:
|
|||
nsCOMPtr<nsIContent> mContent;
|
||||
};
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsVideoFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aMetrics,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -288,9 +288,7 @@ nsVideoFrame::Reflow(nsPresContext* aPresContext,
|
|||
nsPoint posterTopLeft(0, 0);
|
||||
|
||||
nsCOMPtr<nsIDOMHTMLImageElement> posterImage = do_QueryInterface(mPosterImage);
|
||||
if (!posterImage) {
|
||||
return;
|
||||
}
|
||||
NS_ENSURE_TRUE(posterImage, NS_ERROR_FAILURE);
|
||||
posterImage->GetNaturalHeight(&posterHeight);
|
||||
posterImage->GetNaturalWidth(&posterWidth);
|
||||
|
||||
|
@ -358,6 +356,8 @@ nsVideoFrame::Reflow(nsPresContext* aPresContext,
|
|||
("exit nsVideoFrame::Reflow: size=%d,%d",
|
||||
aMetrics.Width(), aMetrics.Height()));
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aMetrics);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
class nsDisplayVideo : public nsDisplayItem {
|
||||
|
|
|
@ -61,10 +61,10 @@ public:
|
|||
virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
|
||||
virtual bool IsLeaf() const MOZ_OVERRIDE;
|
||||
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
virtual mozilla::a11y::AccType AccessibleType() MOZ_OVERRIDE;
|
||||
|
|
|
@ -173,7 +173,7 @@ ViewportFrame::AdjustReflowStateAsContainingBlock(nsHTMLReflowState* aReflowStat
|
|||
return rect;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
ViewportFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -200,6 +200,8 @@ ViewportFrame::Reflow(nsPresContext* aPresContext,
|
|||
// reflow.
|
||||
nscoord kidHeight = 0;
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
if (mFrames.NotEmpty()) {
|
||||
// Deal with a non-incremental reflow or an incremental reflow
|
||||
// targeted at our one-and-only principal child frame.
|
||||
|
@ -216,8 +218,8 @@ ViewportFrame::Reflow(nsPresContext* aPresContext,
|
|||
|
||||
// Reflow the frame
|
||||
kidReflowState.SetComputedHeight(aReflowState.ComputedHeight());
|
||||
ReflowChild(kidFrame, aPresContext, kidDesiredSize, kidReflowState,
|
||||
0, 0, 0, aStatus);
|
||||
rv = ReflowChild(kidFrame, aPresContext, kidDesiredSize, kidReflowState,
|
||||
0, 0, 0, aStatus);
|
||||
kidHeight = kidDesiredSize.Height();
|
||||
|
||||
FinishReflowChild(kidFrame, aPresContext, kidDesiredSize, nullptr, 0, 0, 0);
|
||||
|
@ -260,10 +262,10 @@ ViewportFrame::Reflow(nsPresContext* aPresContext,
|
|||
nsRect rect = AdjustReflowStateAsContainingBlock(&reflowState);
|
||||
|
||||
// Just reflow all the fixed-pos frames.
|
||||
GetAbsoluteContainingBlock()->Reflow(this, aPresContext, reflowState, aStatus,
|
||||
rect,
|
||||
false, true, true, // XXX could be optimized
|
||||
&aDesiredSize.mOverflowAreas);
|
||||
rv = GetAbsoluteContainingBlock()->Reflow(this, aPresContext, reflowState, aStatus,
|
||||
rect,
|
||||
false, true, true, // XXX could be optimized
|
||||
&aDesiredSize.mOverflowAreas);
|
||||
}
|
||||
|
||||
// If we were dirty then do a repaint
|
||||
|
@ -287,6 +289,7 @@ ViewportFrame::Reflow(nsPresContext* aPresContext,
|
|||
|
||||
NS_FRAME_TRACE_REFLOW_OUT("ViewportFrame::Reflow", aStatus);
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsIAtom*
|
||||
|
|
|
@ -57,10 +57,10 @@ public:
|
|||
|
||||
virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
|
||||
virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
virtual nsresult Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
||||
/**
|
||||
* Get the "type" of the frame
|
||||
|
|
|
@ -827,7 +827,7 @@ nsMathMLContainerFrame::UpdateOverflow()
|
|||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsMathMLContainerFrame::ReflowChild(nsIFrame* aChildFrame,
|
||||
nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
|
@ -849,10 +849,13 @@ nsMathMLContainerFrame::ReflowChild(nsIFrame* aChildFrame,
|
|||
NS_ASSERTION(!inlineFrame, "Inline frames should be wrapped in blocks");
|
||||
#endif
|
||||
|
||||
nsContainerFrame::
|
||||
nsresult rv = nsContainerFrame::
|
||||
ReflowChild(aChildFrame, aPresContext, aDesiredSize, aReflowState,
|
||||
0, 0, NS_FRAME_NO_MOVE_FRAME, aStatus);
|
||||
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
if (aDesiredSize.TopAscent() == nsHTMLReflowMetrics::ASK_FOR_BASELINE) {
|
||||
// This will be suitable for inline frames, which are wrapped in a block.
|
||||
nscoord ascent;
|
||||
|
@ -875,9 +878,10 @@ nsMathMLContainerFrame::ReflowChild(nsIFrame* aChildFrame,
|
|||
aDesiredSize.mBoundingMetrics.descent = r.YMost() - aDesiredSize.TopAscent();
|
||||
aDesiredSize.mBoundingMetrics.width = aDesiredSize.Width();
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsMathMLContainerFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -899,9 +903,15 @@ nsMathMLContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||
aDesiredSize.mFlags);
|
||||
nsHTMLReflowState childReflowState(aPresContext, aReflowState,
|
||||
childFrame, availSize);
|
||||
ReflowChild(childFrame, aPresContext, childDesiredSize,
|
||||
childReflowState, childStatus);
|
||||
nsresult rv = ReflowChild(childFrame, aPresContext, childDesiredSize,
|
||||
childReflowState, childStatus);
|
||||
//NS_ASSERTION(NS_FRAME_IS_COMPLETE(childStatus), "bad status");
|
||||
if (NS_FAILED(rv)) {
|
||||
// Call DidReflow() for the child frames we successfully did reflow.
|
||||
DidReflowChildren(mFrames.FirstChild(), childFrame);
|
||||
return rv;
|
||||
}
|
||||
|
||||
SaveReflowAndBoundingMetricsFor(childFrame, childDesiredSize,
|
||||
childDesiredSize.mBoundingMetrics);
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
|
@ -958,6 +968,7 @@ nsMathMLContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||
|
||||
aStatus = NS_FRAME_COMPLETE;
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
static nscoord AddInterFrameSpacingToSize(nsHTMLReflowMetrics& aDesiredSize,
|
||||
|
|
|
@ -106,20 +106,21 @@ public:
|
|||
GetIntrinsicWidthMetrics(nsRenderingContext* aRenderingContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize);
|
||||
|
||||
virtual void
|
||||
virtual nsresult
|
||||
Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
||||
|
||||
virtual void
|
||||
virtual nsresult
|
||||
WillReflow(nsPresContext* aPresContext) MOZ_OVERRIDE
|
||||
{
|
||||
mPresentationData.flags &= ~NS_MATHML_ERROR;
|
||||
nsContainerFrame::WillReflow(aPresContext);
|
||||
return nsContainerFrame::WillReflow(aPresContext);
|
||||
}
|
||||
|
||||
virtual void DidReflow(nsPresContext* aPresContext,
|
||||
virtual nsresult
|
||||
DidReflow(nsPresContext* aPresContext,
|
||||
const nsHTMLReflowState* aReflowState,
|
||||
nsDidReflowStatus aStatus) MOZ_OVERRIDE
|
||||
|
||||
|
@ -276,7 +277,7 @@ public:
|
|||
// helper method to reflow a child frame. We are inline frames, and we don't
|
||||
// know our positions until reflow is finished. That's why we ask the
|
||||
// base method not to worry about our position.
|
||||
void
|
||||
nsresult
|
||||
ReflowChild(nsIFrame* aKidFrame,
|
||||
nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
|
|
|
@ -99,12 +99,13 @@ nsMathMLSelectedFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
}
|
||||
|
||||
// Only reflow the selected child ...
|
||||
void
|
||||
nsresult
|
||||
nsMathMLSelectedFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
aStatus = NS_FRAME_COMPLETE;
|
||||
aDesiredSize.Width() = aDesiredSize.Height() = 0;
|
||||
aDesiredSize.SetTopAscent(0);
|
||||
|
@ -114,14 +115,15 @@ nsMathMLSelectedFrame::Reflow(nsPresContext* aPresContext,
|
|||
nsSize availSize(aReflowState.ComputedWidth(), NS_UNCONSTRAINEDSIZE);
|
||||
nsHTMLReflowState childReflowState(aPresContext, aReflowState,
|
||||
childFrame, availSize);
|
||||
ReflowChild(childFrame, aPresContext, aDesiredSize,
|
||||
childReflowState, aStatus);
|
||||
rv = ReflowChild(childFrame, aPresContext, aDesiredSize,
|
||||
childReflowState, aStatus);
|
||||
SaveReflowAndBoundingMetricsFor(childFrame, aDesiredSize,
|
||||
aDesiredSize.mBoundingMetrics);
|
||||
mBoundingMetrics = aDesiredSize.mBoundingMetrics;
|
||||
}
|
||||
FinalizeReflow(*aReflowState.rendContext, aDesiredSize);
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
||||
return rv;
|
||||
}
|
||||
|
||||
// Only place the selected child ...
|
||||
|
|
|
@ -34,7 +34,7 @@ public:
|
|||
bool aPlaceOrigin,
|
||||
nsHTMLReflowMetrics& aDesiredSize) MOZ_OVERRIDE;
|
||||
|
||||
virtual void
|
||||
virtual nsresult
|
||||
Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
|
|
@ -134,12 +134,14 @@ nsMathMLTokenFrame::InsertFrames(ChildListID aListID,
|
|||
return rv;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsMathMLTokenFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
// initializations needed for empty markup like <mtag></mtag>
|
||||
aDesiredSize.Width() = aDesiredSize.Height() = 0;
|
||||
aDesiredSize.SetTopAscent(0);
|
||||
|
@ -154,20 +156,28 @@ nsMathMLTokenFrame::Reflow(nsPresContext* aPresContext,
|
|||
| NS_REFLOW_CALC_BOUNDING_METRICS);
|
||||
nsHTMLReflowState childReflowState(aPresContext, aReflowState,
|
||||
childFrame, availSize);
|
||||
ReflowChild(childFrame, aPresContext, childDesiredSize,
|
||||
childReflowState, aStatus);
|
||||
rv = ReflowChild(childFrame, aPresContext, childDesiredSize,
|
||||
childReflowState, aStatus);
|
||||
//NS_ASSERTION(NS_FRAME_IS_COMPLETE(aStatus), "bad status");
|
||||
if (NS_FAILED(rv)) {
|
||||
// Call DidReflow() for the child frames we successfully did reflow.
|
||||
DidReflowChildren(GetFirstPrincipalChild(), childFrame);
|
||||
return rv;
|
||||
}
|
||||
|
||||
SaveReflowAndBoundingMetricsFor(childFrame, childDesiredSize,
|
||||
childDesiredSize.mBoundingMetrics);
|
||||
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
|
||||
|
||||
// place and size children
|
||||
FinalizeReflow(*aReflowState.rendContext, aDesiredSize);
|
||||
|
||||
aStatus = NS_FRAME_COMPLETE;
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// For token elements, mBoundingMetrics is computed at the ReflowToken
|
||||
|
|
|
@ -47,7 +47,7 @@ public:
|
|||
nsIFrame* aPrevFrame,
|
||||
nsFrameList& aChildList) MOZ_OVERRIDE;
|
||||
|
||||
virtual void
|
||||
virtual nsresult
|
||||
Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
|
|
@ -184,12 +184,13 @@ nsMathMLmfencedFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsMathMLmfencedFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
nsresult rv;
|
||||
aDesiredSize.Width() = aDesiredSize.Height() = 0;
|
||||
aDesiredSize.SetTopAscent(0);
|
||||
aDesiredSize.mBoundingMetrics = nsBoundingMetrics();
|
||||
|
@ -235,9 +236,15 @@ nsMathMLmfencedFrame::Reflow(nsPresContext* aPresContext,
|
|||
| NS_REFLOW_CALC_BOUNDING_METRICS);
|
||||
nsHTMLReflowState childReflowState(aPresContext, aReflowState,
|
||||
childFrame, availSize);
|
||||
ReflowChild(childFrame, aPresContext, childDesiredSize,
|
||||
childReflowState, childStatus);
|
||||
rv = ReflowChild(childFrame, aPresContext, childDesiredSize,
|
||||
childReflowState, childStatus);
|
||||
//NS_ASSERTION(NS_FRAME_IS_COMPLETE(childStatus), "bad status");
|
||||
if (NS_FAILED(rv)) {
|
||||
// Call DidReflow() for the child frames we successfully did reflow.
|
||||
DidReflowChildren(firstChild, childFrame);
|
||||
return rv;
|
||||
}
|
||||
|
||||
SaveReflowAndBoundingMetricsFor(childFrame, childDesiredSize,
|
||||
childDesiredSize.mBoundingMetrics);
|
||||
|
||||
|
@ -400,6 +407,7 @@ nsMathMLmfencedFrame::Reflow(nsPresContext* aPresContext,
|
|||
|
||||
aStatus = NS_FRAME_COMPLETE;
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -32,7 +32,7 @@ public:
|
|||
SetInitialChildList(ChildListID aListID,
|
||||
nsFrameList& aChildList) MOZ_OVERRIDE;
|
||||
|
||||
virtual void
|
||||
virtual nsresult
|
||||
Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
|
|
@ -935,7 +935,7 @@ nsMathMLmoFrame::SetInitialChildList(ChildListID aListID,
|
|||
return rv;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsMathMLmoFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -945,8 +945,8 @@ nsMathMLmoFrame::Reflow(nsPresContext* aPresContext,
|
|||
// it is safer to just process the whole lot here
|
||||
ProcessOperatorData();
|
||||
|
||||
nsMathMLTokenFrame::Reflow(aPresContext, aDesiredSize,
|
||||
aReflowState, aStatus);
|
||||
return nsMathMLTokenFrame::Reflow(aPresContext, aDesiredSize,
|
||||
aReflowState, aStatus);
|
||||
}
|
||||
|
||||
/* virtual */ void
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
SetInitialChildList(ChildListID aListID,
|
||||
nsFrameList& aChildList) MOZ_OVERRIDE;
|
||||
|
||||
virtual void
|
||||
virtual nsresult
|
||||
Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
|
|
@ -300,7 +300,7 @@ nsMathMLmpaddedFrame::UpdateValue(int32_t aSign,
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsMathMLmpaddedFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -310,9 +310,10 @@ nsMathMLmpaddedFrame::Reflow(nsPresContext* aPresContext,
|
|||
|
||||
///////////////
|
||||
// Let the base class format our content like an inferred mrow
|
||||
nsMathMLContainerFrame::Reflow(aPresContext, aDesiredSize,
|
||||
aReflowState, aStatus);
|
||||
nsresult rv = nsMathMLContainerFrame::Reflow(aPresContext, aDesiredSize,
|
||||
aReflowState, aStatus);
|
||||
//NS_ASSERTION(NS_FRAME_IS_COMPLETE(aStatus), "bad status");
|
||||
return rv;
|
||||
}
|
||||
|
||||
/* virtual */ nsresult
|
||||
|
|
|
@ -27,7 +27,7 @@ public:
|
|||
return TransmitAutomaticDataForMrowLikeElement();
|
||||
}
|
||||
|
||||
virtual void
|
||||
virtual nsresult
|
||||
Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
|
|
@ -145,12 +145,13 @@ GetRadicalXOffsets(nscoord aIndexWidth, nscoord aSqrWidth,
|
|||
*aSqrOffset = dxSqr;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsMathMLmrootFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
nsSize availSize(aReflowState.ComputedWidth(), NS_UNCONSTRAINEDSIZE);
|
||||
nsReflowStatus childStatus;
|
||||
|
||||
|
@ -176,9 +177,14 @@ nsMathMLmrootFrame::Reflow(nsPresContext* aPresContext,
|
|||
| NS_REFLOW_CALC_BOUNDING_METRICS);
|
||||
nsHTMLReflowState childReflowState(aPresContext, aReflowState,
|
||||
childFrame, availSize);
|
||||
ReflowChild(childFrame, aPresContext,
|
||||
rv = ReflowChild(childFrame, aPresContext,
|
||||
childDesiredSize, childReflowState, childStatus);
|
||||
//NS_ASSERTION(NS_FRAME_IS_COMPLETE(childStatus), "bad status");
|
||||
if (NS_FAILED(rv)) {
|
||||
// Call DidReflow() for the child frames we successfully did reflow.
|
||||
DidReflowChildren(mFrames.FirstChild(), childFrame);
|
||||
return rv;
|
||||
}
|
||||
if (0 == count) {
|
||||
// base
|
||||
baseFrame = childFrame;
|
||||
|
@ -197,12 +203,12 @@ nsMathMLmrootFrame::Reflow(nsPresContext* aPresContext,
|
|||
if (2 != count) {
|
||||
// report an error, encourage people to get their markups in order
|
||||
ReportChildCountError();
|
||||
ReflowError(renderingContext, aDesiredSize);
|
||||
rv = ReflowError(renderingContext, aDesiredSize);
|
||||
aStatus = NS_FRAME_COMPLETE;
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
||||
// Call DidReflow() for the child frames we successfully did reflow.
|
||||
DidReflowChildren(mFrames.FirstChild(), childFrame);
|
||||
return;
|
||||
return rv;
|
||||
}
|
||||
|
||||
////////////
|
||||
|
@ -345,6 +351,7 @@ nsMathMLmrootFrame::Reflow(nsPresContext* aPresContext,
|
|||
|
||||
aStatus = NS_FRAME_COMPLETE;
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* virtual */ void
|
||||
|
|
|
@ -34,7 +34,7 @@ public:
|
|||
NS_IMETHOD
|
||||
TransmitAutomaticData() MOZ_OVERRIDE;
|
||||
|
||||
virtual void
|
||||
virtual nsresult
|
||||
Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
|
|
@ -91,7 +91,7 @@ nsMathMLmspaceFrame::ProcessAttributes(nsPresContext* aPresContext)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsMathMLmspaceFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -114,6 +114,7 @@ nsMathMLmspaceFrame::Reflow(nsPresContext* aPresContext,
|
|||
|
||||
aStatus = NS_FRAME_COMPLETE;
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* virtual */ nsresult
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
|
||||
virtual bool IsLeaf() const MOZ_OVERRIDE;
|
||||
|
||||
virtual void
|
||||
virtual nsresult
|
||||
Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
|
|
@ -545,16 +545,18 @@ nsMathMLmtableOuterFrame::GetRowFrameAt(nsPresContext* aPresContext,
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsMathMLmtableOuterFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
nsresult rv;
|
||||
nsAutoString value;
|
||||
// we want to return a table that is anchored according to the align attribute
|
||||
|
||||
nsTableOuterFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
|
||||
rv = nsTableOuterFrame::Reflow(aPresContext, aDesiredSize, aReflowState,
|
||||
aStatus);
|
||||
NS_ASSERTION(aDesiredSize.Height() >= 0, "illegal height for mtable");
|
||||
NS_ASSERTION(aDesiredSize.Width() >= 0, "illegal width for mtable");
|
||||
|
||||
|
@ -645,6 +647,8 @@ nsMathMLmtableOuterFrame::Reflow(nsPresContext* aPresContext,
|
|||
|
||||
aDesiredSize.mBoundingMetrics = mBoundingMetrics;
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsIFrame*
|
||||
|
@ -884,17 +888,18 @@ nsMathMLmtdInnerFrame::~nsMathMLmtdInnerFrame()
|
|||
mUniqueStyleText->Destroy(PresContext());
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsMathMLmtdInnerFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
// Let the base class do the reflow
|
||||
nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
|
||||
nsresult rv = nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
|
||||
|
||||
// more about <maligngroup/> and <malignmark/> later
|
||||
// ...
|
||||
return rv;
|
||||
}
|
||||
|
||||
const
|
||||
|
|
|
@ -28,7 +28,7 @@ public:
|
|||
|
||||
// overloaded nsTableOuterFrame methods
|
||||
|
||||
virtual void
|
||||
virtual nsresult
|
||||
Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -236,7 +236,7 @@ public:
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
virtual void
|
||||
virtual nsresult
|
||||
Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
|
|
@ -116,7 +116,7 @@ nsSVGForeignObjectFrame::AttributeChanged(int32_t aNameSpaceID,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsresult
|
||||
nsSVGForeignObjectFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
|
@ -148,6 +148,8 @@ nsSVGForeignObjectFrame::Reflow(nsPresContext* aPresContext,
|
|||
aDesiredSize.Height() = aReflowState.ComputedHeight();
|
||||
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
||||
aStatus = NS_FRAME_COMPLETE;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче