--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -8697,17 +8697,17 @@ nsLayoutUtils::IsOutlineStyleAutoEnabled
"layout.css.outline-style-auto.enabled",
false);
}
return sOutlineStyleAutoEnabled;
}
/* static */ void
nsLayoutUtils::SetBSizeFromFontMetrics(const nsIFrame* aFrame,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
const LogicalMargin& aFramePadding,
WritingMode aLineWM,
WritingMode aFrameWM)
{
RefPtr<nsFontMetrics> fm =
nsLayoutUtils::GetInflatedFontMetricsForFrame(aFrame);
if (fm) {
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -2727,17 +2727,17 @@ public:
* displayport and attempts to trigger the displayport expiry on that
* ancestor.
*/
static void ExpireDisplayPortOnAsyncScrollableAncestor(nsIFrame* aFrame);
static bool IsOutlineStyleAutoEnabled();
static void SetBSizeFromFontMetrics(const nsIFrame* aFrame,
- mozilla::nsHTMLReflowMetrics& aMetrics,
+ mozilla::ReflowOutput& aMetrics,
const mozilla::LogicalMargin& aFramePadding,
mozilla::WritingMode aLineWM,
mozilla::WritingMode aFrameWM);
static bool HasDocumentLevelListenersForApzAwareEvents(nsIPresShell* aShell);
/**
* Set the scroll port size for the purpose of clamping the scroll position
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -9588,17 +9588,17 @@ PresShell::DoReflow(nsIFrame* target, bo
size.ISize(wm) -
reflowState.ComputedLogicalBorderPadding().IStartEnd(wm),
"reflow state computed incorrect inline size");
mPresContext->ReflowStarted(aInterruptible);
mIsReflowing = true;
nsReflowStatus status;
- nsHTMLReflowMetrics desiredSize(reflowState);
+ ReflowOutput desiredSize(reflowState);
target->Reflow(mPresContext, desiredSize, reflowState, status);
// If an incremental reflow is initiated at a frame other than the
// root frame, then its desired size had better not change! If it's
// initiated at the root, then the size better not change unless its
// height was unconstrained to start with.
nsRect boundsRelativeToTarget = nsRect(0, 0, desiredSize.Width(), desiredSize.Height());
NS_ASSERTION((target == rootFrame &&
--- a/layout/forms/nsComboboxControlFrame.cpp
+++ b/layout/forms/nsComboboxControlFrame.cpp
@@ -465,17 +465,17 @@ nsComboboxControlFrame::ReflowDropdown(n
//XXX Can this be different from the dropdown's writing mode?
// That would be odd!
// Note that we don't need to pass the true frame position or container size
// to ReflowChild or FinishReflowChild here; it will be positioned as needed
// by AbsolutelyPositionDropDown().
WritingMode outerWM = GetWritingMode();
const nsSize dummyContainerSize;
- nsHTMLReflowMetrics desiredSize(aReflowState);
+ ReflowOutput desiredSize(aReflowState);
nsReflowStatus ignoredStatus;
ReflowChild(mDropdownFrame, aPresContext, desiredSize,
kidReflowState, outerWM, LogicalPoint(outerWM),
dummyContainerSize, flags, ignoredStatus);
// Set the child's width and height to its desired size
FinishReflowChild(mDropdownFrame, aPresContext, desiredSize, &kidReflowState,
outerWM, LogicalPoint(outerWM), dummyContainerSize, flags);
@@ -803,17 +803,17 @@ nsComboboxControlFrame::GetPrefISize(nsR
nscoord prefISize;
DISPLAY_PREF_WIDTH(this, prefISize);
prefISize = GetIntrinsicISize(aRenderingContext, nsLayoutUtils::PREF_ISIZE);
return prefISize;
}
void
nsComboboxControlFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
// Constraints we try to satisfy:
// 1) Default inline size of button is the vertical scrollbar size
// 2) If the inline size of button is bigger than our inline size, set
@@ -1281,17 +1281,17 @@ public:
virtual bool IsFrameOfType(uint32_t aFlags) const override
{
return nsBlockFrame::IsFrameOfType(aFlags &
~(nsIFrame::eReplacedContainsBlock));
}
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
protected:
@@ -1303,17 +1303,17 @@ NS_IMPL_FRAMEARENA_HELPERS(nsComboboxDis
nsIAtom*
nsComboboxDisplayFrame::GetType() const
{
return nsGkAtoms::comboboxDisplayFrame;
}
void
nsComboboxDisplayFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
ReflowInput state(aReflowState);
if (state.ComputedBSize() == NS_INTRINSICSIZE) {
// Note that the only way we can have a computed block size here is
// if the combobox had a specified block size. If it didn't, size
// based on what our rows look like, for lack of anything better.
--- a/layout/forms/nsComboboxControlFrame.h
+++ b/layout/forms/nsComboboxControlFrame.h
@@ -75,17 +75,17 @@ public:
virtual mozilla::a11y::AccType AccessibleType() override;
#endif
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
virtual void Reflow(nsPresContext* aCX,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual nsresult HandleEvent(nsPresContext* aPresContext,
mozilla::WidgetGUIEvent* aEvent,
nsEventStatus* aEventStatus) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
--- a/layout/forms/nsFieldSetFrame.cpp
+++ b/layout/forms/nsFieldSetFrame.cpp
@@ -378,17 +378,17 @@ nsFieldSetFrame::ComputeSize(nsRendering
result.ISize(aWM) = minISize;
}
return result;
}
void
nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsFieldSetFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
NS_PRECONDITION(aReflowState.ComputedISize() != NS_INTRINSICSIZE,
@@ -450,17 +450,17 @@ nsFieldSetFrame::Reflow(nsPresContext*
LogicalMargin legendMargin(wm);
// reflow the legend only if needed
Maybe<ReflowInput> legendReflowState;
if (legend) {
legendReflowState.emplace(aPresContext, aReflowState, legend,
legendAvailSize);
}
if (reflowLegend) {
- nsHTMLReflowMetrics legendDesiredSize(aReflowState);
+ ReflowOutput legendDesiredSize(aReflowState);
// We'll move the legend to its proper place later, so the position
// and containerSize passed here are unimportant.
const nsSize dummyContainerSize;
ReflowChild(legend, aPresContext, legendDesiredSize, *legendReflowState,
wm, LogicalPoint(wm), dummyContainerSize,
NS_FRAME_NO_MOVE_FRAME, aStatus);
#ifdef NOISY_REFLOW
@@ -526,17 +526,17 @@ nsFieldSetFrame::Reflow(nsPresContext*
std::max(0, aReflowState.ComputedMinBSize() - mLegendSpace);
}
if (aReflowState.ComputedMaxBSize() != NS_UNCONSTRAINEDSIZE) {
kidReflowState.ComputedMaxBSize() =
std::max(0, aReflowState.ComputedMaxBSize() - mLegendSpace);
}
- nsHTMLReflowMetrics kidDesiredSize(kidReflowState,
+ ReflowOutput kidDesiredSize(kidReflowState,
aDesiredSize.mFlags);
// Reflow the frame
NS_ASSERTION(kidReflowState.ComputedPhysicalMargin() == nsMargin(0,0,0,0),
"Margins on anonymous fieldset child not supported!");
LogicalPoint pt(wm, border.IStart(wm), border.BStart(wm) + mLegendSpace);
// We don't know the correct containerSize until we have reflowed |inner|,
// so we use a dummy value for now; FinishReflowChild will fix the position
--- a/layout/forms/nsFieldSetFrame.h
+++ b/layout/forms/nsFieldSetFrame.h
@@ -37,17 +37,17 @@ public:
/**
* The area to paint box-shadows around. It's the border rect except
* when there's a <legend> we offset the y-position to the center of it.
*/
virtual nsRect VisualBorderRectRelativeToSelf() const override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
DrawResult PaintBorder(nsDisplayListBuilder* aBuilder,
--- a/layout/forms/nsFormControlFrame.cpp
+++ b/layout/forms/nsFormControlFrame.cpp
@@ -109,17 +109,17 @@ nsFormControlFrame::GetLogicalBaseline(W
return aWritingMode.IsLineInverted()
? GetLogicalUsedBorderAndPadding(aWritingMode).BStart(aWritingMode)
: BSize(aWritingMode) -
GetLogicalUsedBorderAndPadding(aWritingMode).BEnd(aWritingMode);
}
void
nsFormControlFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsFormControlFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
("enter nsFormControlFrame::Reflow: aMaxSize=%d,%d",
--- a/layout/forms/nsFormControlFrame.h
+++ b/layout/forms/nsFormControlFrame.h
@@ -77,17 +77,17 @@ public:
virtual nscoord GetLogicalBaseline(mozilla::WritingMode aWritingMode)
const override;
/**
* Respond to the request to resize and/or reflow
* @see nsIFrame::Reflow
*/
virtual void Reflow(nsPresContext* aCX,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
// new behavior
virtual void SetFocus(bool aOn = true, bool aRepaint = false) override;
--- a/layout/forms/nsHTMLButtonControlFrame.cpp
+++ b/layout/forms/nsHTMLButtonControlFrame.cpp
@@ -179,17 +179,17 @@ nsHTMLButtonControlFrame::GetPrefISize(n
? mRenderer.GetAddedButtonBorderAndPadding().TopBottom()
: mRenderer.GetAddedButtonBorderAndPadding().LeftRight();
return result;
}
void
nsHTMLButtonControlFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsHTMLButtonControlFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
NS_PRECONDITION(aReflowState.ComputedISize() != NS_INTRINSICSIZE,
@@ -262,17 +262,17 @@ CloneReflowStateWithReducedContentBox(
clone.SetComputedWidth(adjustedWidth);
clone.SetComputedHeight(adjustedHeight);
return clone;
}
void
nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aButtonDesiredSize,
+ ReflowOutput& aButtonDesiredSize,
const ReflowInput& aButtonReflowState,
nsIFrame* aFirstKid)
{
WritingMode wm = GetWritingMode();
LogicalSize availSize = aButtonReflowState.ComputedSize(wm);
availSize.BSize(wm) = NS_INTRINSICSIZE;
// Buttons have some bonus renderer-determined border/padding,
@@ -319,17 +319,17 @@ nsHTMLButtonControlFrame::ReflowButtonCo
CloneReflowStateWithReducedContentBox(aButtonReflowState,
focusPadding.GetPhysicalMargin(wm));
ReflowInput contentsReflowState(aPresContext,
adjustedButtonReflowState,
aFirstKid, availSize);
nsReflowStatus contentsReflowStatus;
- nsHTMLReflowMetrics contentsDesiredSize(aButtonReflowState);
+ ReflowOutput contentsDesiredSize(aButtonReflowState);
childPos.B(wm) = 0; // This will be set properly later, after reflowing the
// child to determine its size.
// We just pass a dummy containerSize here, as the child will be
// repositioned later by FinishReflowChild.
nsSize dummyContainerSize;
ReflowChild(aFirstKid, aPresContext,
contentsDesiredSize, contentsReflowState,
@@ -387,17 +387,17 @@ nsHTMLButtonControlFrame::ReflowButtonCo
// Place the child
FinishReflowChild(aFirstKid, aPresContext,
contentsDesiredSize, &contentsReflowState,
wm, childPos, containerSize, 0);
// Make sure we have a useful 'ascent' value for the child
if (contentsDesiredSize.BlockStartAscent() ==
- nsHTMLReflowMetrics::ASK_FOR_BASELINE) {
+ ReflowOutput::ASK_FOR_BASELINE) {
WritingMode wm = aButtonReflowState.GetWritingMode();
contentsDesiredSize.SetBlockStartAscent(aFirstKid->GetLogicalBaseline(wm));
}
// OK, we're done with the child frame.
// Use what we learned to populate the button frame's reflow metrics.
// * Button's height & width are content-box size + border-box contribution:
aButtonDesiredSize.SetSize(wm,
--- a/layout/forms/nsHTMLButtonControlFrame.h
+++ b/layout/forms/nsHTMLButtonControlFrame.h
@@ -30,17 +30,17 @@ public:
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual nsresult HandleEvent(nsPresContext* aPresContext,
mozilla::WidgetGUIEvent* aEvent,
nsEventStatus* aEventStatus) override;
virtual void Init(nsIContent* aContent,
@@ -96,17 +96,17 @@ protected:
// Indicates whether we should clip our children's painting to our
// border-box (either because of "overflow" or because of legacy reasons
// about how <input>-flavored buttons work).
bool ShouldClipPaintingToBorderBox();
// Reflows the button's sole child frame, and computes the desired size
// of the button itself from the results.
void ReflowButtonContents(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aButtonDesiredSize,
+ ReflowOutput& aButtonDesiredSize,
const ReflowInput& aButtonReflowState,
nsIFrame* aFirstKid);
nsButtonFrameRenderer mRenderer;
};
#endif
--- a/layout/forms/nsImageControlFrame.cpp
+++ b/layout/forms/nsImageControlFrame.cpp
@@ -26,17 +26,17 @@ public:
virtual void Init(nsIContent* aContent,
nsContainerFrame* aParent,
nsIFrame* aPrevInFlow) override;
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual nsresult HandleEvent(nsPresContext* aPresContext,
WidgetGUIEvent* aEvent,
nsEventStatus* aEventStatus) override;
virtual nsIAtom* GetType() const override;
@@ -121,17 +121,17 @@ nsImageControlFrame::AccessibleType()
nsIAtom*
nsImageControlFrame::GetType() const
{
return nsGkAtoms::imageControlFrame;
}
void
nsImageControlFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
DO_GLOBAL_REFLOW_COUNT("nsImageControlFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
if (!GetPrevInFlow() && (mState & NS_FRAME_FIRST_REFLOW)) {
nsFormControlFrame::RegUnRegAccessKey(this, true);
}
--- a/layout/forms/nsLegendFrame.cpp
+++ b/layout/forms/nsLegendFrame.cpp
@@ -44,17 +44,17 @@ nsLegendFrame::DestroyFrom(nsIFrame* aDe
}
NS_QUERYFRAME_HEAD(nsLegendFrame)
NS_QUERYFRAME_ENTRY(nsLegendFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsBlockFrame)
void
nsLegendFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
DO_GLOBAL_REFLOW_COUNT("nsLegendFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
if (mState & NS_FRAME_FIRST_REFLOW) {
nsFormControlFrame::RegUnRegAccessKey(static_cast<nsIFrame*>(this), true);
}
--- a/layout/forms/nsLegendFrame.h
+++ b/layout/forms/nsLegendFrame.h
@@ -13,17 +13,17 @@ class nsLegendFrame : public nsBlockFram
public:
NS_DECL_QUERYFRAME_TARGET(nsLegendFrame)
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
explicit nsLegendFrame(nsStyleContext* aContext) : nsBlockFrame(aContext) {}
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
virtual nsIAtom* GetType() const override;
#ifdef DEBUG_FRAME_DUMP
--- a/layout/forms/nsListControlFrame.cpp
+++ b/layout/forms/nsListControlFrame.cpp
@@ -350,17 +350,17 @@ nsListControlFrame::GetMinISize(nsRender
aRenderingContext));
result += scrollbarSize.IStartEnd(wm);
return result;
}
void
nsListControlFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
NS_PRECONDITION(aReflowState.ComputedISize() != NS_UNCONSTRAINEDSIZE,
"Must have a computed inline size");
SchedulePaint();
@@ -488,17 +488,17 @@ nsListControlFrame::Reflow(nsPresContext
// 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);
}
void
nsListControlFrame::ReflowAsDropdown(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
NS_PRECONDITION(aReflowState.ComputedBSize() == NS_UNCONSTRAINEDSIZE,
"We should not have a computed block size here!");
mMightNeedSecondPass = NS_SUBTREE_DIRTY(this) ||
aReflowState.ShouldReflowAllKids();
--- a/layout/forms/nsListControlFrame.h
+++ b/layout/forms/nsListControlFrame.h
@@ -62,17 +62,17 @@ public:
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;
virtual void Reflow(nsPresContext* aCX,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual void Init(nsIContent* aContent,
nsContainerFrame* aParent,
nsIFrame* aPrevInFlow) override;
virtual void DidReflow(nsPresContext* aPresContext,
@@ -340,17 +340,17 @@ protected:
void SetComboboxItem(int32_t aIndex);
/**
* Method to reflow ourselves as a dropdown list. This differs from
* 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,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus);
// Selection
bool SetOptionsSelectedFromFrame(int32_t aStartIndex,
int32_t aEndIndex,
bool aValue,
bool aClearAll);
--- a/layout/forms/nsMeterFrame.cpp
+++ b/layout/forms/nsMeterFrame.cpp
@@ -99,17 +99,17 @@ nsMeterFrame::AppendAnonymousContentTo(n
NS_QUERYFRAME_HEAD(nsMeterFrame)
NS_QUERYFRAME_ENTRY(nsMeterFrame)
NS_QUERYFRAME_ENTRY(nsIAnonymousContentCreator)
NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
void
nsMeterFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsMeterFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
NS_ASSERTION(mBarDiv, "Meter bar div must exist!");
@@ -185,17 +185,17 @@ nsMeterFrame::ReflowBarFrame(nsIFrame*
reflowState.ComputedPhysicalBorderPadding().LeftRight();
size = std::max(size, 0);
reflowState.SetComputedWidth(size);
}
xoffset += reflowState.ComputedPhysicalMargin().left;
yoffset += reflowState.ComputedPhysicalMargin().top;
- nsHTMLReflowMetrics barDesiredSize(reflowState);
+ ReflowOutput barDesiredSize(reflowState);
ReflowChild(aBarFrame, aPresContext, barDesiredSize, reflowState, xoffset,
yoffset, 0, aStatus);
FinishReflowChild(aBarFrame, aPresContext, barDesiredSize, &reflowState,
xoffset, yoffset, 0);
}
nsresult
nsMeterFrame::AttributeChanged(int32_t aNameSpaceID,
--- a/layout/forms/nsMeterFrame.h
+++ b/layout/forms/nsMeterFrame.h
@@ -24,17 +24,17 @@ public:
NS_DECL_FRAMEARENA_HELPERS
explicit nsMeterFrame(nsStyleContext* aContext);
virtual ~nsMeterFrame();
virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
virtual void Reflow(nsPresContext* aCX,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual nsIAtom* GetType() const override;
#ifdef DEBUG_FRAME_DUMP
virtual nsresult GetFrameName(nsAString& aResult) const override {
return MakeFrameName(NS_LITERAL_STRING("Meter"), aResult);
--- a/layout/forms/nsNumberControlFrame.cpp
+++ b/layout/forms/nsNumberControlFrame.cpp
@@ -100,17 +100,17 @@ nsNumberControlFrame::GetPrefISize(nsRen
result = 0;
}
return result;
}
void
nsNumberControlFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsNumberControlFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
NS_ASSERTION(mOuterWrapper, "Outer wrapper div must exist!");
@@ -151,17 +151,17 @@ nsNumberControlFrame::Reflow(nsPresConte
if (contentBoxBSize == NS_INTRINSICSIZE) {
contentBoxBSize = 0;
borderBoxBSize =
aReflowState.ComputedLogicalBorderPadding().BStartEnd(myWM);
}
} else {
NS_ASSERTION(outerWrapperFrame == mFrames.FirstChild(), "huh?");
- nsHTMLReflowMetrics wrappersDesiredSize(aReflowState);
+ ReflowOutput wrappersDesiredSize(aReflowState);
WritingMode wrapperWM = outerWrapperFrame->GetWritingMode();
LogicalSize availSize = aReflowState.ComputedSize(wrapperWM);
availSize.BSize(wrapperWM) = NS_UNCONSTRAINEDSIZE;
ReflowInput wrapperReflowState(aPresContext, aReflowState,
outerWrapperFrame, availSize);
--- a/layout/forms/nsNumberControlFrame.h
+++ b/layout/forms/nsNumberControlFrame.h
@@ -55,17 +55,17 @@ public:
virtual mozilla::a11y::AccType AccessibleType() override;
#endif
virtual nscoord GetMinISize(nsRenderingContext* aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext* aRenderingContext) override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual nsresult AttributeChanged(int32_t aNameSpaceID,
nsIAtom* aAttribute,
int32_t aModType) override;
// nsIAnonymousContentCreator
--- a/layout/forms/nsProgressFrame.cpp
+++ b/layout/forms/nsProgressFrame.cpp
@@ -104,17 +104,17 @@ nsProgressFrame::BuildDisplayList(nsDisp
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
BuildDisplayListForInline(aBuilder, aDirtyRect, aLists);
}
void
nsProgressFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsProgressFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
NS_ASSERTION(mBarDiv, "Progress bar div must exist!");
@@ -198,17 +198,17 @@ nsProgressFrame::ReflowBarFrame(nsIFrame
// the width isn't constrained (position == -1 and !ShouldUseNativeStyle())
// because aReflowState.ComputedHeight() - size == 0.
yoffset += aReflowState.ComputedHeight() - reflowState.ComputedHeight();
}
xoffset += reflowState.ComputedPhysicalMargin().left;
yoffset += reflowState.ComputedPhysicalMargin().top;
- nsHTMLReflowMetrics barDesiredSize(aReflowState);
+ ReflowOutput barDesiredSize(aReflowState);
ReflowChild(aBarFrame, aPresContext, barDesiredSize, reflowState, xoffset,
yoffset, 0, aStatus);
FinishReflowChild(aBarFrame, aPresContext, barDesiredSize, &reflowState,
xoffset, yoffset, 0);
}
nsresult
nsProgressFrame::AttributeChanged(int32_t aNameSpaceID,
--- a/layout/forms/nsProgressFrame.h
+++ b/layout/forms/nsProgressFrame.h
@@ -31,17 +31,17 @@ public:
virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual void Reflow(nsPresContext* aCX,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual nsIAtom* GetType() const override;
#ifdef DEBUG_FRAME_DUMP
virtual nsresult GetFrameName(nsAString& aResult) const override {
return MakeFrameName(NS_LITERAL_STRING("Progress"), aResult);
--- a/layout/forms/nsRangeFrame.cpp
+++ b/layout/forms/nsRangeFrame.cpp
@@ -309,17 +309,17 @@ nsRangeFrame::BuildDisplayList(nsDisplay
}
aLists.Content()->AppendNewToTop(
new (aBuilder) nsDisplayRangeFocusRing(aBuilder, this));
}
void
nsRangeFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsRangeFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
NS_ASSERTION(mTrackDiv, "::-moz-range-track div must exist!");
@@ -369,17 +369,17 @@ nsRangeFrame::Reflow(nsPresContext*
aStatus = NS_FRAME_COMPLETE;
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
}
void
nsRangeFrame::ReflowAnonymousContent(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState)
{
// The width/height of our content box, which is the available width/height
// for our anonymous content:
nscoord rangeFrameContentBoxWidth = aReflowState.ComputedWidth();
nscoord rangeFrameContentBoxHeight = aReflowState.ComputedHeight();
if (rangeFrameContentBoxHeight == NS_AUTOHEIGHT) {
rangeFrameContentBoxHeight = 0;
@@ -414,17 +414,17 @@ nsRangeFrame::ReflowAnonymousContent(nsP
trackY -= trackReflowState.ComputedPhysicalBorderPadding().top +
trackReflowState.ComputedHeight() / 2;
// Make relative to our border box instead of our content box:
trackX += aReflowState.ComputedPhysicalBorderPadding().left;
trackY += aReflowState.ComputedPhysicalBorderPadding().top;
nsReflowStatus frameStatus;
- nsHTMLReflowMetrics trackDesiredSize(aReflowState);
+ ReflowOutput trackDesiredSize(aReflowState);
ReflowChild(trackFrame, aPresContext, trackDesiredSize,
trackReflowState, trackX, trackY, 0, frameStatus);
MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(frameStatus),
"We gave our child unconstrained height, so it should be complete");
FinishReflowChild(trackFrame, aPresContext, trackDesiredSize,
&trackReflowState, trackX, trackY, 0);
}
@@ -436,17 +436,17 @@ nsRangeFrame::ReflowAnonymousContent(nsP
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
ReflowInput thumbReflowState(aPresContext, aReflowState,
thumbFrame, availSize);
// Where we position the thumb depends on its size, so we first reflow
// the thumb at {0,0} to obtain its size, then position it afterwards.
nsReflowStatus frameStatus;
- nsHTMLReflowMetrics thumbDesiredSize(aReflowState);
+ ReflowOutput thumbDesiredSize(aReflowState);
ReflowChild(thumbFrame, aPresContext, thumbDesiredSize,
thumbReflowState, 0, 0, 0, frameStatus);
MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(frameStatus),
"We gave our child unconstrained height, so it should be complete");
FinishReflowChild(thumbFrame, aPresContext, thumbDesiredSize,
&thumbReflowState, 0, 0, 0);
DoUpdateThumbPosition(thumbFrame, nsSize(aDesiredSize.Width(),
aDesiredSize.Height()));
@@ -461,17 +461,17 @@ nsRangeFrame::ReflowAnonymousContent(nsP
ReflowInput progressReflowState(aPresContext, aReflowState,
rangeProgressFrame, availSize);
// We first reflow the range-progress frame at {0,0} to obtain its
// unadjusted dimensions, then we adjust it to so that the appropriate edge
// ends at the thumb.
nsReflowStatus frameStatus;
- nsHTMLReflowMetrics progressDesiredSize(aReflowState);
+ ReflowOutput progressDesiredSize(aReflowState);
ReflowChild(rangeProgressFrame, aPresContext,
progressDesiredSize, progressReflowState, 0, 0,
0, frameStatus);
MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(frameStatus),
"We gave our child unconstrained height, so it should be complete");
FinishReflowChild(rangeProgressFrame, aPresContext,
progressDesiredSize, &progressReflowState, 0, 0, 0);
DoUpdateRangeProgressFrame(rangeProgressFrame, nsSize(aDesiredSize.Width(),
--- a/layout/forms/nsRangeFrame.h
+++ b/layout/forms/nsRangeFrame.h
@@ -42,17 +42,17 @@ public:
virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
#ifdef DEBUG_FRAME_DUMP
virtual nsresult GetFrameName(nsAString& aResult) const override {
return MakeFrameName(NS_LITERAL_STRING("Range"), aResult);
}
#endif
@@ -153,17 +153,17 @@ public:
private:
nsresult MakeAnonymousDiv(Element** aResult,
CSSPseudoElementType aPseudoType,
nsTArray<ContentInfo>& aElements);
// Helper function which reflows the anonymous div frames.
void ReflowAnonymousContent(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState);
void DoUpdateThumbPosition(nsIFrame* aThumbFrame,
const nsSize& aRangeSize);
void DoUpdateRangeProgressFrame(nsIFrame* aProgressFrame,
const nsSize& aRangeSize);
--- a/layout/forms/nsSelectsAreaFrame.cpp
+++ b/layout/forms/nsSelectsAreaFrame.cpp
@@ -155,17 +155,17 @@ nsSelectsAreaFrame::BuildDisplayListInte
// only clips contained descendants).
aLists.Outlines()->AppendNewToTop(new (aBuilder)
nsDisplayListFocus(aBuilder, this));
}
}
void
nsSelectsAreaFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
nsListControlFrame* list = GetEnclosingListFrame(this);
NS_ASSERTION(list,
"Must have an nsListControlFrame! Frame constructor is "
"broken");
--- a/layout/forms/nsSelectsAreaFrame.h
+++ b/layout/forms/nsSelectsAreaFrame.h
@@ -21,17 +21,17 @@ public:
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
void BuildDisplayListInternal(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists);
virtual void Reflow(nsPresContext* aCX,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
nscoord BSizeOfARow() const { return mBSizeOfARow; }
protected:
explicit nsSelectsAreaFrame(nsStyleContext* aContext) :
nsBlockFrame(aContext),
--- a/layout/forms/nsTextControlFrame.cpp
+++ b/layout/forms/nsTextControlFrame.cpp
@@ -480,17 +480,17 @@ nsTextControlFrame::ComputeAutoSize(nsRe
}
#endif
return autoSize;
}
void
nsTextControlFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsTextControlFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
// make sure that the form registers itself on the initial/first reflow
@@ -539,17 +539,17 @@ nsTextControlFrame::Reflow(nsPresContext
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
}
void
nsTextControlFrame::ReflowTextControlChild(nsIFrame* aKid,
nsPresContext* aPresContext,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus,
- nsHTMLReflowMetrics& aParentDesiredSize)
+ ReflowOutput& aParentDesiredSize)
{
// compute available size and frame offsets for child
WritingMode wm = aKid->GetWritingMode();
LogicalSize availSize = aReflowState.ComputedSizeWithPadding(wm);
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
ReflowInput kidReflowState(aPresContext, aReflowState,
aKid, availSize, nullptr,
@@ -563,17 +563,17 @@ nsTextControlFrame::ReflowTextControlChi
// Offset the frame by the size of the parent's border
nscoord xOffset = aReflowState.ComputedPhysicalBorderPadding().left -
aReflowState.ComputedPhysicalPadding().left;
nscoord yOffset = aReflowState.ComputedPhysicalBorderPadding().top -
aReflowState.ComputedPhysicalPadding().top;
// reflow the child
- nsHTMLReflowMetrics desiredSize(aReflowState);
+ ReflowOutput desiredSize(aReflowState);
ReflowChild(aKid, aPresContext, desiredSize, kidReflowState,
xOffset, yOffset, 0, aStatus);
// place the child
FinishReflowChild(aKid, aPresContext, desiredSize,
&kidReflowState, xOffset, yOffset, 0);
// consider the overflow
--- a/layout/forms/nsTextControlFrame.h
+++ b/layout/forms/nsTextControlFrame.h
@@ -53,17 +53,17 @@ public:
const mozilla::LogicalSize& aCBSize,
nscoord aAvailableISize,
const mozilla::LogicalSize& aMargin,
const mozilla::LogicalSize& aBorder,
const mozilla::LogicalSize& aPadding,
bool aShrinkWrap) override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual bool IsXULCollapsed() override;
virtual bool IsLeaf() const override;
@@ -157,17 +157,17 @@ public:
protected:
/**
* Launch the reflow on the child frames - see nsTextControlFrame::Reflow()
*/
void ReflowTextControlChild(nsIFrame* aFrame,
nsPresContext* aPresContext,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus,
- nsHTMLReflowMetrics& aParentDesiredSize);
+ ReflowOutput& aParentDesiredSize);
public: //for methods who access nsTextControlFrame directly
void SetValueChanged(bool aValueChanged);
// called by the focus listener
nsresult MaybeBeginSecureKeyboardInput();
void MaybeEndSecureKeyboardInput();
--- a/layout/generic/ReflowInput.cpp
+++ b/layout/generic/ReflowInput.cpp
@@ -2955,17 +2955,17 @@ ReflowInput::ComputeMinMaxValues(const L
// If the computed value of 'min-height' is greater than the value of
// 'max-height', 'max-height' is set to the value of 'min-height'
if (ComputedMinBSize() > ComputedMaxBSize()) {
ComputedMaxBSize() = ComputedMinBSize();
}
}
void
-ReflowInput::SetTruncated(const nsHTMLReflowMetrics& aMetrics,
+ReflowInput::SetTruncated(const ReflowOutput& aMetrics,
nsReflowStatus* aStatus) const
{
const WritingMode containerWM = aMetrics.GetWritingMode();
if (GetWritingMode().IsOrthogonalTo(containerWM)) {
// Orthogonal flows are always reflowed with an unconstrained dimension,
// so should never end up truncated (see ReflowInput::Init()).
*aStatus &= ~NS_FRAME_TRUNCATED;
} else if (AvailableBSize() != NS_UNCONSTRAINEDSIZE &&
--- a/layout/generic/ReflowInput.h
+++ b/layout/generic/ReflowInput.h
@@ -847,17 +847,17 @@ public:
void SetComputedBSizeWithoutResettingResizeFlags(nscoord aComputedBSize) {
// Viewport frames reset the computed block size on a copy of their reflow
// state when reflowing fixed-pos kids. In that case we actually don't
// want to mess with the resize flags, because comparing the frame's rect
// to the munged computed isize is pointless.
ComputedBSize() = aComputedBSize;
}
- void SetTruncated(const nsHTMLReflowMetrics& aMetrics, nsReflowStatus* aStatus) const;
+ void SetTruncated(const ReflowOutput& aMetrics, nsReflowStatus* aStatus) const;
bool WillReflowAgainForClearance() const {
return mDiscoveredClearance && *mDiscoveredClearance;
}
// Compute the offsets for a relative position element
static void ComputeRelativeOffsets(mozilla::WritingMode aWM,
nsIFrame* aFrame,
--- a/layout/generic/ReflowOutput.cpp
+++ b/layout/generic/ReflowOutput.cpp
@@ -31,36 +31,36 @@ nsOverflowAreas::UnionAllWith(const nsRe
void
nsOverflowAreas::SetAllTo(const nsRect& aRect)
{
NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
mRects[otype] = aRect;
}
}
-nsHTMLReflowMetrics::nsHTMLReflowMetrics(const ReflowInput& aState,
+ReflowOutput::ReflowOutput(const ReflowInput& aState,
uint32_t aFlags)
: mISize(0)
, mBSize(0)
, mBlockStartAscent(ASK_FOR_BASELINE)
, mFlags(aFlags)
, mWritingMode(aState.GetWritingMode())
{
}
void
-nsHTMLReflowMetrics::SetOverflowAreasToDesiredBounds()
+ReflowOutput::SetOverflowAreasToDesiredBounds()
{
NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
mOverflowAreas.Overflow(otype).SetRect(0, 0, Width(), Height());
}
}
void
-nsHTMLReflowMetrics::UnionOverflowAreasWithDesiredBounds()
+ReflowOutput::UnionOverflowAreasWithDesiredBounds()
{
// FIXME: We should probably change scrollable overflow to use
// UnionRectIncludeEmpty (but leave visual overflow using UnionRect).
nsRect rect(0, 0, Width(), Height());
NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
nsRect& o = mOverflowAreas.Overflow(otype);
o.UnionRect(o, rect);
}
--- a/layout/generic/ReflowOutput.h
+++ b/layout/generic/ReflowOutput.h
@@ -1,17 +1,17 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* struct containing the output from nsIFrame::Reflow */
-#ifndef mozilla_nsHTMLReflowMetrics_h
-#define mozilla_nsHTMLReflowMetrics_h
+#ifndef mozilla_ReflowOutput_h
+#define mozilla_ReflowOutput_h
#include "mozilla/WritingModes.h"
#include "nsBoundingMetrics.h"
#include "nsRect.h"
//----------------------------------------------------------------------
namespace mozilla {
@@ -195,33 +195,33 @@ struct nsCollapsingMargin {
namespace mozilla {
/**
* Reflow metrics used to return the frame's desired size and alignment
* information.
*
* @see #Reflow()
*/
-class nsHTMLReflowMetrics {
+class ReflowOutput {
public:
// XXXldb Should |aFlags| generally be passed from parent to child?
// Some places do it, and some don't. |aFlags| should perhaps go away
// entirely.
// XXX width/height/ascent are OUT parameters and so they shouldn't
// have to be initialized, but there are some bad frame classes that
// aren't properly setting them when returning from Reflow()...
- explicit nsHTMLReflowMetrics(mozilla::WritingMode aWritingMode, uint32_t aFlags = 0)
+ explicit ReflowOutput(mozilla::WritingMode aWritingMode, uint32_t aFlags = 0)
: mISize(0)
, mBSize(0)
, mBlockStartAscent(ASK_FOR_BASELINE)
, mFlags(aFlags)
, mWritingMode(aWritingMode)
{}
- explicit nsHTMLReflowMetrics(const ReflowInput& aState, uint32_t aFlags = 0);
+ explicit ReflowOutput(const ReflowInput& aState, uint32_t aFlags = 0);
// ISize and BSize are logical-coordinate dimensions:
// ISize is the size in the writing mode's inline direction (which equates to
// width in horizontal writing modes, height in vertical ones), and BSize is
// the size in the block-progression direction.
nscoord ISize(mozilla::WritingMode aWritingMode) const {
NS_ASSERTION(!aWritingMode.IsOrthogonalTo(mWritingMode),
"mismatched writing mode");
@@ -340,9 +340,9 @@ public:
uint32_t mFlags;
private:
mozilla::WritingMode mWritingMode;
};
} // mozilla namespace
-#endif // mozilla_nsHTMLReflowMetrics_h
+#endif // mozilla_ReflowOutput_h
--- a/layout/generic/nsAbsoluteContainingBlock.cpp
+++ b/layout/generic/nsAbsoluteContainingBlock.cpp
@@ -419,17 +419,17 @@ nsAbsoluteContainingBlock::ReflowAbsolut
kidReflowState.ComputedLogicalMargin().BStart(wm);
if (NS_AUTOOFFSET != kidReflowState.ComputedLogicalOffsets().BStart(wm)) {
kidReflowState.AvailableBSize() -=
kidReflowState.ComputedLogicalOffsets().BStart(wm);
}
}
// Do the reflow
- nsHTMLReflowMetrics kidDesiredSize(kidReflowState);
+ ReflowOutput kidDesiredSize(kidReflowState);
aKidFrame->Reflow(aPresContext, kidDesiredSize, kidReflowState, aStatus);
const LogicalSize kidSize = kidDesiredSize.Size(wm).ConvertTo(outerWM, wm);
LogicalMargin offsets =
kidReflowState.ComputedLogicalOffsets().ConvertTo(outerWM, wm);
// If we're solving for start in either inline or block direction,
--- a/layout/generic/nsBRFrame.cpp
+++ b/layout/generic/nsBRFrame.cpp
@@ -32,17 +32,17 @@ public:
virtual FrameSearchResult PeekOffsetNoAmount(bool aForward, int32_t* aOffset) override;
virtual FrameSearchResult PeekOffsetCharacter(bool aForward, int32_t* aOffset,
bool aRespectClusters = true) override;
virtual FrameSearchResult PeekOffsetWord(bool aForward, bool aWordSelectEatSpace,
bool aIsKeyboardSelect, int32_t* aOffset,
PeekWordState* aState) override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual void AddInlineMinISize(nsRenderingContext *aRenderingContext,
InlineMinISizeData *aData) override;
virtual void AddInlinePrefISize(nsRenderingContext *aRenderingContext,
InlinePrefISizeData *aData) override;
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
@@ -75,17 +75,17 @@ NS_NewBRFrame(nsIPresShell* aPresShell,
NS_IMPL_FRAMEARENA_HELPERS(BRFrame)
BRFrame::~BRFrame()
{
}
void
BRFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("BRFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aStatus);
WritingMode wm = aReflowState.GetWritingMode();
LogicalSize finalSize(wm);
--- a/layout/generic/nsBackdropFrame.cpp
+++ b/layout/generic/nsBackdropFrame.cpp
@@ -81,17 +81,17 @@ nsBackdropFrame::ComputeAutoSize(nsRende
result.ISize(aWM) = aAvailableISize - aMargin.ISize(aWM) -
aBorder.ISize(aWM) - aPadding.ISize(aWM);
}
return result;
}
/* virtual */ void
nsBackdropFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsBackdropFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
// Note that this frame is a child of the viewport frame.
--- a/layout/generic/nsBackdropFrame.h
+++ b/layout/generic/nsBackdropFrame.h
@@ -33,14 +33,14 @@ public:
WritingMode aWM,
const LogicalSize& aCBSize,
nscoord aAvailableISize,
const LogicalSize& aMargin,
const LogicalSize& aBorder,
const LogicalSize& aPadding,
bool aShrinkWrap) override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
};
#endif // nsBackdropFrame_h___
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -1015,17 +1015,17 @@ CalculateContainingBlockSizeForAbsolutes
}
}
return cbSize;
}
void
nsBlockFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsBlockFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aStatus);
#ifdef DEBUG
if (gNoisyReflow) {
@@ -1230,17 +1230,17 @@ nsBlockFrame::Reflow(nsPresContext*
// contains a block (example: <LI>\n<P>... ). This is where
// the second case can happen.
if (HasOutsideBullet() && !mLines.empty() &&
(mLines.front()->IsBlock() ||
(0 == mLines.front()->BSize() &&
mLines.front() != mLines.back() &&
mLines.begin().next()->IsBlock()))) {
// Reflow the bullet
- nsHTMLReflowMetrics metrics(aReflowState);
+ ReflowOutput metrics(aReflowState);
// XXX Use the entire line when we fix bug 25888.
nsLayoutUtils::LinePosition position;
WritingMode wm = aReflowState.GetWritingMode();
bool havePosition = nsLayoutUtils::GetFirstLinePosition(wm, this,
&position);
nscoord lineBStart = havePosition ?
position.mBStart :
reflowState->ComputedLogicalBorderPadding().BStart(wm);
@@ -1474,17 +1474,17 @@ nsBlockFrame::CheckForCollapsedBEndMargi
}
}
// not reached
}
void
nsBlockFrame::ComputeFinalSize(const ReflowInput& aReflowState,
BlockReflowInput& aState,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
nscoord* aBEndEdgeOfChildren)
{
WritingMode wm = aState.mReflowState.GetWritingMode();
const LogicalMargin& borderPadding = aState.BorderPadding();
#ifdef NOISY_FINAL_SIZE
ListTag(stdout);
printf(": mBCoord=%d mIsBEndMarginRoot=%s mPrevBEndMargin=%d bp=%d,%d\n",
aState.mBCoord, aState.GetFlag(BRS_ISBENDMARGINROOT) ? "yes" : "no",
@@ -2608,29 +2608,29 @@ nsBlockFrame::ReflowDirtyLines(BlockRefl
if (NS_FRAME_IS_NOT_COMPLETE(aState.mReflowStatus)) {
aState.mReflowStatus |= NS_FRAME_REFLOW_NEXTINFLOW;
} //XXXfr shouldn't set this flag when nextinflow has no lines
}
// Handle an odd-ball case: a list-item with no lines
if (HasOutsideBullet() && mLines.empty()) {
- nsHTMLReflowMetrics metrics(aState.mReflowState);
+ ReflowOutput metrics(aState.mReflowState);
nsIFrame* bullet = GetOutsideBullet();
WritingMode wm = aState.mReflowState.GetWritingMode();
ReflowBullet(bullet, aState, metrics,
aState.mReflowState.ComputedPhysicalBorderPadding().top);
NS_ASSERTION(!BulletIsEmpty() || metrics.BSize(wm) == 0,
"empty bullet took up space");
if (!BulletIsEmpty()) {
// There are no lines so we have to fake up some y motion so that
// we end up with *some* height.
- if (metrics.BlockStartAscent() == nsHTMLReflowMetrics::ASK_FOR_BASELINE) {
+ if (metrics.BlockStartAscent() == ReflowOutput::ASK_FOR_BASELINE) {
nscoord ascent;
WritingMode wm = aState.mReflowState.GetWritingMode();
if (nsLayoutUtils::GetFirstLineBaseline(wm, bullet, &ascent)) {
metrics.SetBlockStartAscent(ascent);
} else {
metrics.SetBlockStartAscent(metrics.BSize(wm));
}
}
@@ -4427,17 +4427,17 @@ nsBlockFrame::PlaceLine(BlockReflowInput
WritingMode wm = aState.mReflowState.GetWritingMode();
bool addedBullet = false;
if (HasOutsideBullet() &&
((aLine == mLines.front() &&
(!aLineLayout.IsZeroBSize() || (aLine == mLines.back()))) ||
(mLines.front() != mLines.back() &&
0 == mLines.front()->BSize() &&
aLine == mLines.begin().next()))) {
- nsHTMLReflowMetrics metrics(aState.mReflowState);
+ ReflowOutput metrics(aState.mReflowState);
nsIFrame* bullet = GetOutsideBullet();
ReflowBullet(bullet, aState, metrics, aState.mBCoord);
NS_ASSERTION(!BulletIsEmpty() || metrics.BSize(wm) == 0,
"empty bullet took up space");
aLineLayout.AddBulletFrame(bullet, metrics);
addedBullet = true;
}
aLineLayout.VerticalAlignLine();
@@ -6200,17 +6200,17 @@ nsBlockFrame::ReflowFloat(BlockReflowInp
// Capture the margin and offsets information for the caller
aFloatMargin =
// float margins don't collapse
floatRS.ComputedLogicalMargin().ConvertTo(wm, floatRS.GetWritingMode());
aFloatOffsets =
floatRS.ComputedLogicalOffsets().ConvertTo(wm, floatRS.GetWritingMode());
- const nsHTMLReflowMetrics& metrics = brc.GetMetrics();
+ const ReflowOutput& metrics = brc.GetMetrics();
// Set the rect, make sure the view is properly sized and positioned,
// and tell the frame we're done reflowing it
// XXXldb This seems like the wrong place to be doing this -- shouldn't
// we be doing this in BlockReflowInput::FlowAndPlaceFloat after
// we've positioned the float, and shouldn't we be doing the equivalent
// of |PlaceFrameView| here?
WritingMode metricsWM = metrics.GetWritingMode();
@@ -7169,17 +7169,17 @@ nsBlockFrame::RenumberListsFor(nsPresCon
}
}
return kidRenumberedABullet;
}
void
nsBlockFrame::ReflowBullet(nsIFrame* aBulletFrame,
BlockReflowInput& aState,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
nscoord aLineTop)
{
const ReflowInput &rs = aState.mReflowState;
// Reflow the bullet now
WritingMode bulletWM = aBulletFrame->GetWritingMode();
LogicalSize availSize(bulletWM);
// Make up an inline-size since it doesn't really matter (XXX).
--- a/layout/generic/nsBlockFrame.h
+++ b/layout/generic/nsBlockFrame.h
@@ -258,17 +258,17 @@ public:
void ComputeFinalBSize(const ReflowInput& aReflowState,
nsReflowStatus* aStatus,
nscoord aContentBSize,
const mozilla::LogicalMargin& aBorderPadding,
mozilla::LogicalSize& aFinalSize,
nscoord aConsumed);
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual nsresult AttributeChanged(int32_t aNameSpaceID,
nsIAtom* aAttribute,
int32_t aModType) override;
/**
@@ -411,17 +411,17 @@ protected:
void UpdateLineContainerSize(nsLineBox* aLine,
const nsSize& aNewContainerSize);
// helper for SlideLine and UpdateLineContainerSize
void MoveChildFramesOfLine(nsLineBox* aLine, nscoord aDeltaBCoord);
void ComputeFinalSize(const ReflowInput& aReflowState,
BlockReflowInput& aState,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
nscoord* aBottomEdgeOfChildren);
void ComputeOverflowAreas(const nsRect& aBounds,
const nsStyleDisplay* aDisplay,
nscoord aBottomEdgeOfChildren,
nsOverflowAreas& aOverflowAreas);
/**
@@ -796,17 +796,17 @@ protected:
static bool RenumberListsFor(nsPresContext* aPresContext, nsIFrame* aKid,
int32_t* aOrdinal, int32_t aDepth,
int32_t aIncrement);
static bool FrameStartsCounterScope(nsIFrame* aFrame);
void ReflowBullet(nsIFrame* aBulletFrame,
BlockReflowInput& aState,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
nscoord aLineTop);
//----------------------------------------
virtual nsILineIterator* GetLineIterator() override;
public:
bool HasOverflowLines() const {
--- a/layout/generic/nsBlockReflowContext.h
+++ b/layout/generic/nsBlockReflowContext.h
@@ -19,17 +19,17 @@ class BlockReflowInput;
} // namespace mozilla
/**
* An encapsulation of the state and algorithm for reflowing block frames.
*/
class nsBlockReflowContext {
using BlockReflowInput = mozilla::BlockReflowInput;
using ReflowInput = mozilla::ReflowInput;
- using nsHTMLReflowMetrics = mozilla::nsHTMLReflowMetrics;
+ using ReflowOutput = mozilla::ReflowOutput;
public:
nsBlockReflowContext(nsPresContext* aPresContext,
const ReflowInput& aParentRS);
~nsBlockReflowContext() { }
void ReflowBlock(const mozilla::LogicalRect& aSpace,
bool aApplyBStartMargin,
@@ -47,17 +47,17 @@ public:
nsCollapsingMargin& aBEndMarginResult /* out */,
nsOverflowAreas& aOverflowAreas,
nsReflowStatus aReflowStatus);
nsCollapsingMargin& GetCarriedOutBEndMargin() {
return mMetrics.mCarriedOutBEndMargin;
}
- const nsHTMLReflowMetrics& GetMetrics() const {
+ const ReflowOutput& GetMetrics() const {
return mMetrics;
}
/**
* Computes the collapsed block-start margin (in the context's parent's
* writing mode) for a block whose reflow state is in aRS.
* The computed margin is added into aMargin, whose writing mode is the
* parent's mode as found in mMetrics.GetWritingMode(); note this may not be
@@ -86,13 +86,13 @@ protected:
const ReflowInput& mOuterReflowState;
nsIFrame* mFrame;
mozilla::LogicalRect mSpace;
nscoord mICoord, mBCoord;
nsSize mContainerSize;
mozilla::WritingMode mWritingMode;
- nsHTMLReflowMetrics mMetrics;
+ ReflowOutput mMetrics;
nsCollapsingMargin mBStartMargin;
};
#endif /* nsBlockReflowContext_h___ */
--- a/layout/generic/nsBulletFrame.cpp
+++ b/layout/generic/nsBulletFrame.cpp
@@ -532,17 +532,17 @@ nsBulletFrame::AppendSpacingToPadding(ns
LogicalMargin* aPadding)
{
aPadding->IEnd(GetWritingMode()) += aFontMetrics->EmHeight() / 2;
}
void
nsBulletFrame::GetDesiredSize(nsPresContext* aCX,
nsRenderingContext *aRenderingContext,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
float aFontSizeInflation,
LogicalMargin* aPadding)
{
// Reset our padding. If we need it, we'll set it below.
WritingMode wm = GetWritingMode();
aPadding->SizeTo(wm, 0, 0, 0, 0);
LogicalSize finalSize(wm);
@@ -625,17 +625,17 @@ nsBulletFrame::GetDesiredSize(nsPresCont
? fm->MaxDescent() : fm->MaxAscent());
break;
}
aMetrics.SetSize(wm, finalSize);
}
void
nsBulletFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsBulletFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aStatus);
float inflation = nsLayoutUtils::FontSizeInflationFor(this);
@@ -670,29 +670,29 @@ nsBulletFrame::Reflow(nsPresContext* aPr
aStatus = NS_FRAME_COMPLETE;
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aMetrics);
}
/* virtual */ nscoord
nsBulletFrame::GetMinISize(nsRenderingContext *aRenderingContext)
{
WritingMode wm = GetWritingMode();
- nsHTMLReflowMetrics metrics(wm);
+ ReflowOutput metrics(wm);
DISPLAY_MIN_WIDTH(this, metrics.ISize(wm));
LogicalMargin padding(wm);
GetDesiredSize(PresContext(), aRenderingContext, metrics, 1.0f, &padding);
metrics.ISize(wm) += padding.IStartEnd(wm);
return metrics.ISize(wm);
}
/* virtual */ nscoord
nsBulletFrame::GetPrefISize(nsRenderingContext *aRenderingContext)
{
WritingMode wm = GetWritingMode();
- nsHTMLReflowMetrics metrics(wm);
+ ReflowOutput metrics(wm);
DISPLAY_PREF_WIDTH(this, metrics.ISize(wm));
LogicalMargin padding(wm);
GetDesiredSize(PresContext(), aRenderingContext, metrics, 1.0f, &padding);
metrics.ISize(wm) += padding.IStartEnd(wm);
return metrics.ISize(wm);
}
// If a bullet has zero size and is "ignorable" from its styling, we behave
--- a/layout/generic/nsBulletFrame.h
+++ b/layout/generic/nsBulletFrame.h
@@ -72,17 +72,17 @@ public:
const nsDisplayListSet& aLists) override;
virtual nsIAtom* GetType() const override;
virtual void DidSetStyleContext(nsStyleContext* aOldStyleContext) override;
#ifdef DEBUG_FRAME_DUMP
virtual nsresult GetFrameName(nsAString& aResult) const override;
#endif
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
void AddInlineMinISize(nsRenderingContext* aRenderingContext,
nsIFrame::InlineMinISizeData* aData) override;
void AddInlinePrefISize(nsRenderingContext* aRenderingContext,
nsIFrame::InlinePrefISizeData* aData) override;
@@ -116,17 +116,17 @@ public:
protected:
nsresult OnSizeAvailable(imgIRequest* aRequest, imgIContainer* aImage);
void AppendSpacingToPadding(nsFontMetrics* aFontMetrics,
mozilla::LogicalMargin* aPadding);
void GetDesiredSize(nsPresContext* aPresContext,
nsRenderingContext *aRenderingContext,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
float aFontSizeInflation,
mozilla::LogicalMargin* aPadding);
void GetLoadGroup(nsPresContext *aPresContext, nsILoadGroup **aLoadGroup);
nsIDocument* GetOurCurrentDoc() const;
mozilla::LogicalMargin mPadding;
RefPtr<imgRequestProxy> mImageRequest;
--- a/layout/generic/nsCanvasFrame.cpp
+++ b/layout/generic/nsCanvasFrame.cpp
@@ -567,17 +567,17 @@ nsCanvasFrame::GetPrefISize(nsRenderingC
result = 0;
else
result = mFrames.FirstChild()->GetPrefISize(aRenderingContext);
return result;
}
void
nsCanvasFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsCanvasFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
NS_FRAME_TRACE_REFLOW_IN("nsCanvasFrame::Reflow");
@@ -607,17 +607,17 @@ nsCanvasFrame::Reflow(nsPresContext*
// Reflow our one and only normal child frame. It's either the root
// element's frame or a placeholder for that frame, if the root element
// is abs-pos or fixed-pos. We may have additional children which
// are placeholders for continuations of fixed-pos content, but those
// don't need to be reflowed. The normal child is always comes before
// the fixed-pos placeholders, because we insert it at the start
// of the child list, above.
- nsHTMLReflowMetrics kidDesiredSize(aReflowState);
+ ReflowOutput kidDesiredSize(aReflowState);
if (mFrames.IsEmpty()) {
// We have no child frame, so return an empty size
aDesiredSize.Width() = aDesiredSize.Height() = 0;
} else {
nsIFrame* kidFrame = mFrames.FirstChild();
bool kidDirty = (kidFrame->GetStateBits() & NS_FRAME_IS_DIRTY) != 0;
ReflowInput
--- a/layout/generic/nsCanvasFrame.h
+++ b/layout/generic/nsCanvasFrame.h
@@ -66,17 +66,17 @@ public:
nsFrameList& aFrameList) override;
virtual void RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame) override;
#endif
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual bool IsFrameOfType(uint32_t aFlags) const override
{
return nsContainerFrame::IsFrameOfType(aFlags &
~(nsIFrame::eCanContainOverflowContainers));
}
--- a/layout/generic/nsColumnSetFrame.cpp
+++ b/layout/generic/nsColumnSetFrame.cpp
@@ -337,17 +337,17 @@ nsColumnSetFrame::ChooseColumnStrategy(c
#endif
ReflowConfig config = { numColumns, colISize, expectedISizeLeftOver, colGap,
colBSize, isBalancing, knownFeasibleBSize,
knownInfeasibleBSize, computedBSize, consumedBSize };
return config;
}
bool
-nsColumnSetFrame::ReflowColumns(nsHTMLReflowMetrics& aDesiredSize,
+nsColumnSetFrame::ReflowColumns(ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aReflowStatus,
ReflowConfig& aConfig,
bool aLastColumnUnbounded,
nsCollapsingMargin* aCarriedOutBEndMargin,
ColumnBalanceData& aColData)
{
bool feasible = ReflowChildren(aDesiredSize, aReflowState,
@@ -444,17 +444,17 @@ nsColumnSetFrame::GetPrefISize(nsRenderi
nscoord iSize = colISize * numColumns + colGap * (numColumns - 1);
// The multiplication above can make 'iSize' negative (integer overflow),
// so use std::max to protect against that.
result = std::max(iSize, colISize);
return result;
}
bool
-nsColumnSetFrame::ReflowChildren(nsHTMLReflowMetrics& aDesiredSize,
+nsColumnSetFrame::ReflowChildren(ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus,
const ReflowConfig& aConfig,
bool aUnboundedLastColumn,
nsCollapsingMargin* aCarriedOutBEndMargin,
ColumnBalanceData& aColData)
{
aColData.Reset();
@@ -624,17 +624,17 @@ nsColumnSetFrame::ReflowChildren(nsHTMLR
// Note if the column's next in flow is not being changed by this incremental reflow.
// This may allow the current column to avoid trying to pull lines from the next column.
if (child->GetNextSibling() &&
!(GetStateBits() & NS_FRAME_IS_DIRTY) &&
!(child->GetNextSibling()->GetStateBits() & NS_FRAME_IS_DIRTY)) {
kidReflowState.mFlags.mNextInFlowUntouched = true;
}
- nsHTMLReflowMetrics kidDesiredSize(wm, aDesiredSize.mFlags);
+ ReflowOutput kidDesiredSize(wm, aDesiredSize.mFlags);
// XXX it would be cool to consult the float manager for the
// previous block to figure out the region of floats from the
// previous column that extend into this column, and subtract
// that region from the new float manager. So you could stick a
// really big float in the first column and text in following
// columns would flow around it.
@@ -860,17 +860,17 @@ nsColumnSetFrame::DrainOverflowColumns()
}
}
void
nsColumnSetFrame::FindBestBalanceBSize(const ReflowInput& aReflowState,
nsPresContext* aPresContext,
ReflowConfig& aConfig,
ColumnBalanceData& aColData,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
nsCollapsingMargin& aOutMargin,
bool& aUnboundedLastColumn,
bool& aRunWasFeasible,
nsReflowStatus& aStatus)
{
bool feasible = aRunWasFeasible;
nsMargin bp = aReflowState.ComputedPhysicalBorderPadding();
@@ -1015,17 +1015,17 @@ nsColumnSetFrame::FindBestBalanceBSize(c
}
}
aRunWasFeasible = feasible;
}
void
nsColumnSetFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
// Don't support interruption in columns
nsPresContext::InterruptPreventer noInterrupts(aPresContext);
DO_GLOBAL_REFLOW_COUNT("nsColumnSetFrame");
--- a/layout/generic/nsColumnSetFrame.h
+++ b/layout/generic/nsColumnSetFrame.h
@@ -20,17 +20,17 @@
class nsColumnSetFrame final : public nsContainerFrame
{
public:
NS_DECL_FRAMEARENA_HELPERS
explicit nsColumnSetFrame(nsStyleContext* aContext);
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
#ifdef DEBUG
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) override;
virtual void AppendFrames(ChildListID aListID,
nsFrameList& aFrameList) override;
@@ -156,17 +156,17 @@ protected:
bool mHasExcessBSize;
void Reset() {
mMaxBSize = mSumBSize = mLastBSize = mMaxOverflowingBSize = 0;
mHasExcessBSize = false;
}
};
- bool ReflowColumns(nsHTMLReflowMetrics& aDesiredSize,
+ bool ReflowColumns(ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aReflowStatus,
ReflowConfig& aConfig,
bool aLastColumnUnbounded,
nsCollapsingMargin* aCarriedOutBEndMargin,
ColumnBalanceData& aColData);
/**
@@ -203,26 +203,26 @@ protected:
* fit all content from descendant frames.
* @param aStatus A final reflow status of the column set frame, passed in as
* an output parameter.
*/
void FindBestBalanceBSize(const ReflowInput& aReflowState,
nsPresContext* aPresContext,
ReflowConfig& aConfig,
ColumnBalanceData& aColData,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
nsCollapsingMargin& aOutMargin,
bool& aUnboundedLastColumn,
bool& aRunWasFeasible,
nsReflowStatus& aStatus);
/**
* Reflow column children. Returns true iff the content that was reflowed
* fit into the mColMaxBSize.
*/
- bool ReflowChildren(nsHTMLReflowMetrics& aDesiredSize,
+ bool ReflowChildren(ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus,
const ReflowConfig& aConfig,
bool aLastColumnUnbounded,
nsCollapsingMargin* aCarriedOutBEndMargin,
ColumnBalanceData& aColData);
};
--- a/layout/generic/nsContainerFrame.cpp
+++ b/layout/generic/nsContainerFrame.cpp
@@ -989,17 +989,17 @@ nsContainerFrame::ComputeAutoSize(nsRend
}
}
return result;
}
void
nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
const WritingMode& aWM,
const LogicalPoint& aPos,
const nsSize& aContainerSize,
uint32_t aFlags,
nsReflowStatus& aStatus,
nsOverflowContinuationTracker* aTracker)
{
@@ -1037,17 +1037,17 @@ nsContainerFrame::ReflowChild(nsIFrame*
}
}
//XXX temporary: hold on to a copy of the old physical version of
// ReflowChild so that we can convert callers incrementally.
void
nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nscoord aX,
nscoord aY,
uint32_t aFlags,
nsReflowStatus& aStatus,
nsOverflowContinuationTracker* aTracker)
{
NS_PRECONDITION(aReflowState.frame == aKidFrame, "bad reflow state");
@@ -1130,17 +1130,17 @@ nsContainerFrame::PositionChildViews(nsI
* case. Also implies NS_FRAME_NO_MOVE_VIEW
* NS_FRAME_NO_MOVE_VIEW - don't position the frame's view. Set this if you
* don't want to automatically sync the frame and view
* NS_FRAME_NO_SIZE_VIEW - don't size the frame's view
*/
void
nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
nsPresContext* aPresContext,
- const nsHTMLReflowMetrics& aDesiredSize,
+ const ReflowOutput& aDesiredSize,
const ReflowInput* aReflowState,
const WritingMode& aWM,
const LogicalPoint& aPos,
const nsSize& aContainerSize,
uint32_t aFlags)
{
if (aWM.IsVerticalRL() || (!aWM.IsVertical() && !aWM.IsBidiLTR())) {
NS_ASSERTION(aContainerSize.width != NS_UNCONSTRAINEDSIZE,
@@ -1179,17 +1179,17 @@ nsContainerFrame::FinishReflowChild(nsIF
aKidFrame->DidReflow(aPresContext, aReflowState, nsDidReflowStatus::FINISHED);
}
//XXX temporary: hold on to a copy of the old physical version of
// FinishReflowChild so that we can convert callers incrementally.
void
nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
nsPresContext* aPresContext,
- const nsHTMLReflowMetrics& aDesiredSize,
+ const ReflowOutput& aDesiredSize,
const ReflowInput* aReflowState,
nscoord aX,
nscoord aY,
uint32_t aFlags)
{
nsPoint curOrigin = aKidFrame->GetPosition();
if (NS_FRAME_NO_MOVE_FRAME != (aFlags & NS_FRAME_NO_MOVE_FRAME)) {
@@ -1253,17 +1253,17 @@ nsContainerFrame::ReflowOverflowContaine
"overflow container frame must have overflow container bit set");
WritingMode wm = frame->GetWritingMode();
nsSize containerSize = aReflowState.AvailableSize(wm).GetPhysicalSize(wm);
LogicalRect prevRect = prevInFlow->GetLogicalRect(wm, containerSize);
// Initialize reflow params
LogicalSize availSpace(wm, prevRect.ISize(wm),
aReflowState.AvailableSize(wm).BSize(wm));
- nsHTMLReflowMetrics desiredSize(aReflowState);
+ ReflowOutput desiredSize(aReflowState);
ReflowInput frameState(aPresContext, aReflowState,
frame, availSpace);
nsReflowStatus frameStatus;
// Reflow
LogicalPoint pos(wm, prevRect.IStart(wm), 0);
ReflowChild(frame, aPresContext, desiredSize, frameState,
wm, pos, containerSize, aFlags, frameStatus, &tracker);
--- a/layout/generic/nsContainerFrame.h
+++ b/layout/generic/nsContainerFrame.h
@@ -249,17 +249,17 @@ public:
* Flags:
* NS_FRAME_NO_MOVE_VIEW - don't position the frame's view. Set this if you
* don't want to automatically sync the frame and view
* NS_FRAME_NO_MOVE_FRAME - don't move the frame. aPos is ignored in this
* case. Also implies NS_FRAME_NO_MOVE_VIEW
*/
void ReflowChild(nsIFrame* aChildFrame,
nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
const mozilla::WritingMode& aWM,
const mozilla::LogicalPoint& aPos,
const nsSize& aContainerSize,
uint32_t aFlags,
nsReflowStatus& aStatus,
nsOverflowContinuationTracker* aTracker = nullptr);
@@ -279,39 +279,39 @@ public:
* NS_FRAME_NO_MOVE_FRAME - don't move the frame. aPos is ignored in this
* case. Also implies NS_FRAME_NO_MOVE_VIEW
* NS_FRAME_NO_MOVE_VIEW - don't position the frame's view. Set this if you
* 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 ReflowOutput& aDesiredSize,
const ReflowInput* aReflowState,
const mozilla::WritingMode& aWM,
const mozilla::LogicalPoint& aPos,
const nsSize& aContainerSize,
uint32_t aFlags);
//XXX temporary: hold on to a copy of the old physical versions of
// ReflowChild and FinishReflowChild so that we can convert callers
// incrementally.
void ReflowChild(nsIFrame* aKidFrame,
nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nscoord aX,
nscoord aY,
uint32_t aFlags,
nsReflowStatus& aStatus,
nsOverflowContinuationTracker* aTracker = nullptr);
static void FinishReflowChild(nsIFrame* aKidFrame,
nsPresContext* aPresContext,
- const nsHTMLReflowMetrics& aDesiredSize,
+ const ReflowOutput& aDesiredSize,
const ReflowInput* aReflowState,
nscoord aX,
nscoord aY,
uint32_t aFlags);
static void PositionChildViews(nsIFrame* aFrame);
// ==========================================================================
--- a/layout/generic/nsFirstLetterFrame.cpp
+++ b/layout/generic/nsFirstLetterFrame.cpp
@@ -158,17 +158,17 @@ nsFirstLetterFrame::ComputeSize(nsRender
return LogicalSize(aWM, NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);
}
return nsContainerFrame::ComputeSize(aRenderingContext, aWM,
aCBSize, aAvailableISize, aMargin, aBorder, aPadding, aFlags);
}
void
nsFirstLetterFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
const ReflowInput& aReflowState,
nsReflowStatus& aReflowStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsFirstLetterFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aReflowStatus);
// Grab overflow list
@@ -183,17 +183,17 @@ nsFirstLetterFrame::Reflow(nsPresContext
NS_ASSERTION(availSize.ISize(wm) != NS_UNCONSTRAINEDSIZE,
"should no longer use unconstrained inline size");
availSize.ISize(wm) -= bp.IStartEnd(wm);
if (NS_UNCONSTRAINEDSIZE != availSize.BSize(wm)) {
availSize.BSize(wm) -= bp.BStartEnd(wm);
}
WritingMode lineWM = aMetrics.GetWritingMode();
- nsHTMLReflowMetrics kidMetrics(lineWM);
+ ReflowOutput kidMetrics(lineWM);
// Reflow the child
if (!aReflowState.mLineLayout) {
// When there is no lineLayout provided, we provide our own. The
// only time that the first-letter-frame is not reflowing in a
// line context is when its floating.
WritingMode kidWritingMode = GetWritingMode(kid);
LogicalSize kidAvailSize = availSize.ConvertTo(kidWritingMode, wm);
--- a/layout/generic/nsFirstLetterFrame.h
+++ b/layout/generic/nsFirstLetterFrame.h
@@ -56,17 +56,17 @@ public:
const mozilla::LogicalSize& aCBSize,
nscoord aAvailableISize,
const mozilla::LogicalSize& aMargin,
const mozilla::LogicalSize& aBorder,
const mozilla::LogicalSize& aPadding,
ComputeSizeFlags aFlags) override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual bool CanContinueTextRun() const override;
virtual nscoord GetLogicalBaseline(mozilla::WritingMode aWritingMode) const override;
virtual LogicalSides GetLogicalSkipSides(const ReflowInput* aReflowState = nullptr) const override;
//override of nsFrame method
--- a/layout/generic/nsFlexContainerFrame.cpp
+++ b/layout/generic/nsFlexContainerFrame.cpp
@@ -442,17 +442,17 @@ public:
nscoord GetCrossMinSize() const { return mCrossMinSize; }
nscoord GetCrossMaxSize() const { return mCrossMaxSize; }
// Note: These return the cross-axis position and size of our *content box*.
nscoord GetCrossSize() const { return mCrossSize; }
nscoord GetCrossPosition() const { return mCrossPosn; }
nscoord ResolvedAscent() const {
- if (mAscent == nsHTMLReflowMetrics::ASK_FOR_BASELINE) {
+ if (mAscent == ReflowOutput::ASK_FOR_BASELINE) {
// XXXdholbert We should probably be using the *container's* writing-mode
// here, instead of the item's -- though it doesn't much matter right
// now, because all of the baseline-handling code here essentially
// assumes that the container & items have the same writing-mode. This
// will matter more (& can be expanded/tested) once we officially support
// logical directions & vertical writing-modes in flexbox, in bug 1079155
// or a dependency.
// Use GetFirstLineBaseline(), or just GetBaseline() if that fails.
@@ -1631,17 +1631,17 @@ nsFlexContainerFrame::
childRSForMeasuringHeight.SetComputedWidth(aFlexItem.GetCrossSize());
childRSForMeasuringHeight.SetHResize(true);
}
if (aForceVerticalResizeForMeasuringReflow) {
childRSForMeasuringHeight.SetVResize(true);
}
- nsHTMLReflowMetrics childDesiredSize(childRSForMeasuringHeight);
+ ReflowOutput childDesiredSize(childRSForMeasuringHeight);
nsReflowStatus childReflowStatus;
const uint32_t flags = NS_FRAME_NO_MOVE_FRAME;
ReflowChild(aFlexItem.Frame(), aPresContext,
childDesiredSize, childRSForMeasuringHeight,
0, 0, flags, childReflowStatus);
MOZ_ASSERT(NS_FRAME_IS_COMPLETE(childReflowStatus),
"We gave flex item unconstrained available height, so it "
@@ -3718,17 +3718,17 @@ nsFlexContainerFrame::SizeItemInCrossAxi
if (aItem.GetAlignSelf() == NS_STYLE_ALIGN_STRETCH) {
// This item's got "align-self: stretch", so we probably imposed a
// stretched computed height on it during its previous reflow. We're
// not imposing that height for *this* measuring reflow, so we need to
// tell it to treat this reflow as a vertical resize (regardless of
// whether any of its ancestors are being resized).
aChildReflowState.SetVResize(true);
}
- nsHTMLReflowMetrics childDesiredSize(aChildReflowState);
+ ReflowOutput childDesiredSize(aChildReflowState);
nsReflowStatus childReflowStatus;
const uint32_t flags = NS_FRAME_NO_MOVE_FRAME;
ReflowChild(aItem.Frame(), aPresContext,
childDesiredSize, aChildReflowState,
0, 0, flags, childReflowStatus);
aItem.SetHadMeasuringReflow();
// XXXdholbert Once we do pagination / splitting, we'll need to actually
@@ -3802,17 +3802,17 @@ FlexLine::PositionItemsInCrossAxis(nscoo
// Back out to cross-axis edge of the line.
lineCrossAxisPosnTracker.ResetPosition();
}
}
void
nsFlexContainerFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsFlexContainerFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
MOZ_LOG(gFlexContainerLog, LogLevel::Debug,
("Reflow() for nsFlexContainerFrame %p\n", this));
@@ -3945,17 +3945,17 @@ public:
private:
const FrameProperties mItemProps;
MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
};
void
nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus,
nscoord aContentBoxMainSize,
nscoord aAvailableBSizeForContent,
nsTArray<StrutInfo>& aStruts,
const FlexboxAxisTracker& aAxisTracker)
{
aStatus = NS_FRAME_COMPLETE;
@@ -4353,17 +4353,17 @@ nsFlexContainerFrame::ReflowFlexItem(nsP
if (didOverrideComputedHeight) {
childReflowState.SetVResize(true);
}
}
// NOTE: Be very careful about doing anything else with childReflowState
// after this point, because some of its methods (e.g. SetComputedWidth)
// internally call InitResizeFlags and stomp on mVResize & mHResize.
- nsHTMLReflowMetrics childDesiredSize(childReflowState);
+ ReflowOutput childDesiredSize(childReflowState);
nsReflowStatus childReflowStatus;
ReflowChild(aItem.Frame(), aPresContext,
childDesiredSize, childReflowState,
outerWM, aFramePos, aContainerSize,
0, childReflowStatus);
// XXXdholbert Once we do pagination / splitting, we'll need to actually
// handle incomplete childReflowStatuses. But for now, we give our kids
--- a/layout/generic/nsFlexContainerFrame.h
+++ b/layout/generic/nsFlexContainerFrame.h
@@ -58,17 +58,17 @@ public:
struct StrutInfo;
// nsIFrame overrides
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual nscoord
GetMinISize(nsRenderingContext* aRenderingContext) override;
virtual nscoord
GetPrefISize(nsRenderingContext* aRenderingContext) override;
@@ -96,17 +96,17 @@ protected:
* as Reflow(), plus a few more parameters that Reflow() sets up for us.
*
* (The logic behind the division of work between Reflow and DoFlexLayout is
* as follows: DoFlexLayout() begins at the step that we have to jump back
* to, if we find any visibility:collapse children, and Reflow() does
* everything before that point.)
*/
void DoFlexLayout(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus,
nscoord aContentBoxMainSize,
nscoord aAvailableBSizeForContent,
nsTArray<StrutInfo>& aStruts,
const FlexboxAxisTracker& aAxisTracker);
/**
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -4959,29 +4959,29 @@ nsFrame::DidReflow(nsPresContext*
}
}
aPresContext->ReflowedFrame();
}
void
nsFrame::FinishReflowWithAbsoluteFrames(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus,
bool aConstrainBSize)
{
ReflowAbsoluteFrames(aPresContext, aDesiredSize, aReflowState, aStatus, aConstrainBSize);
FinishAndStoreOverflow(&aDesiredSize);
}
void
nsFrame::ReflowAbsoluteFrames(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus,
bool aConstrainBSize)
{
if (HasAbsolutelyPositionedChildren()) {
nsAbsoluteContainingBlock* absoluteContainer = GetAbsoluteContainingBlock();
// Let the absolutely positioned container reflow any absolutely positioned
@@ -5025,17 +5025,17 @@ nsFrame::CanContinueTextRun() const
{
// By default, a frame will *not* allow a text run to be continued
// through it.
return false;
}
void
nsFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsFrame");
aDesiredSize.ClearSize();
aStatus = NS_FRAME_COMPLETE;
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
@@ -6040,17 +6040,17 @@ nsFrame::UnionChildOverflow(nsOverflowAr
// Define the MAX_FRAME_DEPTH to be the ContentSink's MAX_REFLOW_DEPTH plus
// 4 for the frames above the document's frames:
// the Viewport, GFXScroll, ScrollPort, and Canvas
#define MAX_FRAME_DEPTH (MAX_REFLOW_DEPTH+4)
bool
nsFrame::IsFrameTreeTooDeep(const ReflowInput& aReflowState,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
nsReflowStatus& aStatus)
{
if (aReflowState.mReflowDepth > MAX_FRAME_DEPTH) {
NS_WARNING("frame tree too deep; setting zero size and returning");
mState |= NS_FRAME_TOO_DEEP_IN_FRAME_TREE;
ClearOverflowRects();
aMetrics.ClearSize();
aMetrics.SetBlockStartAscent(0);
@@ -8715,17 +8715,17 @@ nsFrame::RefreshSizeCache(nsBoxLayoutSta
GetPrefISize(rendContext) + bp.LeftRight();
metrics->mBlockMinSize.width =
GetMinISize(rendContext) + bp.LeftRight();
}
// do the nasty.
const WritingMode wm = aState.OuterReflowState() ?
aState.OuterReflowState()->GetWritingMode() : GetWritingMode();
- nsHTMLReflowMetrics desiredSize(wm);
+ ReflowOutput desiredSize(wm);
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
// ask the block for its line iterator. Get the max ascent.
nsAutoLineIterator lines = GetLineIterator();
@@ -8747,17 +8747,17 @@ nsFrame::RefreshSizeCache(nsBoxLayoutSta
} while(firstFrame);
} else {
metrics->mBlockMinSize.height = desiredSize.Height();
}
metrics->mBlockPrefSize.height = metrics->mBlockMinSize.height;
if (desiredSize.BlockStartAscent() ==
- nsHTMLReflowMetrics::ASK_FOR_BASELINE) {
+ ReflowOutput::ASK_FOR_BASELINE) {
if (!nsLayoutUtils::GetFirstLineBaseline(wm, this,
&metrics->mBlockAscent))
metrics->mBlockAscent = GetLogicalBaseline(wm);
} else {
metrics->mBlockAscent = desiredSize.BlockStartAscent();
}
#ifdef DEBUG_adaptor
@@ -8905,17 +8905,17 @@ nsFrame::DoXULLayout(nsBoxLayoutState& a
{
nsRect ourRect(mRect);
nsRenderingContext* rendContext = aState.GetRenderingContext();
nsPresContext* presContext = aState.PresContext();
WritingMode ourWM = GetWritingMode();
const WritingMode outerWM = aState.OuterReflowState() ?
aState.OuterReflowState()->GetWritingMode() : ourWM;
- nsHTMLReflowMetrics desiredSize(outerWM);
+ ReflowOutput desiredSize(outerWM);
LogicalSize ourSize = GetLogicalSize(outerWM);
if (rendContext) {
BoxReflow(aState, presContext, desiredSize, rendContext,
ourRect.x, ourRect.y, ourRect.width, ourRect.height);
if (IsXULCollapsed()) {
@@ -8980,17 +8980,17 @@ nsFrame::DoXULLayout(nsBoxLayoutState& a
SyncLayout(aState);
return NS_OK;
}
void
nsFrame::BoxReflow(nsBoxLayoutState& aState,
nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
nsRenderingContext* aRenderingContext,
nscoord aX,
nscoord aY,
nscoord aWidth,
nscoord aHeight,
bool aMoveFrame)
{
DO_GLOBAL_REFLOW_COUNT("nsBoxToBlockAdaptor");
@@ -9185,17 +9185,17 @@ nsFrame::BoxReflow(nsBoxLayoutState&
nsContainerFrame::FinishReflowChild(this, aPresContext, aDesiredSize,
&reflowState, aX, aY, layoutFlags | NS_FRAME_NO_MOVE_FRAME);
// Save the ascent. (bug 103925)
if (IsXULCollapsed()) {
metrics->mAscent = 0;
} else {
if (aDesiredSize.BlockStartAscent() ==
- nsHTMLReflowMetrics::ASK_FOR_BASELINE) {
+ ReflowOutput::ASK_FOR_BASELINE) {
if (!nsLayoutUtils::GetFirstLineBaseline(wm, this, &metrics->mAscent))
metrics->mAscent = GetLogicalBaseline(wm);
} else
metrics->mAscent = aDesiredSize.BlockStartAscent();
}
} else {
aDesiredSize.SetBlockStartAscent(metrics->mBlockAscent);
@@ -9605,17 +9605,17 @@ nsFrame::VerifyDirtyBitSet(const nsFrame
}
// Start Display Reflow
#ifdef DEBUG
DR_cookie::DR_cookie(nsPresContext* aPresContext,
nsIFrame* aFrame,
const ReflowInput& aReflowState,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
nsReflowStatus& aStatus)
:mPresContext(aPresContext), mFrame(aFrame), mReflowState(aReflowState), mMetrics(aMetrics), mStatus(aStatus)
{
MOZ_COUNT_CTOR(DR_cookie);
mValue = nsFrame::DisplayReflowEnter(aPresContext, mFrame, mReflowState);
}
DR_cookie::~DR_cookie()
@@ -10432,17 +10432,17 @@ void* nsFrame::DisplayIntrinsicSizeEnter
DR_state->DisplayFrameTypeInfo(aFrame, treeNode->mIndent);
printf("Get%sSize\n", aType);
}
return treeNode;
}
void nsFrame::DisplayReflowExit(nsPresContext* aPresContext,
nsIFrame* aFrame,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
nsReflowStatus aStatus,
void* aFrameTreeNode)
{
if (!DR_state->mActive) return;
NS_ASSERTION(aFrame, "DisplayReflowExit - invalid call");
if (!aFrameTreeNode) return;
--- a/layout/generic/nsFrame.h
+++ b/layout/generic/nsFrame.h
@@ -308,17 +308,17 @@ public:
* max(GetMinISize(), min(aWidthInCB, GetPrefISize()))
*/
nscoord ShrinkWidthToFit(nsRenderingContext *aRenderingContext,
nscoord aWidthInCB);
/**
* Calculates the size of this frame after reflowing (calling Reflow on, and
* updating the size and position of) its children, as necessary. The
- * calculated size is returned to the caller via the nsHTMLReflowMetrics
+ * calculated size is returned to the caller via the ReflowOutput
* outparam. (The caller is responsible for setting the actual size and
* position of this frame.)
*
* A frame's children must _all_ be reflowed if the frame is dirty (the
* NS_FRAME_IS_DIRTY bit is set on it). Otherwise, individual children
* must be reflowed if they are dirty or have the NS_FRAME_HAS_DIRTY_CHILDREN
* bit set on them. Otherwise, whether children need to be reflowed depends
* on the frame's type (it's up to individual Reflow methods), and on what
@@ -328,35 +328,35 @@ public:
* (ReflowInput::ShouldReflowAllKids may be helpful in deciding whether
* to reflow all the children, but for some frame types it might result in
* over-reflow.)
*
* 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,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual void DidReflow(nsPresContext* aPresContext,
const ReflowInput* aReflowState,
nsDidReflowStatus aStatus) override;
/**
* NOTE: aStatus is assumed to be already-initialized. The reflow statuses of
* any reflowed absolute children will be merged into aStatus; aside from
* that, this method won't modify aStatus.
*/
void ReflowAbsoluteFrames(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus,
bool aConstrainBSize = true);
void FinishReflowWithAbsoluteFrames(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus,
bool aConstrainBSize = true);
/*
* If this frame is dirty, marks all absolutely-positioned children of this
* frame dirty. If this frame isn't dirty, or if there are no
* absolutely-positioned children, does nothing.
@@ -427,17 +427,17 @@ public:
// Additional methods
// Helper function that tests if the frame tree is too deep; if it is
// it marks the frame as "unflowable", zeroes out the metrics, sets
// the reflow status, and returns true. Otherwise, the frame is
// unmarked "unflowable" and the metrics and reflow status are not
// touched and false is returned.
bool IsFrameTreeTooDeep(const ReflowInput& aReflowState,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
nsReflowStatus& aStatus);
// Incorporate the child overflow areas into aOverflowAreas.
// If the child does not have a overflow, use the child area.
void ConsiderChildOverflow(nsOverflowAreas& aOverflowAreas,
nsIFrame* aChildFrame);
/**
@@ -483,17 +483,17 @@ public:
const ReflowInput& aReflowState);
static void* DisplayLayoutEnter(nsIFrame* aFrame);
static void* DisplayIntrinsicISizeEnter(nsIFrame* aFrame,
const char* aType);
static void* DisplayIntrinsicSizeEnter(nsIFrame* aFrame,
const char* aType);
static void DisplayReflowExit(nsPresContext* aPresContext,
nsIFrame* aFrame,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
uint32_t aStatus,
void* aFrameTreeNode);
static void DisplayLayoutExit(nsIFrame* aFrame,
void* aFrameTreeNode);
static void DisplayIntrinsicISizeExit(nsIFrame* aFrame,
const char* aType,
nscoord aResult,
void* aFrameTreeNode);
@@ -665,17 +665,17 @@ protected:
nsBoxLayoutMetrics* BoxMetrics() const;
// Fire DOM event. If no aContent argument use frame's mContent.
void FireDOMEvent(const nsAString& aDOMEventName, nsIContent *aContent = nullptr);
private:
void BoxReflow(nsBoxLayoutState& aState,
nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
nsRenderingContext* aRenderingContext,
nscoord aX,
nscoord aY,
nscoord aWidth,
nscoord aHeight,
bool aMoveFrame = true);
NS_IMETHODIMP RefreshSizeCache(nsBoxLayoutState& aState);
@@ -765,25 +765,25 @@ public:
// Start Display Reflow Debugging
#ifdef DEBUG
struct DR_cookie {
DR_cookie(nsPresContext* aPresContext,
nsIFrame* aFrame,
const mozilla::ReflowInput& aReflowState,
- mozilla::nsHTMLReflowMetrics& aMetrics,
+ mozilla::ReflowOutput& aMetrics,
nsReflowStatus& aStatus);
~DR_cookie();
void Change() const;
nsPresContext* mPresContext;
nsIFrame* mFrame;
const mozilla::ReflowInput& mReflowState;
- mozilla::nsHTMLReflowMetrics& mMetrics;
+ mozilla::ReflowOutput& mMetrics;
nsReflowStatus& mStatus;
void* mValue;
};
struct DR_layout_cookie {
explicit DR_layout_cookie(nsIFrame* aFrame);
~DR_layout_cookie();
--- a/layout/generic/nsFrameSetFrame.cpp
+++ b/layout/generic/nsFrameSetFrame.cpp
@@ -99,17 +99,17 @@ public:
virtual nsresult GetCursor(const nsPoint& aPoint,
nsIFrame::Cursor& aCursor) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
bool GetVisibility() { return mVisibility; }
void SetVisibility(bool aVisibility);
void SetColor(nscolor aColor);
void PaintBorder(DrawTarget* aDrawTarget, nsPoint aPt);
@@ -148,17 +148,17 @@ public:
}
#endif
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
protected:
explicit nsHTMLFramesetBlankFrame(nsStyleContext* aContext) : nsLeafFrame(aContext) {}
virtual ~nsHTMLFramesetBlankFrame();
virtual nscoord GetIntrinsicISize() override;
virtual nscoord GetIntrinsicBSize() override;
@@ -559,17 +559,17 @@ int32_t nsHTMLFramesetFrame::GetBorderWi
}
return nsPresContext::CSSPixelsToAppUnits(DEFAULT_BORDER_WIDTH_PX);
}
void
nsHTMLFramesetFrame::GetDesiredSize(nsPresContext* aPresContext,
const ReflowInput& aReflowState,
- nsHTMLReflowMetrics& aDesiredSize)
+ ReflowOutput& aDesiredSize)
{
WritingMode wm = aReflowState.GetWritingMode();
LogicalSize desiredSize(wm);
nsHTMLFramesetFrame* framesetParent = do_QueryFrame(GetParent());
if (nullptr == framesetParent) {
if (aPresContext->IsPaginated()) {
// XXX This needs to be changed when framesets paginate properly
desiredSize.ISize(wm) = aReflowState.AvailableISize();
@@ -687,17 +687,17 @@ nsHTMLFramesetFrame::ReflowPlaceChild(ns
nsSize& aSize,
nsIntPoint* aCellIndex)
{
// reflow the child
ReflowInput reflowState(aPresContext, aReflowState, aChild,
LogicalSize(aChild->GetWritingMode(), aSize));
reflowState.SetComputedWidth(std::max(0, aSize.width - reflowState.ComputedPhysicalBorderPadding().LeftRight()));
reflowState.SetComputedHeight(std::max(0, aSize.height - reflowState.ComputedPhysicalBorderPadding().TopBottom()));
- nsHTMLReflowMetrics metrics(aReflowState);
+ ReflowOutput metrics(aReflowState);
metrics.Width() = aSize.width;
metrics.Height() = aSize.height;
nsReflowStatus status;
ReflowChild(aChild, aPresContext, metrics, reflowState, aOffset.x,
aOffset.y, 0, status);
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "bad status");
@@ -787,17 +787,17 @@ nscolor nsHTMLFramesetFrame::GetBorderCo
}
}
}
return GetBorderColor();
}
void
nsHTMLFramesetFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsHTMLFramesetFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
nsIPresShell *shell = aPresContext->PresShell();
StyleSetHandle styleSet = shell->StyleSet();
@@ -1367,17 +1367,17 @@ void nsHTMLFramesetBorderFrame::SetVisib
void nsHTMLFramesetBorderFrame::SetColor(nscolor aColor)
{
mColor = aColor;
}
void
nsHTMLFramesetBorderFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
DO_GLOBAL_REFLOW_COUNT("nsHTMLFramesetBorderFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
// Override Reflow(), since we don't want to deal with what our
// computed values are.
@@ -1582,17 +1582,17 @@ nscoord nsHTMLFramesetBlankFrame::GetInt
nscoord nsHTMLFramesetBlankFrame::GetIntrinsicBSize()
{
// No intrinsic height
return 0;
}
void
nsHTMLFramesetBlankFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
DO_GLOBAL_REFLOW_COUNT("nsHTMLFramesetBlankFrame");
// Override Reflow(), since we don't want to deal with what our
// computed values are.
SizeToAvailSize(aReflowState, aDesiredSize);
--- a/layout/generic/nsFrameSetFrame.h
+++ b/layout/generic/nsFrameSetFrame.h
@@ -96,17 +96,17 @@ public:
virtual nsresult GetCursor(const nsPoint& aPoint,
nsIFrame::Cursor& aCursor) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual nsIAtom* GetType() const override;
#ifdef DEBUG_FRAME_DUMP
virtual nsresult GetFrameName(nsAString& aResult) const override;
#endif
@@ -146,17 +146,17 @@ protected:
nscoord aSize,
int32_t aNumSpecs,
const nsFramesetSpec* aSpecs,
nscoord* aValues,
nsString& aNewAttr);
virtual void GetDesiredSize(nsPresContext* aPresContext,
const ReflowInput& aReflowState,
- nsHTMLReflowMetrics& aDesiredSize);
+ ReflowOutput& aDesiredSize);
int32_t GetBorderWidth(nsPresContext* aPresContext,
bool aTakeForcingIntoAccount);
int32_t GetParentBorderWidth() { return mParentBorderWidth; }
void SetParentBorderWidth(int32_t aWidth) { mParentBorderWidth = aWidth; }
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -311,17 +311,17 @@ GetScrollbarMetrics(nsBoxLayoutState& aS
* (i.e., the scrollbar fits horizontally)
* 4) the style is SCROLL, or the kid's overflow-area XMost is
* greater than the scrollport width
*
* @param aForce if true, then we just assume the layout is consistent.
*/
bool
nsHTMLScrollFrame::TryLayout(ScrollReflowInput* aState,
- nsHTMLReflowMetrics* aKidMetrics,
+ ReflowOutput* aKidMetrics,
bool aAssumeHScroll, bool aAssumeVScroll,
bool aForce)
{
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!");
return false;
}
@@ -442,17 +442,17 @@ nsHTMLScrollFrame::ScrolledContentDepend
aState->mReflowState.ComputedMinBSize() > 0 ||
aState->mReflowState.ComputedMaxBSize() != NS_UNCONSTRAINEDSIZE;
}
void
nsHTMLScrollFrame::ReflowScrolledFrame(ScrollReflowInput* aState,
bool aAssumeHScroll,
bool aAssumeVScroll,
- nsHTMLReflowMetrics* aMetrics,
+ ReflowOutput* aMetrics,
bool aFirstPass)
{
WritingMode wm = mHelper.mScrolledFrame->GetWritingMode();
// these could be NS_UNCONSTRAINEDSIZE ... std::min arithmetic should
// be OK
LogicalMargin padding = aState->mReflowState.ComputedLogicalPadding();
nscoord availISize =
@@ -645,19 +645,19 @@ nsHTMLScrollFrame::InInitialReflow() con
// end up auto-sizing so they don't overflow, and that the root basically
// always needs a scrollbar if it did last time we loaded this page (good
// assumption, because our initial reflow is no longer synchronous).
return !mHelper.mIsRoot && (GetStateBits() & NS_FRAME_FIRST_REFLOW);
}
void
nsHTMLScrollFrame::ReflowContents(ScrollReflowInput* aState,
- const nsHTMLReflowMetrics& aDesiredSize)
-{
- nsHTMLReflowMetrics kidDesiredSize(aDesiredSize.GetWritingMode(), aDesiredSize.mFlags);
+ const ReflowOutput& aDesiredSize)
+{
+ ReflowOutput kidDesiredSize(aDesiredSize.GetWritingMode(), aDesiredSize.mFlags);
ReflowScrolledFrame(aState, GuessHScrollbarNeeded(*aState),
GuessVScrollbarNeeded(*aState), &kidDesiredSize, true);
// There's an important special case ... if the child appears to fit
// in the inside-border rect (but overflows the scrollport), we
// should try laying it out without a vertical scrollbar. It will
// usually fit because making the available-width wider will not
// normally make the child taller. (The only situation I can think
@@ -829,17 +829,17 @@ GetBrowserRoot(nsIContent* aContent)
}
}
return nullptr;
}
void
nsHTMLScrollFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsHTMLScrollFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
mHelper.HandleScrollbarStyleSwitching();
--- a/layout/generic/nsGfxScrollFrame.h
+++ b/layout/generic/nsGfxScrollFrame.h
@@ -671,43 +671,43 @@ public:
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override {
mHelper.BuildDisplayList(aBuilder, aDirtyRect, aLists);
}
bool TryLayout(ScrollReflowInput* aState,
- nsHTMLReflowMetrics* aKidMetrics,
+ ReflowOutput* aKidMetrics,
bool aAssumeVScroll, bool aAssumeHScroll,
bool aForce);
bool ScrolledContentDependsOnHeight(ScrollReflowInput* aState);
void ReflowScrolledFrame(ScrollReflowInput* aState,
bool aAssumeHScroll,
bool aAssumeVScroll,
- nsHTMLReflowMetrics* aMetrics,
+ ReflowOutput* aMetrics,
bool aFirstPass);
void ReflowContents(ScrollReflowInput* aState,
- const nsHTMLReflowMetrics& aDesiredSize);
+ const ReflowOutput& aDesiredSize);
void PlaceScrollArea(const ScrollReflowInput& aState,
const nsPoint& aScrollPosition);
nscoord GetIntrinsicVScrollbarWidth(nsRenderingContext *aRenderingContext);
virtual bool GetBorderRadii(const nsSize& aFrameSize, const nsSize& aBorderArea,
Sides aSkipSides, nscoord aRadii[8]) const override {
return mHelper.GetBorderRadii(aFrameSize, aBorderArea, aSkipSides, aRadii);
}
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
virtual nsresult GetXULPadding(nsMargin& aPadding) override;
virtual bool IsXULCollapsed() override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual bool ComputeCustomOverflow(nsOverflowAreas& aOverflowAreas) override {
return mHelper.ComputeCustomOverflow(aOverflowAreas);
}
// Called to set the child frames. We typically have three: the scroll area,
--- a/layout/generic/nsGridContainerFrame.cpp
+++ b/layout/generic/nsGridContainerFrame.cpp
@@ -3439,17 +3439,17 @@ MeasuringReflow(nsIFrame*
#ifdef DEBUG
// This will suppress various CRAZY_SIZE warnings for this reflow.
parent->Properties().Set(
nsContainerFrame::DebugReflowingWithInfiniteISize(), true);
#endif
ReflowInput childRS(pc, *rs, aChild, aAvailableSize, nullptr,
ReflowInput::COMPUTE_SIZE_SHRINK_WRAP |
ReflowInput::COMPUTE_SIZE_USE_AUTO_BSIZE);
- nsHTMLReflowMetrics childSize(childRS);
+ ReflowOutput childSize(childRS);
nsReflowStatus childStatus;
const uint32_t flags = NS_FRAME_NO_MOVE_FRAME | NS_FRAME_NO_SIZE_VIEW;
WritingMode wm = childRS.GetWritingMode();
parent->ReflowChild(aChild, pc, childSize, childRS, wm,
LogicalPoint(wm), nsSize(), flags, childStatus);
parent->FinishReflowChild(aChild, pc, childSize, &childRS, wm,
LogicalPoint(wm), nsSize(), flags);
#ifdef DEBUG
@@ -4607,17 +4607,17 @@ nsGridContainerFrame::GetNearestFragment
void
nsGridContainerFrame::ReflowInFlowChild(nsIFrame* aChild,
const GridItemInfo* aGridItemInfo,
nsSize aContainerSize,
Maybe<nscoord> aStretchBSize,
const Fragmentainer* aFragmentainer,
const GridReflowState& aState,
const LogicalRect& aContentArea,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
nsReflowStatus& aStatus)
{
nsPresContext* pc = PresContext();
nsStyleContext* containerSC = StyleContext();
WritingMode wm = aState.mReflowState->GetWritingMode();
LogicalMargin pad(aState.mReflowState->ComputedLogicalPadding());
const LogicalPoint padStart(wm, pad.IStart(wm), pad.BStart(wm));
const bool isGridItem = !!aGridItemInfo;
@@ -4716,17 +4716,17 @@ nsGridContainerFrame::ReflowInFlowChild(
} else {
aChild->Properties().Delete(FragStretchBSizeProperty());
}
}
// We need the width of the child before we can correctly convert
// the writing-mode of its origin, so we reflow at (0, 0) using a dummy
// aContainerSize, and then pass the correct position to FinishReflowChild.
- nsHTMLReflowMetrics childSize(childRS);
+ ReflowOutput childSize(childRS);
const nsSize dummyContainerSize;
ReflowChild(aChild, pc, childSize, childRS, childWM, LogicalPoint(childWM),
dummyContainerSize, 0, aStatus);
LogicalPoint childPos =
cb.Origin(wm).ConvertTo(childWM, wm,
aContainerSize - childSize.PhysicalSize());
// Apply align/justify-self and reflow again if that affects the size.
if (MOZ_LIKELY(isGridItem)) {
@@ -4757,17 +4757,17 @@ nsGridContainerFrame::ReflowInFlowChild(
FinishReflowChild(aChild, pc, childSize, &childRS, childWM, childPos,
aContainerSize, 0);
ConsiderChildOverflow(aDesiredSize.mOverflowAreas, aChild);
}
nscoord
nsGridContainerFrame::ReflowInFragmentainer(GridReflowState& aState,
const LogicalRect& aContentArea,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
nsReflowStatus& aStatus,
Fragmentainer& aFragmentainer,
const nsSize& aContainerSize)
{
MOZ_ASSERT(aStatus == NS_FRAME_COMPLETE);
MOZ_ASSERT(aState.mReflowState);
// Collect our grid items and sort them in row order. Collect placeholders
@@ -4975,17 +4975,17 @@ nsGridContainerFrame::ReflowInFragmentai
aFragmentainer, aContainerSize, sortedItems,
startRow, endRow, bSize, childAvailableSize);
}
nscoord
nsGridContainerFrame::ReflowRowsInFragmentainer(
GridReflowState& aState,
const LogicalRect& aContentArea,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
nsReflowStatus& aStatus,
Fragmentainer& aFragmentainer,
const nsSize& aContainerSize,
const nsTArray<const GridItemInfo*>& aSortedItems,
uint32_t aStartRow,
uint32_t aEndRow,
nscoord aBSize,
nscoord aAvailableSize)
@@ -5253,17 +5253,17 @@ nsGridContainerFrame::ReflowRowsInFragme
}
}
return aBSize;
}
nscoord
nsGridContainerFrame::ReflowChildren(GridReflowState& aState,
const LogicalRect& aContentArea,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
nsReflowStatus& aStatus)
{
MOZ_ASSERT(aState.mReflowState);
aStatus = NS_FRAME_COMPLETE;
nsOverflowAreas ocBounds;
nsReflowStatus ocStatus = NS_FRAME_COMPLETE;
if (GetPrevInFlow()) {
@@ -5341,17 +5341,17 @@ nsGridContainerFrame::ReflowChildren(Gri
&aDesiredSize.mOverflowAreas);
}
}
return bSize;
}
void
nsGridContainerFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsGridContainerFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
if (IsFrameTreeTooDeep(aReflowState, aDesiredSize, aStatus)) {
--- a/layout/generic/nsGridContainerFrame.h
+++ b/layout/generic/nsGridContainerFrame.h
@@ -67,17 +67,17 @@ public:
NS_DECL_FRAMEARENA_HELPERS
NS_DECL_QUERYFRAME_TARGET(nsGridContainerFrame)
NS_DECL_QUERYFRAME
typedef mozilla::ComputedGridTrackInfo ComputedGridTrackInfo;
typedef mozilla::ComputedGridLineInfo ComputedGridLineInfo;
// nsIFrame overrides
void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
nscoord GetMinISize(nsRenderingContext* aRenderingContext) override;
nscoord GetPrefISize(nsRenderingContext* aRenderingContext) override;
void MarkIntrinsicISizesDirty() override;
nsIAtom* GetType() const override;
bool IsFrameOfType(uint32_t aFlags) const override
{
@@ -206,17 +206,17 @@ protected:
/**
* Reflow and place our children.
* @return the consumed size of all of this grid container's continuations
* so far including this frame
*/
nscoord ReflowChildren(GridReflowState& aState,
const LogicalRect& aContentArea,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
nsReflowStatus& aStatus);
/**
* Helper for GetMinISize / GetPrefISize.
*/
nscoord IntrinsicISize(nsRenderingContext* aRenderingContext,
IntrinsicISizeType aConstraint);
@@ -259,26 +259,26 @@ private:
};
mozilla::Maybe<nsGridContainerFrame::Fragmentainer>
GetNearestFragmentainer(const GridReflowState& aState) const;
// @return the consumed size of all continuations so far including this frame
nscoord ReflowInFragmentainer(GridReflowState& aState,
const LogicalRect& aContentArea,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
nsReflowStatus& aStatus,
Fragmentainer& aFragmentainer,
const nsSize& aContainerSize);
// Helper for ReflowInFragmentainer
// @return the consumed size of all continuations so far including this frame
nscoord ReflowRowsInFragmentainer(GridReflowState& aState,
const LogicalRect& aContentArea,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
nsReflowStatus& aStatus,
Fragmentainer& aFragmentainer,
const nsSize& aContainerSize,
const nsTArray<const GridItemInfo*>& aItems,
uint32_t aStartRow,
uint32_t aEndRow,
nscoord aBSize,
nscoord aAvailableSize);
@@ -286,17 +286,17 @@ private:
// Helper for ReflowChildren / ReflowInFragmentainer
void ReflowInFlowChild(nsIFrame* aChild,
const GridItemInfo* aGridItemInfo,
nsSize aContainerSize,
mozilla::Maybe<nscoord> aStretchBSize,
const Fragmentainer* aFragmentainer,
const GridReflowState& aState,
const LogicalRect& aContentArea,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
nsReflowStatus& aStatus);
/**
* Cached values to optimize GetMinISize/GetPrefISize.
*/
nscoord mCachedMinISize;
nscoord mCachedPrefISize;
--- a/layout/generic/nsHTMLCanvasFrame.cpp
+++ b/layout/generic/nsHTMLCanvasFrame.cpp
@@ -243,17 +243,17 @@ nsHTMLCanvasFrame::ComputeSize(nsRenderi
aCBSize,
aMargin,
aBorder,
aPadding);
}
void
nsHTMLCanvasFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsHTMLCanvasFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aStatus);
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
("enter nsHTMLCanvasFrame::Reflow: availSize=%d,%d",
@@ -286,17 +286,17 @@ nsHTMLCanvasFrame::Reflow(nsPresContext*
// Reflow the single anon block child.
nsReflowStatus childStatus;
nsIFrame* childFrame = mFrames.FirstChild();
WritingMode childWM = childFrame->GetWritingMode();
LogicalSize availSize = aReflowState.ComputedSize(childWM);
availSize.BSize(childWM) = NS_UNCONSTRAINEDSIZE;
NS_ASSERTION(!childFrame->GetNextSibling(), "HTML canvas should have 1 kid");
- nsHTMLReflowMetrics childDesiredSize(aReflowState.GetWritingMode(), aMetrics.mFlags);
+ ReflowOutput childDesiredSize(aReflowState.GetWritingMode(), aMetrics.mFlags);
ReflowInput childReflowState(aPresContext, aReflowState, childFrame,
availSize);
ReflowChild(childFrame, aPresContext, childDesiredSize, childReflowState,
0, 0, 0, childStatus, nullptr);
FinishReflowChild(childFrame, aPresContext, childDesiredSize,
&childReflowState, 0, 0, 0);
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
--- a/layout/generic/nsHTMLCanvasFrame.h
+++ b/layout/generic/nsHTMLCanvasFrame.h
@@ -67,17 +67,17 @@ public:
const mozilla::LogicalSize& aCBSize,
nscoord aAvailableISize,
const mozilla::LogicalSize& aMargin,
const mozilla::LogicalSize& aBorder,
const mozilla::LogicalSize& aPadding,
ComputeSizeFlags aFlags) override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
nsRect GetInnerArea() const;
#ifdef ACCESSIBILITY
virtual mozilla::a11y::AccType AccessibleType() override;
#endif
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -89,17 +89,17 @@ struct nsSize;
struct nsMargin;
struct CharacterDataChangeInfo;
namespace mozilla {
enum class CSSPseudoElementType : uint8_t;
class EventStates;
struct ReflowInput;
-class nsHTMLReflowMetrics;
+class ReflowOutput;
namespace layers {
class Layer;
} // namespace layers
namespace gfx {
class Matrix;
} // namespace gfx
@@ -420,17 +420,17 @@ class nsIFrame : public nsQueryFrame
{
public:
template <typename T> using Maybe = mozilla::Maybe<T>;
using Nothing = mozilla::Nothing;
using OnNonvisible = mozilla::OnNonvisible;
template<typename T=void>
using PropertyDescriptor = const mozilla::FramePropertyDescriptor<T>*;
using ReflowInput = mozilla::ReflowInput;
- using nsHTMLReflowMetrics = mozilla::nsHTMLReflowMetrics;
+ using ReflowOutput = mozilla::ReflowOutput;
using Visibility = mozilla::Visibility;
using VisibilityCounter = mozilla::VisibilityCounter;
typedef mozilla::FrameProperties FrameProperties;
typedef mozilla::layers::Layer Layer;
typedef mozilla::layout::FrameChildList ChildList;
typedef mozilla::layout::FrameChildListID ChildListID;
typedef mozilla::layout::FrameChildListIDs ChildListIDs;
@@ -2043,17 +2043,17 @@ public:
* still must return an accurate desired size. If you're a container
* you must <b>always</b> reflow at least one frame regardless of the
* available space
*
* @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,
+ ReflowOutput& aReflowMetrics,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) = 0;
/**
* Post-reflow hook. After a frame is reflowed this method will be called
* informing the frame that this reflow process is complete, and telling the
* frame the status returned by the Reflow member function.
*
@@ -2631,17 +2631,17 @@ public:
* Store the overflow area in the frame's mOverflow.mVisualDeltas
* fields or as a frame property in the frame manager so that it can
* be retrieved later without reflowing the frame. Returns true if either of
* the overflow areas changed.
*/
bool FinishAndStoreOverflow(nsOverflowAreas& aOverflowAreas,
nsSize aNewSize, nsSize* aOldSize = nullptr);
- bool FinishAndStoreOverflow(nsHTMLReflowMetrics* aMetrics) {
+ bool FinishAndStoreOverflow(ReflowOutput* aMetrics) {
return FinishAndStoreOverflow(aMetrics->mOverflowAreas,
nsSize(aMetrics->Width(), aMetrics->Height()));
}
/**
* Returns whether the frame has an overflow rect that is different from
* its border-box.
*/
--- a/layout/generic/nsImageFrame.cpp
+++ b/layout/generic/nsImageFrame.cpp
@@ -943,17 +943,17 @@ nsImageFrame::GetIntrinsicSize()
/* virtual */ nsSize
nsImageFrame::GetIntrinsicRatio()
{
return mIntrinsicRatio;
}
void
nsImageFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsImageFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aStatus);
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
("enter nsImageFrame::Reflow: availSize=%d,%d",
--- a/layout/generic/nsImageFrame.h
+++ b/layout/generic/nsImageFrame.h
@@ -84,17 +84,17 @@ public:
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
virtual mozilla::IntrinsicSize GetIntrinsicSize() override;
virtual nsSize GetIntrinsicRatio() override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual nsresult GetContentForEvent(mozilla::WidgetEvent* aEvent,
nsIContent** aContent) override;
virtual nsresult HandleEvent(nsPresContext* aPresContext,
mozilla::WidgetGUIEvent* aEvent,
nsEventStatus* aEventStatus) override;
--- a/layout/generic/nsInlineFrame.cpp
+++ b/layout/generic/nsInlineFrame.cpp
@@ -356,17 +356,17 @@ ReparentChildListStyle(nsPresContext* aP
NS_ASSERTION(e.get()->GetParent() == aParentFrame, "Bogus parentage");
restyleManager->ReparentStyleContext(e.get());
nsLayoutUtils::MarkDescendantsDirty(e.get());
}
}
void
nsInlineFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsInlineFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aStatus);
if (nullptr == aReflowState.mLineLayout) {
NS_ERROR("must have non-null aReflowState.mLineLayout");
@@ -566,17 +566,17 @@ nsInlineFrame::PullOverflowsFromPrevInFl
}
}
}
void
nsInlineFrame::ReflowFrames(nsPresContext* aPresContext,
const ReflowInput& aReflowState,
InlineReflowState& irs,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
nsReflowStatus& aStatus)
{
aStatus = NS_FRAME_COMPLETE;
nsLineLayout* lineLayout = aReflowState.mLineLayout;
bool inFirstLine = aReflowState.mLineLayout->GetInFirstLine();
RestyleManagerHandle restyleManager = aPresContext->RestyleManager();
WritingMode frameWM = aReflowState.GetWritingMode();
@@ -1087,17 +1087,17 @@ nsFirstLineFrame::PullOneFrame(nsPresCon
aPresContext->RestyleManager()->ReparentStyleContext(frame);
nsLayoutUtils::MarkDescendantsDirty(frame);
}
return frame;
}
void
nsFirstLineFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
if (nullptr == aReflowState.mLineLayout) {
return; // XXX does this happen? why?
}
--- a/layout/generic/nsInlineFrame.h
+++ b/layout/generic/nsInlineFrame.h
@@ -75,17 +75,17 @@ public:
const mozilla::LogicalSize& aCBSize,
nscoord aAvailableISize,
const mozilla::LogicalSize& aMargin,
const mozilla::LogicalSize& aBorder,
const mozilla::LogicalSize& aPadding,
ComputeSizeFlags aFlags) override;
virtual nsRect ComputeTightBounds(DrawTarget* aDrawTarget) const override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual nsresult AttributeChanged(int32_t aNameSpaceID,
nsIAtom* aAttribute,
int32_t aModType) override;
virtual bool CanContinueTextRun() const override;
@@ -137,17 +137,17 @@ protected:
explicit nsInlineFrame(nsStyleContext* aContext) : nsContainerFrame(aContext) {}
virtual LogicalSides GetLogicalSkipSides(const ReflowInput* aReflowState = nullptr) const override;
void ReflowFrames(nsPresContext* aPresContext,
const ReflowInput& aReflowState,
InlineReflowState& rs,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
nsReflowStatus& aStatus);
void ReflowInlineFrame(nsPresContext* aPresContext,
const ReflowInput& aReflowState,
InlineReflowState& rs,
nsIFrame* aFrame,
nsReflowStatus& aStatus);
@@ -204,17 +204,17 @@ public:
friend nsFirstLineFrame* NS_NewFirstLineFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext);
#ifdef DEBUG_FRAME_DUMP
virtual nsresult GetFrameName(nsAString& aResult) const override;
#endif
virtual nsIAtom* GetType() const override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual void Init(nsIContent* aContent,
nsContainerFrame* aParent,
nsIFrame* aPrevInFlow) override;
virtual void PullOverflowsFromPrevInFlow() override;
virtual bool DrainSelfOverflowList() override;
--- a/layout/generic/nsLeafFrame.cpp
+++ b/layout/generic/nsLeafFrame.cpp
@@ -45,17 +45,17 @@ nsLeafFrame::ComputeAutoSize(nsRendering
{
const WritingMode wm = GetWritingMode();
LogicalSize result(wm, GetIntrinsicISize(), GetIntrinsicBSize());
return result.ConvertTo(aWM, wm);
}
void
nsLeafFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsLeafFrame");
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
("enter nsLeafFrame::Reflow: aMaxSize=%d,%d",
aReflowState.AvailableWidth(), aReflowState.AvailableHeight()));
@@ -64,17 +64,17 @@ nsLeafFrame::Reflow(nsPresContext* aPres
DoReflow(aPresContext, aMetrics, aReflowState, aStatus);
FinishAndStoreOverflow(&aMetrics);
}
void
nsLeafFrame::DoReflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
NS_ASSERTION(aReflowState.ComputedWidth() != NS_UNCONSTRAINEDSIZE,
"Shouldn't have unconstrained stuff here "
"thanks to the rules of reflow");
NS_ASSERTION(NS_INTRINSICSIZE != aReflowState.ComputedHeight(),
"Shouldn't have unconstrained stuff here "
@@ -99,17 +99,17 @@ nscoord
nsLeafFrame::GetIntrinsicBSize()
{
NS_NOTREACHED("Someone didn't override Reflow or ComputeAutoSize");
return 0;
}
void
nsLeafFrame::SizeToAvailSize(const ReflowInput& aReflowState,
- nsHTMLReflowMetrics& aDesiredSize)
+ ReflowOutput& aDesiredSize)
{
WritingMode wm = aReflowState.GetWritingMode();
LogicalSize size(wm, aReflowState.AvailableISize(), // FRAME
aReflowState.AvailableBSize());
aDesiredSize.SetSize(wm, size);
aDesiredSize.SetOverflowAreasToDesiredBounds();
FinishAndStoreOverflow(&aDesiredSize);
}
--- a/layout/generic/nsLeafFrame.h
+++ b/layout/generic/nsLeafFrame.h
@@ -52,25 +52,25 @@ public:
/**
* Reflow our frame. This will use the computed width plus borderpadding for
* the desired width, and use the return value of GetIntrinsicBSize plus
* 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,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
/**
* This method does most of the work that Reflow() above need done.
*/
virtual void DoReflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus);
virtual bool IsFrameOfType(uint32_t aFlags) const override
{
// We don't actually contain a block, but we do always want a
// computed width, so tell a little white lie here.
return nsFrame::IsFrameOfType(aFlags & ~(nsIFrame::eReplacedContainsBlock));
@@ -95,12 +95,12 @@ protected:
* call this method.
*/
virtual nscoord GetIntrinsicBSize();
/**
* Set aDesiredSize to be the available size
*/
void SizeToAvailSize(const ReflowInput& aReflowState,
- nsHTMLReflowMetrics& aDesiredSize);
+ ReflowOutput& aDesiredSize);
};
#endif /* nsLeafFrame_h___ */
--- a/layout/generic/nsLineLayout.cpp
+++ b/layout/generic/nsLineLayout.cpp
@@ -800,17 +800,17 @@ IsPercentageAware(const nsIFrame* aFrame
}
return false;
}
void
nsLineLayout::ReflowFrame(nsIFrame* aFrame,
nsReflowStatus& aReflowStatus,
- nsHTMLReflowMetrics* aMetrics,
+ ReflowOutput* aMetrics,
bool& aPushedFrame)
{
// Initialize OUT parameter
aPushedFrame = false;
PerFrameData* pfd = NewPerFrameData(aFrame);
PerSpanData* psd = mCurrentSpan;
psd->AppendFrame(pfd);
@@ -919,17 +919,17 @@ nsLineLayout::ReflowFrame(nsIFrame* aFra
if (mGotLineBox && IsPercentageAware(aFrame)) {
mLineBox->DisableResizeReflowOptimization();
}
// Note that we don't bother positioning the frame yet, because we're probably
// going to end up moving it when we do the block-direction alignment.
// Adjust spacemanager coordinate system for the frame.
- nsHTMLReflowMetrics metrics(lineWM);
+ ReflowOutput metrics(lineWM);
#ifdef DEBUG
metrics.ISize(lineWM) = nscoord(0xdeadbeef);
metrics.BSize(lineWM) = nscoord(0xdeadbeef);
#endif
nscoord tI = pfd->mBounds.LineLeft(lineWM, ContainerSize());
nscoord tB = pfd->mBounds.BStart(lineWM);
mFloatManager->Translate(tI, tB);
@@ -1266,17 +1266,17 @@ nsLineLayout::SyncAnnotationBounds(PerFr
* Note that there is no check against the Y coordinate because we
* assume that the caller will take care of that.
*/
bool
nsLineLayout::CanPlaceFrame(PerFrameData* pfd,
bool aNotSafeToBreak,
bool aFrameCanContinueTextRun,
bool aCanRollBackBeforeFrame,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
nsReflowStatus& aStatus,
bool* aOptionalBreakAfterFits)
{
NS_PRECONDITION(pfd && pfd->mFrame, "bad args, null pointers for frame data");
*aOptionalBreakAfterFits = true;
WritingMode lineWM = mRootSpan->mWritingMode;
@@ -1425,27 +1425,27 @@ nsLineLayout::CanPlaceFrame(PerFrameData
aStatus = NS_INLINE_LINE_BREAK_BEFORE();
return false;
}
/**
* Place the frame. Update running counters.
*/
void
-nsLineLayout::PlaceFrame(PerFrameData* pfd, nsHTMLReflowMetrics& aMetrics)
+nsLineLayout::PlaceFrame(PerFrameData* pfd, ReflowOutput& aMetrics)
{
WritingMode lineWM = mRootSpan->mWritingMode;
// If the frame's block direction does not match the line's, we can't use
// its ascent; instead, treat it as a block with baseline at the block-end
// edge (or block-begin in the case of an "inverted" line).
if (pfd->mWritingMode.GetBlockDir() != lineWM.GetBlockDir()) {
pfd->mAscent = lineWM.IsLineInverted() ? 0 : aMetrics.BSize(lineWM);
} else {
- if (aMetrics.BlockStartAscent() == nsHTMLReflowMetrics::ASK_FOR_BASELINE) {
+ if (aMetrics.BlockStartAscent() == ReflowOutput::ASK_FOR_BASELINE) {
pfd->mAscent = pfd->mFrame->GetLogicalBaseline(lineWM);
} else {
pfd->mAscent = aMetrics.BlockStartAscent();
}
}
// Advance to next inline coordinate
mCurrentSpan->mICoord = pfd->mBounds.IEnd(lineWM) +
@@ -1460,34 +1460,34 @@ nsLineLayout::PlaceFrame(PerFrameData* p
"this function)");
} else {
mTotalPlacedFrames++;
}
}
void
nsLineLayout::AddBulletFrame(nsIFrame* aFrame,
- const nsHTMLReflowMetrics& aMetrics)
+ const ReflowOutput& aMetrics)
{
NS_ASSERTION(mCurrentSpan == mRootSpan, "bad linelayout user");
NS_ASSERTION(mGotLineBox, "must have line box");
nsIFrame *blockFrame = mBlockReflowState->frame;
NS_ASSERTION(blockFrame->IsFrameOfType(nsIFrame::eBlockFrame),
"must be for block");
if (!static_cast<nsBlockFrame*>(blockFrame)->BulletIsEmpty()) {
mHasBullet = true;
mLineBox->SetHasBullet();
}
WritingMode lineWM = mRootSpan->mWritingMode;
PerFrameData* pfd = NewPerFrameData(aFrame);
mRootSpan->AppendFrame(pfd);
pfd->mIsBullet = true;
- if (aMetrics.BlockStartAscent() == nsHTMLReflowMetrics::ASK_FOR_BASELINE) {
+ if (aMetrics.BlockStartAscent() == ReflowOutput::ASK_FOR_BASELINE) {
pfd->mAscent = aFrame->GetLogicalBaseline(lineWM);
} else {
pfd->mAscent = aMetrics.BlockStartAscent();
}
// Note: block-coord value will be updated during block-direction alignment
pfd->mBounds = LogicalRect(lineWM, aFrame->GetRect(), ContainerSize());
pfd->mOverflowAreas = aMetrics.mOverflowAreas;
--- a/layout/generic/nsLineLayout.h
+++ b/layout/generic/nsLineLayout.h
@@ -25,17 +25,17 @@
#include "plarena.h"
class nsFloatManager;
struct nsStyleText;
class nsLineLayout {
using BlockReflowInput = mozilla::BlockReflowInput;
using ReflowInput = mozilla::ReflowInput;
- using nsHTMLReflowMetrics = mozilla::nsHTMLReflowMetrics;
+ using ReflowOutput = mozilla::ReflowOutput;
public:
/**
* @param aBaseLineLayout the nsLineLayout for ruby base,
* nullptr if no separate base nsLineLayout is needed.
*/
nsLineLayout(nsPresContext* aPresContext,
nsFloatManager* aFloatManager,
@@ -101,20 +101,20 @@ public:
void SplitLineTo(int32_t aNewCount);
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,
+ ReflowOutput* aMetrics,
bool& aPushedFrame);
- void AddBulletFrame(nsIFrame* aFrame, const nsHTMLReflowMetrics& aMetrics);
+ void AddBulletFrame(nsIFrame* aFrame, const ReflowOutput& aMetrics);
void RemoveBulletFrame(nsIFrame* aFrame) {
PushFrame(aFrame);
}
/**
* Place frames in the block direction (CSS property vertical-align)
*/
@@ -670,22 +670,22 @@ protected:
ReflowInput& aReflowState);
void SyncAnnotationBounds(PerFrameData* aRubyFrame);
bool CanPlaceFrame(PerFrameData* pfd,
bool aNotSafeToBreak,
bool aFrameCanContinueTextRun,
bool aCanRollBackBeforeFrame,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
nsReflowStatus& aStatus,
bool* aOptionalBreakAfterFits);
void PlaceFrame(PerFrameData* pfd,
- nsHTMLReflowMetrics& aMetrics);
+ ReflowOutput& aMetrics);
void AdjustLeadings(nsIFrame* spanFrame, PerSpanData* psd,
const nsStyleText* aStyleText, float aInflation,
bool* aZeroEffectiveSpanBox);
void VerticalAlignFrames(PerSpanData* psd);
void PlaceTopBottomFrames(PerSpanData* psd,
--- a/layout/generic/nsPageContentFrame.cpp
+++ b/layout/generic/nsPageContentFrame.cpp
@@ -17,17 +17,17 @@ NS_NewPageContentFrame(nsIPresShell* aPr
{
return new (aPresShell) nsPageContentFrame(aContext);
}
NS_IMPL_FRAMEARENA_HELPERS(nsPageContentFrame)
void
nsPageContentFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsPageContentFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
aStatus = NS_FRAME_COMPLETE; // initialize out parameter
--- a/layout/generic/nsPageContentFrame.h
+++ b/layout/generic/nsPageContentFrame.h
@@ -17,17 +17,17 @@ public:
NS_DECL_FRAMEARENA_HELPERS
friend nsPageContentFrame* NS_NewPageContentFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext);
friend class nsPageFrame;
// nsIFrame
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aMaxSize,
nsReflowStatus& aStatus) override;
virtual bool IsFrameOfType(uint32_t aFlags) const override
{
return ViewportFrame::IsFrameOfType(aFlags &
~(nsIFrame::eCanContainOverflowContainers));
}
--- a/layout/generic/nsPageFrame.cpp
+++ b/layout/generic/nsPageFrame.cpp
@@ -46,17 +46,17 @@ nsPageFrame::nsPageFrame(nsStyleContext*
}
nsPageFrame::~nsPageFrame()
{
}
void
nsPageFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsPageFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
aStatus = NS_FRAME_COMPLETE; // initialize out parameter
@@ -703,17 +703,17 @@ nsPageBreakFrame::GetIntrinsicISize()
nscoord
nsPageBreakFrame::GetIntrinsicBSize()
{
return 0;
}
void
nsPageBreakFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
DO_GLOBAL_REFLOW_COUNT("nsPageBreakFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
// Override reflow, since we don't want to deal with what our
// computed values are.
--- a/layout/generic/nsPageFrame.h
+++ b/layout/generic/nsPageFrame.h
@@ -19,17 +19,17 @@ public:
NS_DECL_QUERYFRAME_TARGET(nsPageFrame)
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
friend nsPageFrame* NS_NewPageFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext);
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aMaxSize,
nsReflowStatus& aStatus) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
/**
@@ -107,17 +107,17 @@ protected:
class nsPageBreakFrame : public nsLeafFrame
{
NS_DECL_FRAMEARENA_HELPERS
explicit nsPageBreakFrame(nsStyleContext* aContext);
~nsPageBreakFrame();
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual nsIAtom* GetType() const override;
#ifdef DEBUG_FRAME_DUMP
virtual nsresult GetFrameName(nsAString& aResult) const override;
#endif
--- a/layout/generic/nsPlaceholderFrame.cpp
+++ b/layout/generic/nsPlaceholderFrame.cpp
@@ -100,17 +100,17 @@ nsPlaceholderFrame::AddInlinePrefISize(n
nsLayoutUtils::PREF_ISIZE);
aData->mFloats.AppendElement(
InlineIntrinsicISizeData::FloatInfo(mOutOfFlowFrame, floatWidth));
}
}
void
nsPlaceholderFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
#ifdef DEBUG
// We should be getting reflowed before our out-of-flow.
// If this is our first reflow, and our out-of-flow has already received its
// first reflow (before us), complain.
// XXXdholbert This "look for a previous continuation or IB-split sibling"
--- a/layout/generic/nsPlaceholderFrame.h
+++ b/layout/generic/nsPlaceholderFrame.h
@@ -94,17 +94,17 @@ public:
InlineMinISizeData* aData) override;
virtual void AddInlinePrefISize(nsRenderingContext* aRenderingContext,
InlinePrefISizeData* aData) override;
virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMaxSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
#if defined(DEBUG) || (defined(MOZ_REFLOW_PERF_DSP) && defined(MOZ_REFLOW_PERF))
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
--- a/layout/generic/nsPluginFrame.cpp
+++ b/layout/generic/nsPluginFrame.cpp
@@ -421,17 +421,17 @@ nsPluginFrame::GetWidgetConfiguration(ns
}
#endif // defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
}
void
nsPluginFrame::GetDesiredSize(nsPresContext* aPresContext,
const ReflowInput& aReflowState,
- nsHTMLReflowMetrics& aMetrics)
+ ReflowOutput& aMetrics)
{
// By default, we have no area
aMetrics.ClearSize();
if (IsHidden(false)) {
return;
}
@@ -485,17 +485,17 @@ nsPluginFrame::GetDesiredSize(nsPresCont
// plugin's size and positioning if we do... Eventually we _do_ want to
// paint borders, though! At that point, we will need to adjust the desired
// size either here or in Reflow.... Further, we will need to fix Paint() to
// call the superclass in all cases.
}
void
nsPluginFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsPluginFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aStatus);
// Get our desired size
--- a/layout/generic/nsPluginFrame.h
+++ b/layout/generic/nsPluginFrame.h
@@ -68,17 +68,17 @@ public:
NS_DECL_QUERYFRAME_TARGET(nsPluginFrame)
virtual void Init(nsIContent* aContent,
nsContainerFrame* aParent,
nsIFrame* aPrevInFlow) override;
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual void DidReflow(nsPresContext* aPresContext,
const ReflowInput* aReflowState,
nsDidReflowStatus aStatus) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
@@ -229,17 +229,17 @@ public:
protected:
explicit nsPluginFrame(nsStyleContext* aContext);
virtual ~nsPluginFrame();
// NOTE: This frame class does not inherit from |nsLeafFrame|, so
// this is not a virtual method implementation.
void GetDesiredSize(nsPresContext* aPresContext,
const ReflowInput& aReflowState,
- nsHTMLReflowMetrics& aDesiredSize);
+ ReflowOutput& aDesiredSize);
bool IsFocusable(int32_t *aTabIndex = nullptr,
bool aWithMouse = false) override;
// check attributes and optionally CSS to see if we should display anything
bool IsHidden(bool aCheckVisibilityStyle = true) const;
bool IsOpaque() const;
--- a/layout/generic/nsRubyBaseContainerFrame.cpp
+++ b/layout/generic/nsRubyBaseContainerFrame.cpp
@@ -294,17 +294,17 @@ struct nsRubyBaseContainerFrame::ReflowS
bool mAllowLineBreak;
const AutoRubyTextContainerArray& mTextContainers;
const ReflowInput& mBaseReflowState;
const nsTArray<UniquePtr<ReflowInput>>& mTextReflowStates;
};
/* virtual */ void
nsRubyBaseContainerFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsRubyBaseContainerFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
aStatus = NS_FRAME_COMPLETE;
--- a/layout/generic/nsRubyBaseContainerFrame.h
+++ b/layout/generic/nsRubyBaseContainerFrame.h
@@ -42,17 +42,17 @@ public:
mozilla::WritingMode aWritingMode,
const mozilla::LogicalSize& aCBSize,
nscoord aAvailableISize,
const mozilla::LogicalSize& aMargin,
const mozilla::LogicalSize& aBorder,
const mozilla::LogicalSize& aPadding,
ComputeSizeFlags aFlags) override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual nscoord
GetLogicalBaseline(mozilla::WritingMode aWritingMode) const override;
#ifdef DEBUG_FRAME_DUMP
virtual nsresult GetFrameName(nsAString& aResult) const override;
--- a/layout/generic/nsRubyFrame.cpp
+++ b/layout/generic/nsRubyFrame.cpp
@@ -86,17 +86,17 @@ nsRubyFrame::AddInlinePrefISize(nsRender
!e.AtEnd(); e.Next()) {
e.GetBaseContainer()->AddInlinePrefISize(aRenderingContext, aData);
}
}
}
/* virtual */ void
nsRubyFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsRubyFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
if (!aReflowState.mLineLayout) {
@@ -176,17 +176,17 @@ nsRubyFrame::ReflowSegment(nsPresContext
aReflowState.AvailableBSize());
WritingMode rubyWM = GetWritingMode();
NS_ASSERTION(!rubyWM.IsOrthogonalTo(lineWM),
"Ruby frame writing-mode shouldn't be orthogonal to its line");
AutoRubyTextContainerArray textContainers(aBaseContainer);
const uint32_t rtcCount = textContainers.Length();
- nsHTMLReflowMetrics baseMetrics(aReflowState);
+ ReflowOutput baseMetrics(aReflowState);
bool pushedFrame;
aReflowState.mLineLayout->ReflowFrame(aBaseContainer, aStatus,
&baseMetrics, pushedFrame);
if (NS_INLINE_IS_BREAK_BEFORE(aStatus)) {
if (aBaseContainer != mFrames.FirstChild()) {
// Some segments may have been reflowed before, hence it is not
// a break-before for the ruby container.
@@ -266,17 +266,17 @@ nsRubyFrame::ReflowSegment(nsPresContext
// XXX We may need to add border/padding here. See bug 1055667.
baseRect.BStart(lineWM) = 0;
// The rect for offsets of text containers.
LogicalRect offsetRect = baseRect;
for (uint32_t i = 0; i < rtcCount; i++) {
nsRubyTextContainerFrame* textContainer = textContainers[i];
WritingMode rtcWM = textContainer->GetWritingMode();
nsReflowStatus textReflowStatus;
- nsHTMLReflowMetrics textMetrics(aReflowState);
+ ReflowOutput textMetrics(aReflowState);
ReflowInput textReflowState(aPresContext, aReflowState, textContainer,
availSize.ConvertTo(rtcWM, lineWM));
// FIXME We probably shouldn't be using the same nsLineLayout for
// the text containers. But it should be fine now as we are
// not actually using this line layout to reflow something,
// but just read the writing mode from it.
textReflowState.mLineLayout = aReflowState.mLineLayout;
textContainer->Reflow(aPresContext, textMetrics,
--- a/layout/generic/nsRubyFrame.h
+++ b/layout/generic/nsRubyFrame.h
@@ -30,17 +30,17 @@ public:
// nsIFrame overrides
virtual nsIAtom* GetType() const override;
virtual bool IsFrameOfType(uint32_t aFlags) const override;
virtual void AddInlineMinISize(nsRenderingContext *aRenderingContext,
InlineMinISizeData *aData) override;
virtual void AddInlinePrefISize(nsRenderingContext *aRenderingContext,
InlinePrefISizeData *aData) override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
#ifdef DEBUG_FRAME_DUMP
virtual nsresult GetFrameName(nsAString& aResult) const override;
#endif
void GetBlockLeadings(nscoord& aStartLeading, nscoord& aEndLeading)
--- a/layout/generic/nsRubyTextContainerFrame.cpp
+++ b/layout/generic/nsRubyTextContainerFrame.cpp
@@ -116,17 +116,17 @@ nsRubyTextContainerFrame::UpdateSpanFlag
AddStateBits(NS_RUBY_TEXT_CONTAINER_IS_SPAN);
} else {
RemoveStateBits(NS_RUBY_TEXT_CONTAINER_IS_SPAN);
}
}
/* virtual */ void
nsRubyTextContainerFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsRubyTextContainerFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
// Although a ruby text container may have continuations, returning
--- a/layout/generic/nsRubyTextContainerFrame.h
+++ b/layout/generic/nsRubyTextContainerFrame.h
@@ -24,17 +24,17 @@ public:
NS_DECL_FRAMEARENA_HELPERS
NS_DECL_QUERYFRAME_TARGET(nsRubyTextContainerFrame)
NS_DECL_QUERYFRAME
// nsIFrame overrides
virtual nsIAtom* GetType() const override;
virtual bool IsFrameOfType(uint32_t aFlags) const override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
#ifdef DEBUG_FRAME_DUMP
virtual nsresult GetFrameName(nsAString& aResult) const override;
#endif
// nsContainerFrame overrides
--- a/layout/generic/nsRubyTextFrame.cpp
+++ b/layout/generic/nsRubyTextFrame.cpp
@@ -70,17 +70,17 @@ nsRubyTextFrame::BuildDisplayList(nsDisp
return;
}
nsRubyContentFrame::BuildDisplayList(aBuilder, aDirtyRect, aLists);
}
/* virtual */ void
nsRubyTextFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
// Even if we want to hide this frame, we have to reflow it first.
// If we leave it dirty, changes to its content will never be
// propagated to the ancestors, then it won't be displayed even if
// the content is no longer the same, until next reflow triggered by
// some other change. In general, we always reflow all the frames we
--- a/layout/generic/nsRubyTextFrame.h
+++ b/layout/generic/nsRubyTextFrame.h
@@ -33,17 +33,17 @@ public:
virtual nsresult GetFrameName(nsAString& aResult) const override;
#endif
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
bool IsAutoHidden() const
{
return GetStateBits() & NS_RUBY_TEXT_FRAME_AUTOHIDE;
}
--- a/layout/generic/nsSimplePageSequenceFrame.cpp
+++ b/layout/generic/nsSimplePageSequenceFrame.cpp
@@ -85,17 +85,17 @@ nsSimplePageSequenceFrame::~nsSimplePage
NS_QUERYFRAME_HEAD(nsSimplePageSequenceFrame)
NS_QUERYFRAME_ENTRY(nsIPageSequenceFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
//----------------------------------------------------------------------
void
-nsSimplePageSequenceFrame::SetDesiredSize(nsHTMLReflowMetrics& aDesiredSize,
+nsSimplePageSequenceFrame::SetDesiredSize(ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nscoord aWidth,
nscoord aHeight)
{
// Aim to fill the whole size of the document, not only so we
// can act as a background in print preview but also handle overflow
// in child page frames correctly.
// Use availableWidth so we don't cause a needless horizontal scrollbar.
@@ -139,17 +139,17 @@ nsSimplePageSequenceFrame::ComputeCenter
// of the extra space. And then, we have to scale that space back down, so
// that it'll produce the correct scaled-up amount when we render (because
// rendering will scale it back up):
return NSToCoordRound(scaledExtraSpace * 0.5 / ppScale);
}
void
nsSimplePageSequenceFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
NS_PRECONDITION(aPresContext->IsRootPaginatedDocument(),
"A Page Sequence is only for real pages");
DO_GLOBAL_REFLOW_COUNT("nsSimplePageSequenceFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
@@ -237,17 +237,17 @@ nsSimplePageSequenceFrame::Reflow(nsPres
// We use the CSS "margin" property on the -moz-page pseudoelement
// to determine the space between each page in print preview.
// Keep a running y-offset for each page.
nscoord y = 0;
nscoord maxXMost = 0;
// Tile the pages vertically
- nsHTMLReflowMetrics kidSize(aReflowState);
+ ReflowOutput kidSize(aReflowState);
for (nsFrameList::Enumerator e(mFrames); !e.AtEnd(); e.Next()) {
nsIFrame* kidFrame = e.get();
// Set the shared data into the page frame before reflow
nsPageFrame * pf = static_cast<nsPageFrame*>(kidFrame);
pf->SetSharedPageData(mPageData);
// Reflow the page
ReflowInput kidReflowState(aPresContext, aReflowState, kidFrame,
--- a/layout/generic/nsSimplePageSequenceFrame.h
+++ b/layout/generic/nsSimplePageSequenceFrame.h
@@ -61,17 +61,17 @@ public:
friend nsSimplePageSequenceFrame* NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext);
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
// nsIFrame
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aMaxSize,
nsReflowStatus& aStatus) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
// nsIPageSequenceFrame
@@ -120,17 +120,17 @@ protected:
void SetPageNumberFormat(const char* aPropName, const char* aDefPropVal, bool aPageNumOnly);
// SharedPageData Helper methods
void SetDateTimeStr(const nsAString& aDateTimeStr);
void SetPageNumberFormat(const nsAString& aFormatStr, bool aForPageNumOnly);
// Sets the frame desired size to the size of the viewport, or the given
// nscoords, whichever is larger. Print scaling is applied in this function.
- void SetDesiredSize(nsHTMLReflowMetrics& aDesiredSize,
+ void SetDesiredSize(ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nscoord aWidth, nscoord aHeight);
// Helper function to compute the offset needed to center a child
// page-frame's margin-box inside our content-box.
nscoord ComputeCenteringMargin(nscoord aContainerContentBoxWidth,
nscoord aChildPaddingBoxWidth,
const nsMargin& aChildPhysicalMargin);
--- a/layout/generic/nsSubDocumentFrame.cpp
+++ b/layout/generic/nsSubDocumentFrame.cpp
@@ -754,17 +754,17 @@ nsSubDocumentFrame::ComputeSize(nsRender
return nsAtomicContainerFrame::ComputeSize(aRenderingContext, aWM,
aCBSize, aAvailableISize,
aMargin, aBorder, aPadding,
aFlags);
}
void
nsSubDocumentFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsSubDocumentFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
("enter nsSubDocumentFrame::Reflow: maxSize=%d,%d",
--- a/layout/generic/nsSubDocumentFrame.h
+++ b/layout/generic/nsSubDocumentFrame.h
@@ -69,17 +69,17 @@ public:
const mozilla::LogicalSize& aCBSize,
nscoord aAvailableISize,
const mozilla::LogicalSize& aMargin,
const mozilla::LogicalSize& aBorder,
const mozilla::LogicalSize& aPadding,
ComputeSizeFlags aFlags) override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual nsresult AttributeChanged(int32_t aNameSpaceID,
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -2816,17 +2816,17 @@ static bool IsJustifiableCharacter(const
return true;
}
}
}
return false;
}
void
-nsTextFrame::ClearMetrics(nsHTMLReflowMetrics& aMetrics)
+nsTextFrame::ClearMetrics(ReflowOutput& aMetrics)
{
aMetrics.ClearSize();
aMetrics.SetBlockStartAscent(0);
mAscent = 0;
AddStateBits(TEXT_NO_RENDERED_GLYPHS);
}
@@ -8644,17 +8644,17 @@ nsTextFrame::IsFloatingFirstLetterChild(
struct NewlineProperty {
int32_t mStartOffset;
// The offset of the first \n after mStartOffset, or -1 if there is none
int32_t mNewlineOffset;
};
void
nsTextFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsTextFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aStatus);
// XXX If there's no line layout, we shouldn't even have created this
@@ -8698,17 +8698,17 @@ private:
nsIContent* mContent;
nsPresContext* mPresContext;
};
#endif
void
nsTextFrame::ReflowText(nsLineLayout& aLineLayout, nscoord aAvailableWidth,
DrawTarget* aDrawTarget,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
nsReflowStatus& aStatus)
{
#ifdef NOISY_REFLOW
ListTag(stdout);
printf(": BeginReflow: availableWidth=%d\n", aAvailableWidth);
#endif
nsPresContext* presContext = PresContext();
--- a/layout/generic/nsTextFrame.h
+++ b/layout/generic/nsTextFrame.h
@@ -242,17 +242,17 @@ public:
const mozilla::LogicalSize& aBorder,
const mozilla::LogicalSize& aPadding,
ComputeSizeFlags aFlags) override;
virtual nsRect ComputeTightBounds(DrawTarget* aDrawTarget) const override;
virtual nsresult GetPrefWidthTightBounds(nsRenderingContext* aContext,
nscoord* aX,
nscoord* aXMost) override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual bool CanContinueTextRun() const 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,
// placeholders or inlines containing such).
struct TrimOutput {
// true if we trimmed some space or changed metrics in some other way.
@@ -574,17 +574,17 @@ public:
int32_t GetEnd() const { return mStart + mLength; }
};
TrimmedOffsets GetTrimmedOffsets(const nsTextFragment* aFrag,
bool aTrimAfter, bool aPostReflow = true);
// Similar to Reflow(), but for use from nsLineLayout
void ReflowText(nsLineLayout& aLineLayout, nscoord aAvailableWidth,
DrawTarget* aDrawTarget,
- nsHTMLReflowMetrics& aMetrics, nsReflowStatus& aStatus);
+ ReflowOutput& aMetrics, nsReflowStatus& aStatus);
bool IsFloatingFirstLetterChild() const;
virtual bool ComputeCustomOverflow(nsOverflowAreas& aOverflowAreas) override;
void AssignJustificationGaps(const mozilla::JustificationAssignment& aAssign);
mozilla::JustificationAssignment GetJustificationAssignment() const;
@@ -801,17 +801,17 @@ protected:
ContentOffsets GetCharacterOffsetAtFramePointInternal(nsPoint aPoint,
bool aForInsertionPoint);
void ClearFrameOffsetCache();
virtual bool HasAnyNoncollapsedCharacters() override;
- void ClearMetrics(nsHTMLReflowMetrics& aMetrics);
+ void ClearMetrics(ReflowOutput& aMetrics);
/**
* UpdateIteratorFromOffset() updates the iterator from a given offset.
* Also, aInOffset may be updated to cluster start if aInOffset isn't
* the offset of cluster start.
*/
void UpdateIteratorFromOffset(const PropertyProvider& aProperties,
int32_t& aInOffset,
--- a/layout/generic/nsVideoFrame.cpp
+++ b/layout/generic/nsVideoFrame.cpp
@@ -277,17 +277,17 @@ public:
false, false);
return NS_OK;
}
nsCOMPtr<nsIContent> mContent;
};
void
nsVideoFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsVideoFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aStatus);
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
("enter nsVideoFrame::Reflow: availSize=%d,%d",
@@ -307,17 +307,17 @@ nsVideoFrame::Reflow(nsPresContext*
aMetrics.Height() += mBorderPadding.top + mBorderPadding.bottom;
// Reflow the child frames. We may have up to two, an image frame
// which is the poster, and a box frame, which is the video controls.
for (nsIFrame* child : mFrames) {
if (child->GetContent() == mPosterImage) {
// Reflow the poster frame.
nsImageFrame* imageFrame = static_cast<nsImageFrame*>(child);
- nsHTMLReflowMetrics kidDesiredSize(aReflowState);
+ ReflowOutput kidDesiredSize(aReflowState);
WritingMode wm = imageFrame->GetWritingMode();
LogicalSize availableSize = aReflowState.AvailableSize(wm);
LogicalSize cbSize = aMetrics.Size(aMetrics.GetWritingMode()).
ConvertTo(wm, aMetrics.GetWritingMode());
ReflowInput kidReflowState(aPresContext,
aReflowState,
imageFrame,
availableSize,
@@ -348,17 +348,17 @@ nsVideoFrame::Reflow(nsPresContext*
aReflowState.ComputedWidth(),
aReflowState.ComputedHeight()));
if (child->GetSize() != size) {
RefPtr<Runnable> event = new DispatchResizeToControls(child->GetContent());
nsContentUtils::AddScriptRunner(event);
}
} else if (child->GetContent() == mCaptionDiv) {
// Reflow to caption div
- nsHTMLReflowMetrics kidDesiredSize(aReflowState);
+ ReflowOutput kidDesiredSize(aReflowState);
WritingMode wm = child->GetWritingMode();
LogicalSize availableSize = aReflowState.AvailableSize(wm);
LogicalSize cbSize = aMetrics.Size(aMetrics.GetWritingMode()).
ConvertTo(wm, aMetrics.GetWritingMode());
ReflowInput kidReflowState(aPresContext,
aReflowState,
child,
availableSize,
--- a/layout/generic/nsVideoFrame.h
+++ b/layout/generic/nsVideoFrame.h
@@ -69,17 +69,17 @@ public:
const mozilla::LogicalSize& aPadding,
ComputeSizeFlags aFlags) override;
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
virtual bool IsLeaf() const override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
#ifdef ACCESSIBILITY
virtual mozilla::a11y::AccType AccessibleType() override;
#endif
virtual nsIAtom* GetType() const override;
--- a/layout/generic/nsViewportFrame.cpp
+++ b/layout/generic/nsViewportFrame.cpp
@@ -263,17 +263,17 @@ ViewportFrame::AdjustReflowStateAsContai
rect.SizeTo(ps->GetScrollPositionClampingScrollPortSize());
}
return rect;
}
void
ViewportFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("ViewportFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
NS_FRAME_TRACE_REFLOW_IN("ViewportFrame::Reflow");
@@ -298,17 +298,17 @@ ViewportFrame::Reflow(nsPresContext*
if (mFrames.NotEmpty()) {
// Deal with a non-incremental reflow or an incremental reflow
// targeted at our one-and-only principal child frame.
if (aReflowState.ShouldReflowAllKids() ||
aReflowState.IsBResize() ||
NS_SUBTREE_DIRTY(mFrames.FirstChild())) {
// Reflow our one-and-only principal child frame
nsIFrame* kidFrame = mFrames.FirstChild();
- nsHTMLReflowMetrics kidDesiredSize(aReflowState);
+ ReflowOutput kidDesiredSize(aReflowState);
WritingMode wm = kidFrame->GetWritingMode();
LogicalSize availableSpace = aReflowState.AvailableSize(wm);
ReflowInput kidReflowState(aPresContext, aReflowState,
kidFrame, availableSpace);
// Reflow the frame
kidReflowState.SetComputedBSize(aReflowState.ComputedBSize());
ReflowChild(kidFrame, aPresContext, kidDesiredSize, kidReflowState,
--- a/layout/generic/nsViewportFrame.h
+++ b/layout/generic/nsViewportFrame.h
@@ -60,17 +60,17 @@ public:
const nsDisplayListSet& aLists) override;
void BuildDisplayListForTopLayer(nsDisplayListBuilder* aBuilder,
nsDisplayList* aList);
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
/**
* Get the "type" of the frame
*
* @see nsGkAtoms::viewportFrame
*/
--- a/layout/mathml/nsIMathMLFrame.h
+++ b/layout/mathml/nsIMathMLFrame.h
@@ -9,17 +9,17 @@
#include "nsQueryFrame.h"
#include "nsMathMLOperators.h"
struct nsPresentationData;
struct nsEmbellishData;
class nsRenderingContext;
class nsIFrame;
namespace mozilla {
-class nsHTMLReflowMetrics;
+class ReflowOutput;
} // namespace mozilla
// For MathML, this 'type' will be used to determine the spacing between frames
// Subclasses can return a 'type' that will give them a particular spacing
enum eMathMLFrameType {
eMathMLFrameType_UNKNOWN = -1,
eMathMLFrameType_Ordinary,
eMathMLFrameType_OperatorOrdinary,
@@ -81,17 +81,17 @@ public:
* relevant to the direction are used (the rest is ignored).
* @param aDesiredStretchSize [in/out] On input the current size
* of the frame, on output the size after stretching.
*/
NS_IMETHOD
Stretch(mozilla::gfx::DrawTarget* aDrawTarget,
nsStretchDirection aStretchDirection,
nsBoundingMetrics& aContainerSize,
- mozilla::nsHTMLReflowMetrics& aDesiredStretchSize) = 0;
+ mozilla::ReflowOutput& aDesiredStretchSize) = 0;
/* Get the mEmbellishData member variable. */
NS_IMETHOD
GetEmbellishData(nsEmbellishData& aEmbellishData) = 0;
/* SUPPORT FOR SCRIPTING ELEMENTS */
--- a/layout/mathml/nsMathMLContainerFrame.cpp
+++ b/layout/mathml/nsMathMLContainerFrame.cpp
@@ -35,17 +35,17 @@ NS_QUERYFRAME_HEAD(nsMathMLContainerFram
NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
// =============================================================================
// error handlers
// provide a feedback to the user when a frame with bad markup can not be rendered
nsresult
nsMathMLContainerFrame::ReflowError(DrawTarget* aDrawTarget,
- nsHTMLReflowMetrics& aDesiredSize)
+ ReflowOutput& aDesiredSize)
{
// clear all other flags and record that there is an error with this frame
mEmbellishData.flags = 0;
mPresentationData.flags = NS_MATHML_ERROR;
///////////////
// Set font
RefPtr<nsFontMetrics> fm =
@@ -120,38 +120,38 @@ IsForeignChild(const nsIFrame* aFrame)
{
// This counts nsMathMLmathBlockFrame as a foreign child, because it
// uses block reflow
return !(aFrame->IsFrameOfType(nsIFrame::eMathML)) ||
aFrame->GetType() == nsGkAtoms::blockFrame;
}
NS_DECLARE_FRAME_PROPERTY_DELETABLE(HTMLReflowMetricsProperty,
- nsHTMLReflowMetrics)
+ ReflowOutput)
/* static */ void
nsMathMLContainerFrame::SaveReflowAndBoundingMetricsFor(nsIFrame* aFrame,
- const nsHTMLReflowMetrics& aReflowMetrics,
+ const ReflowOutput& aReflowMetrics,
const nsBoundingMetrics& aBoundingMetrics)
{
- nsHTMLReflowMetrics *metrics = new nsHTMLReflowMetrics(aReflowMetrics);
+ ReflowOutput *metrics = new ReflowOutput(aReflowMetrics);
metrics->mBoundingMetrics = aBoundingMetrics;
aFrame->Properties().Set(HTMLReflowMetricsProperty(), metrics);
}
// helper method to facilitate getting the reflow and bounding metrics
/* static */ void
nsMathMLContainerFrame::GetReflowAndBoundingMetricsFor(nsIFrame* aFrame,
- nsHTMLReflowMetrics& aReflowMetrics,
+ ReflowOutput& aReflowMetrics,
nsBoundingMetrics& aBoundingMetrics,
eMathMLFrameType* aMathMLFrameType)
{
NS_PRECONDITION(aFrame, "null arg");
- nsHTMLReflowMetrics* metrics =
+ ReflowOutput* metrics =
aFrame->Properties().Get(HTMLReflowMetricsProperty());
// IMPORTANT: This function is only meant to be called in Place() methods
// where it is assumed that SaveReflowAndBoundingMetricsFor has recorded the
// information.
NS_ASSERTION(metrics, "Didn't SaveReflowAndBoundingMetricsFor frame!");
if (metrics) {
aReflowMetrics = *metrics;
@@ -191,17 +191,17 @@ nsMathMLContainerFrame::GetPreferredStre
nsBoundingMetrics& aPreferredStretchSize)
{
if (aOptions & STRETCH_CONSIDER_ACTUAL_SIZE) {
// when our actual size is ok, just use it
aPreferredStretchSize = mBoundingMetrics;
}
else if (aOptions & STRETCH_CONSIDER_EMBELLISHMENTS) {
// compute our up-to-date size using Place()
- nsHTMLReflowMetrics metrics(GetWritingMode()); // ???
+ ReflowOutput metrics(GetWritingMode()); // ???
Place(aDrawTarget, false, metrics);
aPreferredStretchSize = metrics.mBoundingMetrics;
}
else {
// compute a size that includes embellishments iff the container stretches
// in the same direction as the embellished operator.
bool stretchAll = aStretchDirection == NS_STRETCH_DIRECTION_VERTICAL ?
NS_MATHML_WILL_STRETCH_ALL_CHILDREN_VERTICALLY(mPresentationData.flags) :
@@ -233,17 +233,17 @@ nsMathMLContainerFrame::GetPreferredStre
nsIMathMLFrame* mathMLchildFrame = do_QueryFrame(presentationData.baseFrame);
if (mathMLchildFrame) {
mathMLFrame = mathMLchildFrame;
}
}
mathMLFrame->GetBoundingMetrics(bmChild);
}
else {
- nsHTMLReflowMetrics unused(GetWritingMode());
+ ReflowOutput unused(GetWritingMode());
GetReflowAndBoundingMetricsFor(childFrame, unused, bmChild);
}
if (firstTime) {
firstTime = false;
bm = bmChild;
if (!stretchAll) {
// we may get here for cases such as <msup><mo>...</mo> ... </msup>,
@@ -284,17 +284,17 @@ nsMathMLContainerFrame::GetPreferredStre
aPreferredStretchSize = bm;
}
}
NS_IMETHODIMP
nsMathMLContainerFrame::Stretch(DrawTarget* aDrawTarget,
nsStretchDirection aStretchDirection,
nsBoundingMetrics& aContainerSize,
- nsHTMLReflowMetrics& aDesiredStretchSize)
+ ReflowOutput& aDesiredStretchSize)
{
if (NS_MATHML_IS_EMBELLISH_OPERATOR(mEmbellishData.flags)) {
if (NS_MATHML_STRETCH_WAS_DONE(mPresentationData.flags)) {
NS_WARNING("it is wrong to fire stretch more than once on a frame");
return NS_OK;
}
mPresentationData.flags |= NS_MATHML_STRETCH_DONE;
@@ -309,17 +309,17 @@ nsMathMLContainerFrame::Stretch(DrawTarg
nsIFrame* baseFrame = mPresentationData.baseFrame;
if (baseFrame) {
nsIMathMLFrame* mathMLFrame = do_QueryFrame(baseFrame);
NS_ASSERTION(mathMLFrame, "Something is wrong somewhere");
if (mathMLFrame) {
// And the trick is that the child's rect.x is still holding the descent,
// and rect.y is still holding the ascent ...
- nsHTMLReflowMetrics childSize(aDesiredStretchSize);
+ ReflowOutput childSize(aDesiredStretchSize);
GetReflowAndBoundingMetricsFor(baseFrame, childSize, childSize.mBoundingMetrics);
// See if we should downsize and confine the stretch to us...
// XXX there may be other cases where we can downsize the stretch,
// e.g., the first ∑ might appear big in the following situation
// <math xmlns='http://www.w3.org/1998/Math/MathML'>
// <mstyle>
// <msub>
@@ -438,17 +438,17 @@ nsMathMLContainerFrame::Stretch(DrawTarg
}
}
}
return NS_OK;
}
nsresult
nsMathMLContainerFrame::FinalizeReflow(DrawTarget* aDrawTarget,
- nsHTMLReflowMetrics& aDesiredSize)
+ ReflowOutput& aDesiredSize)
{
// During reflow, we use rect.x and rect.y as placeholders for the child's ascent
// and descent in expectation of a stretch command. Hence we need to ensure that
// a stretch command will actually be fired later on, after exiting from our
// reflow. If the stretch is not fired, the rect.x, and rect.y will remain
// with inappropriate data causing children to be improperly positioned.
// This helper method checks to see if our parent will fire a stretch command
// targeted at us. If not, we go ahead and fire an involutive stretch on
@@ -776,17 +776,17 @@ nsMathMLContainerFrame::AttributeChanged
// XXXldb This should only do work for attributes that cause changes!
PresContext()->PresShell()->
FrameNeedsReflow(this, nsIPresShell::eStyleChange, NS_FRAME_IS_DIRTY);
return NS_OK;
}
void
-nsMathMLContainerFrame::GatherAndStoreOverflow(nsHTMLReflowMetrics* aMetrics)
+nsMathMLContainerFrame::GatherAndStoreOverflow(ReflowOutput* aMetrics)
{
mBlockStartAscent = aMetrics->BlockStartAscent();
// nsIFrame::FinishAndStoreOverflow likes the overflow area to include the
// frame rectangle.
aMetrics->SetOverflowAreasToDesiredBounds();
ComputeCustomOverflow(aMetrics->mOverflowAreas);
@@ -814,17 +814,17 @@ nsMathMLContainerFrame::ComputeCustomOve
// and not scrollable?
aOverflowAreas.UnionAllWith(boundingBox);
return nsContainerFrame::ComputeCustomOverflow(aOverflowAreas);
}
void
nsMathMLContainerFrame::ReflowChild(nsIFrame* aChildFrame,
nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
// Having foreign/hybrid children, e.g., from html markups, is not defined by
// the MathML spec. But it can happen in practice, e.g., <html:img> allows us
// to do some cool demos... or we may have a child that is an nsInlineFrame
// from a generated content such as :before { content: open-quote } or
// :after { content: close-quote }. Unfortunately, the other frames out-there
@@ -837,17 +837,17 @@ nsMathMLContainerFrame::ReflowChild(nsIF
nsInlineFrame* inlineFrame = do_QueryFrame(aChildFrame);
NS_ASSERTION(!inlineFrame, "Inline frames should be wrapped in blocks");
#endif
nsContainerFrame::
ReflowChild(aChildFrame, aPresContext, aDesiredSize, aReflowState,
0, 0, NS_FRAME_NO_MOVE_FRAME, aStatus);
- if (aDesiredSize.BlockStartAscent() == nsHTMLReflowMetrics::ASK_FOR_BASELINE) {
+ if (aDesiredSize.BlockStartAscent() == ReflowOutput::ASK_FOR_BASELINE) {
// This will be suitable for inline frames, which are wrapped in a block.
nscoord ascent;
WritingMode wm = aDesiredSize.GetWritingMode();
if (!nsLayoutUtils::GetLastLineBaseline(wm, aChildFrame, &ascent)) {
// We don't expect any other block children so just place the frame on
// the baseline instead of going through DidReflow() and
// GetBaseline(). This is what nsFrame::GetBaseline() will do anyway.
aDesiredSize.SetBlockStartAscent(aDesiredSize.BSize(wm));
@@ -863,34 +863,34 @@ nsMathMLContainerFrame::ReflowChild(nsIF
aDesiredSize.mBoundingMetrics.ascent = aDesiredSize.BlockStartAscent() - r.y;
aDesiredSize.mBoundingMetrics.descent = r.YMost() - aDesiredSize.BlockStartAscent();
aDesiredSize.mBoundingMetrics.width = aDesiredSize.Width();
}
}
void
nsMathMLContainerFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
mPresentationData.flags &= ~NS_MATHML_ERROR;
aDesiredSize.Width() = aDesiredSize.Height() = 0;
aDesiredSize.SetBlockStartAscent(0);
aDesiredSize.mBoundingMetrics = nsBoundingMetrics();
/////////////
// Reflow children
// Asking each child to cache its bounding metrics
nsReflowStatus childStatus;
nsIFrame* childFrame = mFrames.FirstChild();
while (childFrame) {
- nsHTMLReflowMetrics childDesiredSize(aReflowState, // ???
+ ReflowOutput childDesiredSize(aReflowState, // ???
aDesiredSize.mFlags);
WritingMode wm = childFrame->GetWritingMode();
LogicalSize availSize = aReflowState.ComputedSize(wm);
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
ReflowInput childReflowState(aPresContext, aReflowState,
childFrame, availSize);
ReflowChild(childFrame, aPresContext, childDesiredSize,
childReflowState, childStatus);
@@ -927,17 +927,17 @@ nsMathMLContainerFrame::Reflow(nsPresCon
GetPreferredStretchSize(drawTarget, 0, stretchDir, containerSize);
// fire the stretch on each child
childFrame = mFrames.FirstChild();
while (childFrame) {
nsIMathMLFrame* mathMLFrame = do_QueryFrame(childFrame);
if (mathMLFrame) {
// retrieve the metrics that was stored at the previous pass
- nsHTMLReflowMetrics childDesiredSize(aReflowState);
+ ReflowOutput childDesiredSize(aReflowState);
GetReflowAndBoundingMetricsFor(childFrame,
childDesiredSize, childDesiredSize.mBoundingMetrics);
mathMLFrame->Stretch(drawTarget, stretchDir,
containerSize, childDesiredSize);
// store the updated metrics
SaveReflowAndBoundingMetricsFor(childFrame, childDesiredSize,
childDesiredSize.mBoundingMetrics);
@@ -949,31 +949,31 @@ nsMathMLContainerFrame::Reflow(nsPresCon
/////////////
// Place children now by re-adjusting the origins to align the baselines
FinalizeReflow(drawTarget, aDesiredSize);
aStatus = NS_FRAME_COMPLETE;
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
}
-static nscoord AddInterFrameSpacingToSize(nsHTMLReflowMetrics& aDesiredSize,
+static nscoord AddInterFrameSpacingToSize(ReflowOutput& aDesiredSize,
nsMathMLContainerFrame* aFrame);
/* virtual */ void
nsMathMLContainerFrame::MarkIntrinsicISizesDirty()
{
mIntrinsicWidth = NS_INTRINSIC_WIDTH_UNKNOWN;
nsContainerFrame::MarkIntrinsicISizesDirty();
}
void
nsMathMLContainerFrame::UpdateIntrinsicWidth(nsRenderingContext* aRenderingContext)
{
if (mIntrinsicWidth == NS_INTRINSIC_WIDTH_UNKNOWN) {
- nsHTMLReflowMetrics desiredSize(GetWritingMode());
+ ReflowOutput desiredSize(GetWritingMode());
GetIntrinsicISizeMetrics(aRenderingContext, desiredSize);
// Include the additional width added by FixInterFrameSpacing to ensure
// consistent width calculations.
AddInterFrameSpacingToSize(desiredSize, this);
mIntrinsicWidth = desiredSize.ISize(GetWritingMode());
}
}
@@ -995,22 +995,22 @@ nsMathMLContainerFrame::GetPrefISize(nsR
DISPLAY_PREF_WIDTH(this, result);
UpdateIntrinsicWidth(aRenderingContext);
result = mIntrinsicWidth;
return result;
}
/* virtual */ void
nsMathMLContainerFrame::GetIntrinsicISizeMetrics(nsRenderingContext* aRenderingContext,
- nsHTMLReflowMetrics& aDesiredSize)
+ ReflowOutput& aDesiredSize)
{
// Get child widths
nsIFrame* childFrame = mFrames.FirstChild();
while (childFrame) {
- nsHTMLReflowMetrics childDesiredSize(GetWritingMode()); // ???
+ ReflowOutput childDesiredSize(GetWritingMode()); // ???
nsMathMLContainerFrame* containerFrame = do_QueryFrame(childFrame);
if (containerFrame) {
containerFrame->GetIntrinsicISizeMetrics(aRenderingContext,
childDesiredSize);
} else {
// XXX This includes margin while Reflow currently doesn't consider
// margin, so we may end up with too much space, but, with stretchy
@@ -1044,17 +1044,17 @@ nsMathMLContainerFrame::GetIntrinsicISiz
ReflowError(aRenderingContext->GetDrawTarget(), aDesiredSize);
}
ClearSavedChildMetrics();
}
/* virtual */ nsresult
nsMathMLContainerFrame::MeasureForWidth(DrawTarget* aDrawTarget,
- nsHTMLReflowMetrics& aDesiredSize)
+ ReflowOutput& aDesiredSize)
{
return Place(aDrawTarget, false, aDesiredSize);
}
// see spacing table in Chapter 18, TeXBook (p.170)
// Our table isn't quite identical to TeX because operators have
// built-in values for lspace & rspace in the Operator Dictionary.
@@ -1212,27 +1212,27 @@ public:
prevFrameType, mChildFrameType,
&mFromFrameType, &mCarrySpace);
mX += space * GetThinSpace(font);
return *this;
}
nsIFrame* Frame() const { return mChildFrame; }
nscoord X() const { return mX; }
- const nsHTMLReflowMetrics& ReflowMetrics() const { return mSize; }
+ const ReflowOutput& ReflowMetrics() const { return mSize; }
nscoord Ascent() const { return mSize.BlockStartAscent(); }
nscoord Descent() const { return mSize.Height() - mSize.BlockStartAscent(); }
const nsBoundingMetrics& BoundingMetrics() const {
return mSize.mBoundingMetrics;
}
private:
const nsMathMLContainerFrame* mParentFrame;
nsIFrame* mChildFrame;
- nsHTMLReflowMetrics mSize;
+ ReflowOutput mSize;
nscoord mX;
nscoord mItalicCorrection;
eMathMLFrameType mChildFrameType;
int32_t mCarrySpace;
eMathMLFrameType mFromFrameType;
bool mRTL;
@@ -1259,17 +1259,17 @@ private:
mX += leftCorrection;
mItalicCorrection = rightCorrection;
}
};
/* virtual */ nsresult
nsMathMLContainerFrame::Place(DrawTarget* aDrawTarget,
bool aPlaceOrigin,
- nsHTMLReflowMetrics& aDesiredSize)
+ ReflowOutput& aDesiredSize)
{
// This is needed in case this frame is empty (i.e., no child frames)
mBoundingMetrics = nsBoundingMetrics();
RowChildFrameIterator child(this);
nscoord ascent = 0, descent = 0;
while (child.Frame()) {
if (descent < child.Descent())
@@ -1383,17 +1383,17 @@ GetInterFrameSpacingFor(int32_t
childFrame = childFrame->GetNextSibling();
}
NS_NOTREACHED("child not in the childlist of its parent");
return 0;
}
static nscoord
-AddInterFrameSpacingToSize(nsHTMLReflowMetrics& aDesiredSize,
+AddInterFrameSpacingToSize(ReflowOutput& aDesiredSize,
nsMathMLContainerFrame* aFrame)
{
nscoord gap = 0;
nsIFrame* parent = aFrame->GetParent();
nsIContent* parentContent = parent->GetContent();
if (MOZ_UNLIKELY(!parentContent)) {
return 0;
}
@@ -1414,17 +1414,17 @@ AddInterFrameSpacingToSize(nsHTMLReflowM
}
aDesiredSize.mBoundingMetrics.width += italicCorrection;
aDesiredSize.Width() += italicCorrection;
}
return gap;
}
nscoord
-nsMathMLContainerFrame::FixInterFrameSpacing(nsHTMLReflowMetrics& aDesiredSize)
+nsMathMLContainerFrame::FixInterFrameSpacing(ReflowOutput& aDesiredSize)
{
nscoord gap = 0;
gap = AddInterFrameSpacingToSize(aDesiredSize, this);
if (gap) {
// Shift our children to account for the correction
nsIFrame* childFrame = mFrames.FirstChild();
while (childFrame) {
childFrame->SetPosition(childFrame->GetPosition() + nsPoint(gap, 0));
--- a/layout/mathml/nsMathMLContainerFrame.h
+++ b/layout/mathml/nsMathMLContainerFrame.h
@@ -43,17 +43,17 @@ public:
// --------------------------------------------------------------------------
// Overloaded nsMathMLFrame methods -- see documentation in nsIMathMLFrame.h
NS_IMETHOD
Stretch(DrawTarget* aDrawTarget,
nsStretchDirection aStretchDirection,
nsBoundingMetrics& aContainerSize,
- nsHTMLReflowMetrics& aDesiredStretchSize) override;
+ ReflowOutput& aDesiredStretchSize) override;
NS_IMETHOD
UpdatePresentationDataFromChildAt(int32_t aFirstIndex,
int32_t aLastIndex,
uint32_t aFlagsValues,
uint32_t aFlagsToUpdate) override
{
PropagatePresentationDataFromChildAt(this, aFirstIndex, aLastIndex,
@@ -103,21 +103,21 @@ public:
virtual nscoord GetMinISize(nsRenderingContext* aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext* aRenderingContext) override;
/**
* Return the intrinsic horizontal metrics of the frame's content area.
*/
virtual void
GetIntrinsicISizeMetrics(nsRenderingContext* aRenderingContext,
- nsHTMLReflowMetrics& aDesiredSize);
+ ReflowOutput& aDesiredSize);
virtual void
Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual void DidReflow(nsPresContext* aPresContext,
const ReflowInput* aReflowState,
nsDidReflowStatus aStatus) override
{
@@ -194,29 +194,29 @@ protected:
* size and your ascent/descent info. Compute your desired size using
* the information from GetReflowAndBoundingMetricsFor, and include
* any space you want for border/padding in the desired size you
* return.
*/
virtual nsresult
Place(DrawTarget* aDrawTarget,
bool aPlaceOrigin,
- nsHTMLReflowMetrics& aDesiredSize);
+ ReflowOutput& aDesiredSize);
// MeasureForWidth:
//
// A method used by nsMathMLContainerFrame::GetIntrinsicISize to get the
// width that a particular Place method desires. For most frames, this will
// just call the object's Place method. However <msqrt> and <menclose> use
// nsMathMLContainerFrame::GetIntrinsicISize to measure the child frames as
// if in an <mrow>, and so their frames implement MeasureForWidth to use
// nsMathMLContainerFrame::Place.
virtual nsresult
MeasureForWidth(DrawTarget* aDrawTarget,
- nsHTMLReflowMetrics& aDesiredSize);
+ ReflowOutput& aDesiredSize);
// helper to re-sync the automatic data in our children and notify our parent to
// reflow us when changes (e.g., append/insert/remove) happen in our child list
virtual nsresult
ChildListChanged(int32_t aModType);
// helper to get the preferred size that a container frame should use to fire
@@ -231,17 +231,17 @@ protected:
// of TransmitAutomaticData() to determine whether they are space-like.
nsresult
TransmitAutomaticDataForMrowLikeElement();
public:
// error handlers to provide a visual feedback to the user when an error
// (typically invalid markup) was encountered during reflow.
nsresult
- ReflowError(DrawTarget* aDrawTarget, nsHTMLReflowMetrics& aDesiredSize);
+ ReflowError(DrawTarget* aDrawTarget, ReflowOutput& aDesiredSize);
/*
* Helper to call ReportErrorToConsole for parse errors involving
* attribute/value pairs.
* @param aAttribute The attribute for which the parse error occured.
* @param aValue The value for which the parse error occured.
*/
nsresult
ReportParseError(const char16_t* aAttribute,
@@ -272,52 +272,52 @@ public:
uint32_t aParamCount = 0);
// 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
ReflowChild(nsIFrame* aKidFrame,
nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus);
protected:
// helper to add the inter-spacing when <math> is the immediate parent.
// Since we don't (yet) handle the root <math> element ourselves, we need to
// take special care of the inter-frame spacing on elements for which <math>
// is the direct xml parent. This function will be repeatedly called from
// left to right on the childframes of <math>, and by so doing it will
// emulate the spacing that would have been done by a <mrow> container.
// e.g., it fixes <math> <mi>f</mi> <mo>q</mo> <mi>f</mi> <mo>I</mo> </math>
virtual nscoord
- FixInterFrameSpacing(nsHTMLReflowMetrics& aDesiredSize);
+ FixInterFrameSpacing(ReflowOutput& aDesiredSize);
// helper method to complete the post-reflow hook and ensure that embellished
// operators don't terminate their Reflow without receiving a Stretch command.
virtual nsresult
- FinalizeReflow(DrawTarget* aDrawTarget, nsHTMLReflowMetrics& aDesiredSize);
+ FinalizeReflow(DrawTarget* aDrawTarget, ReflowOutput& aDesiredSize);
// Record metrics of a child frame for recovery through the following method
static void
SaveReflowAndBoundingMetricsFor(nsIFrame* aFrame,
- const nsHTMLReflowMetrics& aReflowMetrics,
+ const ReflowOutput& aReflowMetrics,
const nsBoundingMetrics& aBoundingMetrics);
// helper method to facilitate getting the reflow and bounding metrics of a
// child frame. The argument aMathMLFrameType, when non null, will return
// the 'type' of the frame, which is used to determine the inter-frame
// spacing.
// IMPORTANT: This function is only meant to be called in Place() methods as
// the information is available only when set up with the above method
// during Reflow/Stretch() and GetPrefISize().
static void
GetReflowAndBoundingMetricsFor(nsIFrame* aFrame,
- nsHTMLReflowMetrics& aReflowMetrics,
+ ReflowOutput& aReflowMetrics,
nsBoundingMetrics& aBoundingMetrics,
eMathMLFrameType* aMathMLFrameType = nullptr);
// helper method to clear metrics saved with
// SaveReflowAndBoundingMetricsFor() from all child frames.
void ClearSavedChildMetrics();
// helper to let the update of presentation data pass through
@@ -373,17 +373,17 @@ protected:
// y = aBaseline starting from x = aOffsetX, calling FinishReflowChild()
// on the frames.
void
PositionRowChildFrames(nscoord aOffsetX, nscoord aBaseline);
// A variant on FinishAndStoreOverflow() that uses the union of child
// overflows, the frame bounds, and mBoundingMetrics to set and store the
// overflow.
- void GatherAndStoreOverflow(nsHTMLReflowMetrics* aMetrics);
+ void GatherAndStoreOverflow(ReflowOutput* aMetrics);
/**
* Call DidReflow() if the NS_FRAME_IN_REFLOW frame bit is set on aFirst and
* all its next siblings up to, but not including, aStop.
* aStop == nullptr meaning all next siblings with the bit set.
* The method does nothing if aFirst == nullptr.
*/
static void DidReflowChildren(nsIFrame* aFirst, nsIFrame* aStop = nullptr);
--- a/layout/mathml/nsMathMLFrame.h
+++ b/layout/mathml/nsMathMLFrame.h
@@ -47,17 +47,17 @@ public:
}
virtual eMathMLFrameType GetMathMLFrameType() override;
NS_IMETHOD
Stretch(mozilla::gfx::DrawTarget* aDrawTarget,
nsStretchDirection aStretchDirection,
nsBoundingMetrics& aContainerSize,
- mozilla::nsHTMLReflowMetrics& aDesiredStretchSize) override
+ mozilla::ReflowOutput& aDesiredStretchSize) override
{
return NS_OK;
}
NS_IMETHOD
GetEmbellishData(nsEmbellishData& aEmbellishData) override {
aEmbellishData = mEmbellishData;
return NS_OK;
--- a/layout/mathml/nsMathMLSelectedFrame.cpp
+++ b/layout/mathml/nsMathMLSelectedFrame.cpp
@@ -129,17 +129,17 @@ nsMathMLSelectedFrame::ComputeSize(nsRen
return size + offsetState.ComputedLogicalBorderPadding().Size(aWM);
}
return LogicalSize(aWM);
}
// Only reflow the selected child ...
void
nsMathMLSelectedFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
mPresentationData.flags &= ~NS_MATHML_ERROR;
aStatus = NS_FRAME_COMPLETE;
aDesiredSize.ClearSize();
aDesiredSize.SetBlockStartAscent(0);
@@ -160,17 +160,17 @@ nsMathMLSelectedFrame::Reflow(nsPresCont
FinalizeReflow(aReflowState.rendContext->GetDrawTarget(), aDesiredSize);
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
}
// Only place the selected child ...
/* virtual */ nsresult
nsMathMLSelectedFrame::Place(DrawTarget* aDrawTarget,
bool aPlaceOrigin,
- nsHTMLReflowMetrics& aDesiredSize)
+ ReflowOutput& aDesiredSize)
{
nsIFrame* childFrame = GetSelectedFrame();
if (mInvalidMarkup) {
return ReflowError(aDrawTarget, aDesiredSize);
}
aDesiredSize.ClearSize();
--- a/layout/mathml/nsMathMLSelectedFrame.h
+++ b/layout/mathml/nsMathMLSelectedFrame.h
@@ -27,31 +27,31 @@ public:
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual nsresult
Place(DrawTarget* aDrawTarget,
bool aPlaceOrigin,
- nsHTMLReflowMetrics& aDesiredSize) override;
+ ReflowOutput& aDesiredSize) override;
virtual mozilla::LogicalSize
ComputeSize(nsRenderingContext *aRenderingContext,
mozilla::WritingMode aWritingMode,
const mozilla::LogicalSize& aCBSize,
nscoord aAvailableISize,
const mozilla::LogicalSize& aMargin,
const mozilla::LogicalSize& aBorder,
const mozilla::LogicalSize& aPadding,
ComputeSizeFlags aFlags) override;
virtual void
Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual nsQueryFrame::FrameIID GetFrameId() override = 0;
protected:
explicit nsMathMLSelectedFrame(nsStyleContext* aContext) :
nsMathMLContainerFrame(aContext) {}
--- a/layout/mathml/nsMathMLTokenFrame.cpp
+++ b/layout/mathml/nsMathMLTokenFrame.cpp
@@ -115,31 +115,31 @@ nsMathMLTokenFrame::InsertFrames(ChildLi
nsFrameList& aChildList)
{
nsMathMLContainerFrame::InsertFrames(aListID, aPrevFrame, aChildList);
MarkTextFramesAsTokenMathML();
}
void
nsMathMLTokenFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
mPresentationData.flags &= ~NS_MATHML_ERROR;
// initializations needed for empty markup like <mtag></mtag>
aDesiredSize.ClearSize();
aDesiredSize.SetBlockStartAscent(0);
aDesiredSize.mBoundingMetrics = nsBoundingMetrics();
for (nsIFrame* childFrame : PrincipalChildList()) {
// ask our children to compute their bounding metrics
- nsHTMLReflowMetrics childDesiredSize(aReflowState.GetWritingMode(),
+ ReflowOutput childDesiredSize(aReflowState.GetWritingMode(),
aDesiredSize.mFlags
| NS_REFLOW_CALC_BOUNDING_METRICS);
WritingMode wm = childFrame->GetWritingMode();
LogicalSize availSize = aReflowState.ComputedSize(wm);
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
ReflowInput childReflowState(aPresContext, aReflowState,
childFrame, availSize);
ReflowChild(childFrame, aPresContext, childDesiredSize,
@@ -157,21 +157,21 @@ nsMathMLTokenFrame::Reflow(nsPresContext
}
// For token elements, mBoundingMetrics is computed at the ReflowToken
// pass, it is not computed here because our children may be text frames
// that do not implement the GetBoundingMetrics() interface.
/* virtual */ nsresult
nsMathMLTokenFrame::Place(DrawTarget* aDrawTarget,
bool aPlaceOrigin,
- nsHTMLReflowMetrics& aDesiredSize)
+ ReflowOutput& aDesiredSize)
{
mBoundingMetrics = nsBoundingMetrics();
for (nsIFrame* childFrame :PrincipalChildList()) {
- nsHTMLReflowMetrics childSize(aDesiredSize.GetWritingMode());
+ ReflowOutput childSize(aDesiredSize.GetWritingMode());
GetReflowAndBoundingMetricsFor(childFrame, childSize,
childSize.mBoundingMetrics, nullptr);
// compute and cache the bounding metrics
mBoundingMetrics += childSize.mBoundingMetrics;
}
RefPtr<nsFontMetrics> fm =
nsLayoutUtils::GetInflatedFontMetricsForFrame(this);
@@ -182,17 +182,17 @@ nsMathMLTokenFrame::Place(DrawTarget*
aDesiredSize.Width() = mBoundingMetrics.width;
aDesiredSize.SetBlockStartAscent(std::max(mBoundingMetrics.ascent, ascent));
aDesiredSize.Height() = aDesiredSize.BlockStartAscent() +
std::max(mBoundingMetrics.descent, descent);
if (aPlaceOrigin) {
nscoord dy, dx = 0;
for (nsIFrame* childFrame : PrincipalChildList()) {
- nsHTMLReflowMetrics childSize(aDesiredSize.GetWritingMode());
+ ReflowOutput childSize(aDesiredSize.GetWritingMode());
GetReflowAndBoundingMetricsFor(childFrame, childSize,
childSize.mBoundingMetrics);
// place and size the child; (dx,0) makes the caret happy - bug 188146
dy = childSize.Height() == 0 ? 0 : aDesiredSize.BlockStartAscent() - childSize.BlockStartAscent();
FinishReflowChild(childFrame, PresContext(), childSize, nullptr, dx, dy, 0);
dx += childSize.Width();
}
--- a/layout/mathml/nsMathMLTokenFrame.h
+++ b/layout/mathml/nsMathMLTokenFrame.h
@@ -44,24 +44,24 @@ public:
virtual void
InsertFrames(ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aChildList) override;
virtual void
Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual nsresult
Place(DrawTarget* aDrawTarget,
bool aPlaceOrigin,
- nsHTMLReflowMetrics& aDesiredSize) override;
+ ReflowOutput& aDesiredSize) override;
protected:
explicit nsMathMLTokenFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
virtual ~nsMathMLTokenFrame();
void MarkTextFramesAsTokenMathML();
};
--- a/layout/mathml/nsMathMLmencloseFrame.cpp
+++ b/layout/mathml/nsMathMLmencloseFrame.cpp
@@ -295,39 +295,39 @@ nsMathMLmencloseFrame::BuildDisplayList(
nsRect rect(mencloseRect.width / 2 - mRuleThickness / 2, 0,
mRuleThickness, mencloseRect.height);
DisplayBar(aBuilder, this, rect, aLists);
}
}
/* virtual */ nsresult
nsMathMLmencloseFrame::MeasureForWidth(DrawTarget* aDrawTarget,
- nsHTMLReflowMetrics& aDesiredSize)
+ ReflowOutput& aDesiredSize)
{
return PlaceInternal(aDrawTarget, false, aDesiredSize, true);
}
/* virtual */ nsresult
nsMathMLmencloseFrame::Place(DrawTarget* aDrawTarget,
bool aPlaceOrigin,
- nsHTMLReflowMetrics& aDesiredSize)
+ ReflowOutput& aDesiredSize)
{
return PlaceInternal(aDrawTarget, aPlaceOrigin, aDesiredSize, false);
}
/* virtual */ nsresult
nsMathMLmencloseFrame::PlaceInternal(DrawTarget* aDrawTarget,
bool aPlaceOrigin,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
bool aWidthOnly)
{
///////////////
// Measure the size of our content using the base class to format like an
// inferred mrow.
- nsHTMLReflowMetrics baseSize(aDesiredSize.GetWritingMode());
+ ReflowOutput baseSize(aDesiredSize.GetWritingMode());
nsresult rv =
nsMathMLContainerFrame::Place(aDrawTarget, false, baseSize);
if (NS_MATHML_HAS_ERROR(mPresentationData.flags) || NS_FAILED(rv)) {
DidReflowChildren(PrincipalChildList().FirstChild());
return rv;
}
@@ -684,17 +684,17 @@ nsMathMLmencloseFrame::PlaceInternal(Dra
// Finish reflowing child frames
PositionRowChildFrames(dx_left, aDesiredSize.BlockStartAscent());
}
return NS_OK;
}
nscoord
-nsMathMLmencloseFrame::FixInterFrameSpacing(nsHTMLReflowMetrics& aDesiredSize)
+nsMathMLmencloseFrame::FixInterFrameSpacing(ReflowOutput& aDesiredSize)
{
nscoord gap = nsMathMLContainerFrame::FixInterFrameSpacing(aDesiredSize);
if (!gap)
return 0;
// Move the MathML characters
nsRect rect;
for (uint32_t i = 0; i < mMathMLChar.Length(); i++) {
--- a/layout/mathml/nsMathMLmencloseFrame.h
+++ b/layout/mathml/nsMathMLmencloseFrame.h
@@ -47,21 +47,21 @@ public:
NS_DECL_FRAMEARENA_HELPERS
friend nsIFrame* NS_NewMathMLmencloseFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext);
virtual nsresult
Place(DrawTarget* aDrawTarget,
bool aPlaceOrigin,
- nsHTMLReflowMetrics& aDesiredSize) override;
+ ReflowOutput& aDesiredSize) override;
virtual nsresult
MeasureForWidth(DrawTarget* aDrawTarget,
- nsHTMLReflowMetrics& aDesiredSize) override;
+ ReflowOutput& aDesiredSize) override;
virtual nsresult
AttributeChanged(int32_t aNameSpaceID,
nsIAtom* aAttribute,
int32_t aModType) override;
virtual void
SetAdditionalStyleContext(int32_t aIndex,
@@ -75,31 +75,31 @@ public:
NS_IMETHOD
InheritAutomaticData(nsIFrame* aParent) override;
NS_IMETHOD
TransmitAutomaticData() override;
virtual nscoord
- FixInterFrameSpacing(nsHTMLReflowMetrics& aDesiredSize) override;
+ FixInterFrameSpacing(ReflowOutput& aDesiredSize) override;
bool
IsMrowLike() override {
return mFrames.FirstChild() != mFrames.LastChild() ||
!mFrames.FirstChild();
}
protected:
explicit nsMathMLmencloseFrame(nsStyleContext* aContext);
virtual ~nsMathMLmencloseFrame();
nsresult PlaceInternal(DrawTarget* aDrawTarget,
bool aPlaceOrigin,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
bool aWidthOnly);
// functions to parse the "notation" attribute.
nsresult AddNotation(const nsAString& aNotation);
void InitNotations();
// Description of the notations to draw
uint32_t mNotationsToDraw;
--- a/layout/mathml/nsMathMLmfencedFrame.cpp
+++ b/layout/mathml/nsMathMLmfencedFrame.cpp
@@ -205,17 +205,17 @@ ApplyUnstretchedMetrics(nsPresContext*
aMetrics, // size is unimportant as we aren't stretching
charSize, NS_STRETCH_NONE, aIsRTL);
aMetrics += charSize;
}
}
void
nsMathMLmfencedFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
mPresentationData.flags &= ~NS_MATHML_ERROR;
aDesiredSize.ClearSize();
aDesiredSize.SetBlockStartAscent(0);
aDesiredSize.mBoundingMetrics = nsBoundingMetrics();
@@ -250,17 +250,17 @@ nsMathMLmfencedFrame::Reflow(nsPresConte
if (firstChild || mOpenChar || mCloseChar || mSeparatorsCount > 0) {
// We use the ASCII metrics to get our minimum height. This way,
// if we have borders or a background, they will fit better with
// other elements on the line.
ascent = fm->MaxAscent();
descent = fm->MaxDescent();
}
while (childFrame) {
- nsHTMLReflowMetrics childDesiredSize(aReflowState,
+ ReflowOutput childDesiredSize(aReflowState,
aDesiredSize.mFlags
| NS_REFLOW_CALC_BOUNDING_METRICS);
WritingMode wm = childFrame->GetWritingMode();
LogicalSize availSize = aReflowState.ComputedSize(wm);
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
ReflowInput childReflowState(aPresContext, aReflowState,
childFrame, availSize);
ReflowChild(childFrame, aPresContext, childDesiredSize,
@@ -290,17 +290,17 @@ nsMathMLmfencedFrame::Reflow(nsPresConte
GetPreferredStretchSize(drawTarget,
0, /* i.e., without embellishments */
stretchDir, containerSize);
childFrame = firstChild;
while (childFrame) {
nsIMathMLFrame* mathmlChild = do_QueryFrame(childFrame);
if (mathmlChild) {
- nsHTMLReflowMetrics childDesiredSize(aReflowState);
+ ReflowOutput childDesiredSize(aReflowState);
// retrieve the metrics that was stored at the previous pass
GetReflowAndBoundingMetricsFor(childFrame, childDesiredSize,
childDesiredSize.mBoundingMetrics);
mathmlChild->Stretch(drawTarget,
stretchDir, containerSize, childDesiredSize);
// store the updated metrics
SaveReflowAndBoundingMetricsFor(childFrame, childDesiredSize,
@@ -390,17 +390,17 @@ nsMathMLmfencedFrame::Reflow(nsPresConte
}
if (isRTL) {
childFrame = this->GetChildList(nsIFrame::kPrincipalList).LastChild();
} else {
childFrame = firstChild;
}
while (childFrame) {
- nsHTMLReflowMetrics childSize(aReflowState);
+ ReflowOutput childSize(aReflowState);
GetReflowAndBoundingMetricsFor(childFrame, childSize, bm);
if (firstTime) {
firstTime = false;
aDesiredSize.mBoundingMetrics = bm;
}
else
aDesiredSize.mBoundingMetrics += bm;
@@ -599,17 +599,17 @@ GetMaxCharWidth(nsPresContext* aPr
width += leftSpace + rightSpace;
}
return width;
}
/* virtual */ void
-nsMathMLmfencedFrame::GetIntrinsicISizeMetrics(nsRenderingContext* aRenderingContext, nsHTMLReflowMetrics& aDesiredSize)
+nsMathMLmfencedFrame::GetIntrinsicISizeMetrics(nsRenderingContext* aRenderingContext, ReflowOutput& aDesiredSize)
{
nscoord width = 0;
nsPresContext* presContext = PresContext();
const nsStyleFont* font = StyleFont();
float fontSizeInflation = nsLayoutUtils:: FontSizeInflationFor(this);
RefPtr<nsFontMetrics> fm =
nsLayoutUtils::GetFontMetricsForFrame(this, fontSizeInflation);
@@ -649,17 +649,17 @@ nsMathMLmfencedFrame::GetIntrinsicISizeM
aDesiredSize.Width() = width;
aDesiredSize.mBoundingMetrics.width = width;
aDesiredSize.mBoundingMetrics.leftBearing = 0;
aDesiredSize.mBoundingMetrics.rightBearing = width;
}
nscoord
-nsMathMLmfencedFrame::FixInterFrameSpacing(nsHTMLReflowMetrics& aDesiredSize)
+nsMathMLmfencedFrame::FixInterFrameSpacing(ReflowOutput& aDesiredSize)
{
nscoord gap = nsMathMLContainerFrame::FixInterFrameSpacing(aDesiredSize);
if (!gap) return 0;
nsRect rect;
if (mOpenChar) {
mOpenChar->GetRect(rect);
rect.MoveBy(gap, 0);
--- a/layout/mathml/nsMathMLmfencedFrame.h
+++ b/layout/mathml/nsMathMLmfencedFrame.h
@@ -31,40 +31,40 @@ public:
InheritAutomaticData(nsIFrame* aParent) override;
virtual void
SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) override;
virtual void
Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual void
GetIntrinsicISizeMetrics(nsRenderingContext* aRenderingContext,
- nsHTMLReflowMetrics& aDesiredSize) override;
+ ReflowOutput& aDesiredSize) override;
virtual nsresult
AttributeChanged(int32_t aNameSpaceID,
nsIAtom* aAttribute,
int32_t aModType) override;
// override the base method because we must keep separators in sync
virtual nsresult
ChildListChanged(int32_t aModType) override;
// override the base method so that we can deal with fences and separators
virtual nscoord
- FixInterFrameSpacing(nsHTMLReflowMetrics& aDesiredSize) override;
+ FixInterFrameSpacing(ReflowOutput& aDesiredSize) override;
// helper routines to format the MathMLChars involved here
static nsresult
ReflowChar(nsPresContext* aPresContext,
DrawTarget* aDrawTarget,
nsFontMetrics& aFontMetrics,
float aFontSizeInflation,
nsMathMLChar* aMathMLChar,
--- a/layout/mathml/nsMathMLmfracFrame.cpp
+++ b/layout/mathml/nsMathMLmfracFrame.cpp
@@ -175,50 +175,50 @@ nsMathMLmfracFrame::AttributeChanged(int
}
return
nsMathMLContainerFrame::AttributeChanged(aNameSpaceID, aAttribute,
aModType);
}
/* virtual */ nsresult
nsMathMLmfracFrame::MeasureForWidth(DrawTarget* aDrawTarget,
- nsHTMLReflowMetrics& aDesiredSize)
+ ReflowOutput& aDesiredSize)
{
return PlaceInternal(aDrawTarget, false, aDesiredSize, true);
}
nscoord
-nsMathMLmfracFrame::FixInterFrameSpacing(nsHTMLReflowMetrics& aDesiredSize)
+nsMathMLmfracFrame::FixInterFrameSpacing(ReflowOutput& aDesiredSize)
{
nscoord gap = nsMathMLContainerFrame::FixInterFrameSpacing(aDesiredSize);
if (!gap) return 0;
mLineRect.MoveBy(gap, 0);
return gap;
}
/* virtual */ nsresult
nsMathMLmfracFrame::Place(DrawTarget* aDrawTarget,
bool aPlaceOrigin,
- nsHTMLReflowMetrics& aDesiredSize)
+ ReflowOutput& aDesiredSize)
{
return PlaceInternal(aDrawTarget, aPlaceOrigin, aDesiredSize, false);
}
nsresult
nsMathMLmfracFrame::PlaceInternal(DrawTarget* aDrawTarget,
bool aPlaceOrigin,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
bool aWidthOnly)
{
////////////////////////////////////
// Get the children's desired sizes
nsBoundingMetrics bmNum, bmDen;
- nsHTMLReflowMetrics sizeNum(aDesiredSize.GetWritingMode());
- nsHTMLReflowMetrics sizeDen(aDesiredSize.GetWritingMode());
+ ReflowOutput sizeNum(aDesiredSize.GetWritingMode());
+ ReflowOutput sizeDen(aDesiredSize.GetWritingMode());
nsIFrame* frameDen = nullptr;
nsIFrame* frameNum = mFrames.FirstChild();
if (frameNum)
frameDen = frameNum->GetNextSibling();
if (!frameNum || !frameDen || frameDen->GetNextSibling()) {
// report an error, encourage people to get their markups in order
if (aPlaceOrigin) {
ReportChildCountError();
--- a/layout/mathml/nsMathMLmfracFrame.h
+++ b/layout/mathml/nsMathMLmfracFrame.h
@@ -54,38 +54,38 @@ public:
NS_DECL_FRAMEARENA_HELPERS
friend nsIFrame* NS_NewMathMLmfracFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
virtual eMathMLFrameType GetMathMLFrameType() override;
virtual nsresult
MeasureForWidth(DrawTarget* aDrawTarget,
- nsHTMLReflowMetrics& aDesiredSize) override;
+ ReflowOutput& aDesiredSize) override;
virtual nsresult
Place(DrawTarget* aDrawTarget,
bool aPlaceOrigin,
- nsHTMLReflowMetrics& aDesiredSize) override;
+ ReflowOutput& aDesiredSize) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual nsresult
AttributeChanged(int32_t aNameSpaceID,
nsIAtom* aAttribute,
int32_t aModType) override;
NS_IMETHOD
TransmitAutomaticData() override;
// override the base method so that we can deal with the fraction line
virtual nscoord
- FixInterFrameSpacing(nsHTMLReflowMetrics& aDesiredSize) override;
+ FixInterFrameSpacing(ReflowOutput& aDesiredSize) override;
// helper to translate the thickness attribute into a usable form
static nscoord
CalcLineThickness(nsPresContext* aPresContext,
nsStyleContext* aStyleContext,
nsString& aThicknessAttribute,
nscoord onePixel,
nscoord aDefaultRuleThickness,
@@ -95,17 +95,17 @@ public:
ScriptIncrement(nsIFrame* aFrame) override;
protected:
explicit nsMathMLmfracFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
virtual ~nsMathMLmfracFrame();
nsresult PlaceInternal(DrawTarget* aDrawTarget,
bool aPlaceOrigin,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
bool aWidthOnly);
// Display a slash
void DisplaySlash(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, const nsRect& aRect,
nscoord aThickness,
const nsDisplayListSet& aLists);
--- a/layout/mathml/nsMathMLmmultiscriptsFrame.cpp
+++ b/layout/mathml/nsMathMLmmultiscriptsFrame.cpp
@@ -87,17 +87,17 @@ nsMathMLmmultiscriptsFrame::TransmitAuto
}
return NS_OK;
}
/* virtual */ nsresult
nsMathMLmmultiscriptsFrame::Place(DrawTarget* aDrawTarget,
bool aPlaceOrigin,
- nsHTMLReflowMetrics& aDesiredSize)
+ ReflowOutput& aDesiredSize)
{
nscoord subScriptShift = 0;
nscoord supScriptShift = 0;
float fontSizeInflation = nsLayoutUtils::FontSizeInflationFor(this);
// subscriptshift
//
// "Specifies the minimum amount to shift the baseline of subscript down; the
@@ -141,17 +141,17 @@ nsMathMLmmultiscriptsFrame::Place(DrawTa
}
// exported routine that both munderover and mmultiscripts share.
// munderover uses this when movablelimits is set.
nsresult
nsMathMLmmultiscriptsFrame::PlaceMultiScript(nsPresContext* aPresContext,
DrawTarget* aDrawTarget,
bool aPlaceOrigin,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
nsMathMLContainerFrame* aFrame,
nscoord aUserSubScriptShift,
nscoord aUserSupScriptShift,
float aFontSizeInflation)
{
nsIAtom* tag = aFrame->GetContent()->NodeInfo()->NameAtom();
// This function deals with both munderover etc. as well as msubsup etc.
@@ -295,20 +295,20 @@ nsMathMLmmultiscriptsFrame::PlaceMultiSc
const WritingMode wm(aDesiredSize.GetWritingMode());
nscoord width = 0, prescriptsWidth = 0, rightBearing = 0;
nscoord minSubScriptShift = 0, minSupScriptShift = 0;
nscoord trySubScriptShift = subScriptShift;
nscoord trySupScriptShift = supScriptShift;
nscoord maxSubScriptShift = subScriptShift;
nscoord maxSupScriptShift = supScriptShift;
- nsHTMLReflowMetrics baseSize(wm);
- nsHTMLReflowMetrics subScriptSize(wm);
- nsHTMLReflowMetrics supScriptSize(wm);
- nsHTMLReflowMetrics multiSubSize(wm), multiSupSize(wm);
+ ReflowOutput baseSize(wm);
+ ReflowOutput subScriptSize(wm);
+ ReflowOutput supScriptSize(wm);
+ ReflowOutput multiSubSize(wm), multiSupSize(wm);
baseFrame = nullptr;
nsIFrame* subScriptFrame = nullptr;
nsIFrame* supScriptFrame = nullptr;
nsIFrame* prescriptsFrame = nullptr; // frame of <mprescripts/>, if there.
bool firstPrescriptsPair = false;
nsBoundingMetrics bmBase, bmSubScript, bmSupScript, bmMultiSub, bmMultiSup;
multiSubSize.SetBlockStartAscent(-0x7FFFFFFF);
--- a/layout/mathml/nsMathMLmmultiscriptsFrame.h
+++ b/layout/mathml/nsMathMLmmultiscriptsFrame.h
@@ -23,23 +23,23 @@ public:
friend nsIFrame* NS_NewMathMLmmultiscriptsFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
NS_IMETHOD
TransmitAutomaticData() override;
virtual nsresult
Place(DrawTarget* aDrawTarget,
bool aPlaceOrigin,
- nsHTMLReflowMetrics& aDesiredSize) override;
+ ReflowOutput& aDesiredSize) override;
static nsresult
PlaceMultiScript(nsPresContext* aPresContext,
DrawTarget* aDrawTarget,
bool aPlaceOrigin,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
nsMathMLContainerFrame* aForFrame,
nscoord aUserSubScriptShift,
nscoord aUserSupScriptShift,
float aFontSizeInflation);
uint8_t
ScriptIncrement(nsIFrame* aFrame) override;
--- a/layout/mathml/nsMathMLmoFrame.cpp
+++ b/layout/mathml/nsMathMLmoFrame.cpp
@@ -601,17 +601,17 @@ GetStretchHint(nsOperatorFlags aFlags, n
// NOTE: aDesiredStretchSize is an IN/OUT parameter
// On input - it contains our current size
// On output - the same size or the new size that we want
NS_IMETHODIMP
nsMathMLmoFrame::Stretch(DrawTarget* aDrawTarget,
nsStretchDirection aStretchDirection,
nsBoundingMetrics& aContainerSize,
- nsHTMLReflowMetrics& aDesiredStretchSize)
+ ReflowOutput& aDesiredStretchSize)
{
if (NS_MATHML_STRETCH_WAS_DONE(mPresentationData.flags)) {
NS_WARNING("it is wrong to fire stretch more than once on a frame");
return NS_OK;
}
mPresentationData.flags |= NS_MATHML_STRETCH_DONE;
nsIFrame* firstChild = mFrames.FirstChild();
@@ -939,32 +939,32 @@ nsMathMLmoFrame::SetInitialChildList(Chi
{
// First, let the parent class do its work
nsMathMLTokenFrame::SetInitialChildList(aListID, aChildList);
ProcessTextData();
}
void
nsMathMLmoFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
// certain values use units that depend on our style context, so
// it is safer to just process the whole lot here
ProcessOperatorData();
nsMathMLTokenFrame::Reflow(aPresContext, aDesiredSize,
aReflowState, aStatus);
}
nsresult
nsMathMLmoFrame::Place(DrawTarget* aDrawTarget,
bool aPlaceOrigin,
- nsHTMLReflowMetrics& aDesiredSize)
+ ReflowOutput& aDesiredSize)
{
nsresult rv = nsMathMLTokenFrame::Place(aDrawTarget, aPlaceOrigin, aDesiredSize);
if (NS_FAILED(rv)) {
return rv;
}
/* Special behaviour for largeops.
@@ -1031,17 +1031,17 @@ nsMathMLmoFrame::MarkIntrinsicISizesDirt
// so that we don't rebuild multiple times for the same change.
RebuildAutomaticDataForChildren(target);
nsMathMLContainerFrame::MarkIntrinsicISizesDirty();
}
/* virtual */ void
nsMathMLmoFrame::GetIntrinsicISizeMetrics(nsRenderingContext* aRenderingContext,
- nsHTMLReflowMetrics& aDesiredSize)
+ ReflowOutput& aDesiredSize)
{
ProcessOperatorData();
if (UseMathMLChar()) {
uint32_t stretchHint = GetStretchHint(mFlags, mPresentationData, true,
StyleFont());
aDesiredSize.Width() = mMathMLChar.
GetMaxWidth(PresContext(), aRenderingContext->GetDrawTarget(),
nsLayoutUtils::FontSizeInflationFor(this),
--- a/layout/mathml/nsMathMLmoFrame.h
+++ b/layout/mathml/nsMathMLmoFrame.h
@@ -39,43 +39,43 @@ public:
TransmitAutomaticData() override;
virtual void
SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) override;
virtual void
Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual nsresult
Place(DrawTarget* aDrawTarget,
bool aPlaceOrigin,
- nsHTMLReflowMetrics& aDesiredSize) override;
+ ReflowOutput& aDesiredSize) override;
virtual void MarkIntrinsicISizesDirty() override;
virtual void
GetIntrinsicISizeMetrics(nsRenderingContext* aRenderingContext,
- nsHTMLReflowMetrics& aDesiredSize) override;
+ ReflowOutput& aDesiredSize) override;
virtual nsresult
AttributeChanged(int32_t aNameSpaceID,
nsIAtom* aAttribute,
int32_t aModType) override;
// This method is called by the parent frame to ask <mo>
// to stretch itself.
NS_IMETHOD
Stretch(DrawTarget* aDrawTarget,
nsStretchDirection aStretchDirection,
nsBoundingMetrics& aContainerSize,
- nsHTMLReflowMetrics& aDesiredStretchSize) override;
+ ReflowOutput& aDesiredStretchSize) override;
virtual nsresult
ChildListChanged(int32_t aModType) override
{
ProcessTextData();
return nsMathMLContainerFrame::ChildListChanged(aModType);
}
--- a/layout/mathml/nsMathMLmpaddedFrame.cpp
+++ b/layout/mathml/nsMathMLmpaddedFrame.cpp
@@ -250,17 +250,17 @@ nsMathMLmpaddedFrame::ParseAttribute(nsS
aSign = NS_MATHML_SIGN_INVALID;
return false;
}
void
nsMathMLmpaddedFrame::UpdateValue(int32_t aSign,
int32_t aPseudoUnit,
const nsCSSValue& aCSSValue,
- const nsHTMLReflowMetrics& aDesiredSize,
+ const ReflowOutput& aDesiredSize,
nscoord& aValueToUpdate,
float aFontSizeInflation) const
{
nsCSSUnit unit = aCSSValue.GetUnit();
if (NS_MATHML_SIGN_INVALID != aSign && eCSSUnit_Null != unit) {
nscoord scaler = 0, amount = 0;
if (eCSSUnit_Percent == unit || eCSSUnit_Number == unit) {
@@ -299,34 +299,34 @@ nsMathMLmpaddedFrame::UpdateValue(int32_
aValueToUpdate -= amount;
else
aValueToUpdate = amount;
}
}
void
nsMathMLmpaddedFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
mPresentationData.flags &= ~NS_MATHML_ERROR;
ProcessAttributes();
///////////////
// Let the base class format our content like an inferred mrow
nsMathMLContainerFrame::Reflow(aPresContext, aDesiredSize,
aReflowState, aStatus);
//NS_ASSERTION(NS_FRAME_IS_COMPLETE(aStatus), "bad status");
}
/* virtual */ nsresult
nsMathMLmpaddedFrame::Place(DrawTarget* aDrawTarget,
bool aPlaceOrigin,
- nsHTMLReflowMetrics& aDesiredSize)
+ ReflowOutput& aDesiredSize)
{
nsresult rv =
nsMathMLContainerFrame::Place(aDrawTarget, false, aDesiredSize);
if (NS_MATHML_HAS_ERROR(mPresentationData.flags) || NS_FAILED(rv)) {
DidReflowChildren(PrincipalChildList().FirstChild());
return rv;
}
@@ -437,13 +437,13 @@ nsMathMLmpaddedFrame::Place(DrawTarget*
PositionRowChildFrames(dx, aDesiredSize.BlockStartAscent() - voffset);
}
return NS_OK;
}
/* virtual */ nsresult
nsMathMLmpaddedFrame::MeasureForWidth(DrawTarget* aDrawTarget,
- nsHTMLReflowMetrics& aDesiredSize)
+ ReflowOutput& aDesiredSize)
{
ProcessAttributes();
return Place(aDrawTarget, false, aDesiredSize);
}
--- a/layout/mathml/nsMathMLmpaddedFrame.h
+++ b/layout/mathml/nsMathMLmpaddedFrame.h
@@ -24,38 +24,38 @@ public:
NS_IMETHOD
TransmitAutomaticData() override {
return TransmitAutomaticDataForMrowLikeElement();
}
virtual void
Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual nsresult
Place(DrawTarget* aDrawTarget,
bool aPlaceOrigin,
- nsHTMLReflowMetrics& aDesiredSize) override;
+ ReflowOutput& aDesiredSize) override;
bool
IsMrowLike() override {
return mFrames.FirstChild() != mFrames.LastChild() ||
!mFrames.FirstChild();
}
protected:
explicit nsMathMLmpaddedFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
virtual ~nsMathMLmpaddedFrame();
virtual nsresult
MeasureForWidth(DrawTarget* aDrawTarget,
- nsHTMLReflowMetrics& aDesiredSize) override;
+ ReflowOutput& aDesiredSize) override;
private:
nsCSSValue mWidth;
nsCSSValue mHeight;
nsCSSValue mDepth;
nsCSSValue mLeadingSpace;
nsCSSValue mVerticalOffset;
@@ -80,14 +80,14 @@ private:
int32_t& aSign,
nsCSSValue& aCSSValue,
int32_t& aPseudoUnit);
void
UpdateValue(int32_t aSign,
int32_t aPseudoUnit,
const nsCSSValue& aCSSValue,
- const nsHTMLReflowMetrics& aDesiredSize,
+ const ReflowOutput& aDesiredSize,
nscoord& aValueToUpdate,
float aFontSizeInflation) const;
};
#endif /* nsMathMLmpaddedFrame_h___ */
--- a/layout/mathml/nsMathMLmrootFrame.cpp
+++ b/layout/mathml/nsMathMLmrootFrame.cpp
@@ -155,17 +155,17 @@ nsMathMLmrootFrame::GetRadicalXOffsets(n
if (aIndexOffset)
*aIndexOffset = dxIndex;
if (aSqrOffset)
*aSqrOffset = dxSqr;
}
void
nsMathMLmrootFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
nsReflowStatus childStatus;
mPresentationData.flags &= ~NS_MATHML_ERROR;
aDesiredSize.ClearSize();
@@ -175,22 +175,22 @@ nsMathMLmrootFrame::Reflow(nsPresContext
DrawTarget* drawTarget = aReflowState.rendContext->GetDrawTarget();
//////////////////
// Reflow Children
int32_t count = 0;
nsIFrame* baseFrame = nullptr;
nsIFrame* indexFrame = nullptr;
- nsHTMLReflowMetrics baseSize(aReflowState);
- nsHTMLReflowMetrics indexSize(aReflowState);
+ ReflowOutput baseSize(aReflowState);
+ ReflowOutput indexSize(aReflowState);
nsIFrame* childFrame = mFrames.FirstChild();
while (childFrame) {
// ask our children to compute their bounding metrics
- nsHTMLReflowMetrics childDesiredSize(aReflowState,
+ ReflowOutput childDesiredSize(aReflowState,
aDesiredSize.mFlags
| NS_REFLOW_CALC_BOUNDING_METRICS);
WritingMode wm = childFrame->GetWritingMode();
LogicalSize availSize = aReflowState.ComputedSize(wm);
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
ReflowInput childReflowState(aPresContext, aReflowState,
childFrame, availSize);
ReflowChild(childFrame, aPresContext,
@@ -353,17 +353,17 @@ nsMathMLmrootFrame::Reflow(nsPresContext
mReference.x = 0;
mReference.y = aDesiredSize.BlockStartAscent();
aStatus = NS_FRAME_COMPLETE;
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
}
/* virtual */ void
-nsMathMLmrootFrame::GetIntrinsicISizeMetrics(nsRenderingContext* aRenderingContext, nsHTMLReflowMetrics& aDesiredSize)
+nsMathMLmrootFrame::GetIntrinsicISizeMetrics(nsRenderingContext* aRenderingContext, ReflowOutput& aDesiredSize)
{
nsIFrame* baseFrame = mFrames.FirstChild();
nsIFrame* indexFrame = nullptr;
if (baseFrame)
indexFrame = baseFrame->GetNextSibling();
if (!indexFrame || indexFrame->GetNextSibling()) {
ReflowError(aRenderingContext->GetDrawTarget(), aDesiredSize);
return;
--- a/layout/mathml/nsMathMLmrootFrame.h
+++ b/layout/mathml/nsMathMLmrootFrame.h
@@ -31,29 +31,29 @@ public:
nsContainerFrame* aParent,
nsIFrame* aPrevInFlow) override;
NS_IMETHOD
TransmitAutomaticData() override;
virtual void
Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
void
GetRadicalXOffsets(nscoord aIndexWidth, nscoord aSqrWidth,
nsFontMetrics* aFontMetrics,
nscoord* aIndexOffset,
nscoord* aSqrOffset);
virtual void
GetIntrinsicISizeMetrics(nsRenderingContext* aRenderingContext,
- nsHTMLReflowMetrics& aDesiredSize) override;
+ ReflowOutput& aDesiredSize) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
uint8_t
ScriptIncrement(nsIFrame* aFrame) override
{
--- a/layout/mathml/nsMathMLmspaceFrame.cpp
+++ b/layout/mathml/nsMathMLmspaceFrame.cpp
@@ -89,17 +89,17 @@ nsMathMLmspaceFrame::ProcessAttributes(n
if (!value.IsEmpty()) {
ParseNumericValue(value, &mDepth, 0,
aPresContext, mStyleContext, fontSizeInflation);
}
}
void
nsMathMLmspaceFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
mPresentationData.flags &= ~NS_MATHML_ERROR;
ProcessAttributes(aPresContext);
mBoundingMetrics = nsBoundingMetrics();
@@ -116,17 +116,17 @@ nsMathMLmspaceFrame::Reflow(nsPresContex
aDesiredSize.mBoundingMetrics = mBoundingMetrics;
aStatus = NS_FRAME_COMPLETE;
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
}
/* virtual */ nsresult
nsMathMLmspaceFrame::MeasureForWidth(DrawTarget* aDrawTarget,
- nsHTMLReflowMetrics& aDesiredSize)
+ ReflowOutput& aDesiredSize)
{
ProcessAttributes(PresContext());
mBoundingMetrics = nsBoundingMetrics();
mBoundingMetrics.width = mWidth;
aDesiredSize.Width() = std::max(0, mBoundingMetrics.width);
aDesiredSize.mBoundingMetrics = mBoundingMetrics;
return NS_OK;
}
--- a/layout/mathml/nsMathMLmspaceFrame.h
+++ b/layout/mathml/nsMathMLmspaceFrame.h
@@ -26,27 +26,27 @@ public:
mPresentationData.flags |= NS_MATHML_SPACE_LIKE;
return NS_OK;
}
virtual bool IsLeaf() const override;
virtual void
Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
protected:
explicit nsMathMLmspaceFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
virtual ~nsMathMLmspaceFrame();
virtual nsresult
MeasureForWidth(DrawTarget* aDrawTarget,
- nsHTMLReflowMetrics& aDesiredSize) override;
+ ReflowOutput& aDesiredSize) override;
private:
nscoord mWidth;
nscoord mHeight;
nscoord mDepth;
// helper method to initialize our member data
void
--- a/layout/mathml/nsMathMLmtableFrame.cpp
+++ b/layout/mathml/nsMathMLmtableFrame.cpp
@@ -816,17 +816,17 @@ nsMathMLmtableWrapperFrame::GetRowFrameA
--aRowIndex;
}
}
return nullptr;
}
void
nsMathMLmtableWrapperFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
nsAutoString value;
// we want to return a table that is anchored according to the align attribute
nsTableWrapperFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
NS_ASSERTION(aDesiredSize.Height() >= 0, "illegal height for mtable");
@@ -1311,17 +1311,17 @@ nsMathMLmtdInnerFrame::nsMathMLmtdInnerF
nsMathMLmtdInnerFrame::~nsMathMLmtdInnerFrame()
{
mUniqueStyleText->Destroy(PresContext());
}
void
nsMathMLmtdInnerFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
// Let the base class do the reflow
nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
// more about <maligngroup/> and <malignmark/> later
// ...
--- a/layout/mathml/nsMathMLmtableFrame.h
+++ b/layout/mathml/nsMathMLmtableFrame.h
@@ -27,17 +27,17 @@ public:
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
// overloaded nsTableWrapperFrame methods
virtual void
Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual nsresult
AttributeChanged(int32_t aNameSpaceID,
nsIAtom* aAttribute,
int32_t aModType) override;
@@ -297,17 +297,17 @@ public:
{
nsMathMLContainerFrame::PropagatePresentationDataFromChildAt(this,
aFirstIndex, aLastIndex, aFlagsValues, aFlagsToUpdate);
return NS_OK;
}
virtual void
Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual bool IsFrameOfType(uint32_t aFlags) const override
{
return nsBlockFrame::IsFrameOfType(aFlags &
~(nsIFrame::eMathML | nsIFrame::eExcludesIgnorableWhitespace));
}
--- a/layout/mathml/nsMathMLmunderoverFrame.cpp
+++ b/layout/mathml/nsMathMLmunderoverFrame.cpp
@@ -298,17 +298,17 @@ i.e.,:
else {
// place like underscript-overscript pair
}
*/
/* virtual */ nsresult
nsMathMLmunderoverFrame::Place(DrawTarget* aDrawTarget,
bool aPlaceOrigin,
- nsHTMLReflowMetrics& aDesiredSize)
+ ReflowOutput& aDesiredSize)
{
float fontSizeInflation = nsLayoutUtils::FontSizeInflationFor(this);
if (NS_MATHML_EMBELLISH_IS_MOVABLELIMITS(mEmbellishData.flags) &&
StyleFont()->mMathDisplay == NS_MATHML_DISPLAYSTYLE_INLINE) {
//place like sub sup or subsup
if (mContent->IsMathMLElement(nsGkAtoms::munderover_)) {
return nsMathMLmmultiscriptsFrame::PlaceMultiScript(PresContext(),
aDrawTarget,
@@ -335,19 +335,19 @@ nsMathMLmunderoverFrame::Place(DrawTarge
}
}
////////////////////////////////////
// Get the children's desired sizes
nsBoundingMetrics bmBase, bmUnder, bmOver;
- nsHTMLReflowMetrics baseSize(aDesiredSize.GetWritingMode());
- nsHTMLReflowMetrics underSize(aDesiredSize.GetWritingMode());
- nsHTMLReflowMetrics overSize(aDesiredSize.GetWritingMode());
+ ReflowOutput baseSize(aDesiredSize.GetWritingMode());
+ ReflowOutput underSize(aDesiredSize.GetWritingMode());
+ ReflowOutput overSize(aDesiredSize.GetWritingMode());
nsIFrame* overFrame = nullptr;
nsIFrame* underFrame = nullptr;
nsIFrame* baseFrame = mFrames.FirstChild();
underSize.SetBlockStartAscent(0);
overSize.SetBlockStartAscent(0);
bool haveError = false;
if (baseFrame) {
if (mContent->IsAnyOfMathMLElements(nsGkAtoms::munder_,
--- a/layout/mathml/nsMathMLmunderoverFrame.h
+++ b/layout/mathml/nsMathMLmunderoverFrame.h
@@ -17,17 +17,17 @@ class nsMathMLmunderoverFrame : public n
public:
NS_DECL_FRAMEARENA_HELPERS
friend nsIFrame* NS_NewMathMLmunderoverFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
virtual nsresult
Place(DrawTarget* aDrawTarget,
bool aPlaceOrigin,
- nsHTMLReflowMetrics& aDesiredSize) override;
+ ReflowOutput& aDesiredSize) override;
NS_IMETHOD
InheritAutomaticData(nsIFrame* aParent) override;
NS_IMETHOD
TransmitAutomaticData() override;
NS_IMETHOD
--- a/layout/svg/SVGTextFrame.cpp
+++ b/layout/svg/SVGTextFrame.cpp
@@ -5388,17 +5388,17 @@ SVGTextFrame::DoReflow()
mState |= NS_STATE_SVG_TEXT_IN_REFLOW;
nscoord inlineSize = kid->GetPrefISize(&renderingContext);
WritingMode wm = kid->GetWritingMode();
ReflowInput reflowState(presContext, kid,
&renderingContext,
LogicalSize(wm, inlineSize,
NS_UNCONSTRAINEDSIZE));
- nsHTMLReflowMetrics desiredSize(reflowState);
+ ReflowOutput desiredSize(reflowState);
nsReflowStatus status;
NS_ASSERTION(reflowState.ComputedPhysicalBorderPadding() == nsMargin(0, 0, 0, 0) &&
reflowState.ComputedPhysicalMargin() == nsMargin(0, 0, 0, 0),
"style system should ensure that :-moz-svg-text "
"does not get styled");
kid->Reflow(presContext, desiredSize, reflowState, status);
--- a/layout/svg/nsSVGForeignObjectFrame.cpp
+++ b/layout/svg/nsSVGForeignObjectFrame.cpp
@@ -119,17 +119,17 @@ nsSVGForeignObjectFrame::AttributeChange
}
}
return NS_OK;
}
void
nsSVGForeignObjectFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MOZ_ASSERT(!(GetStateBits() & NS_FRAME_IS_NONDISPLAY),
"Should not have been called");
// Only InvalidateAndScheduleBoundsUpdate marks us with NS_FRAME_IS_DIRTY,
// so if that bit is still set we still have a resize pending. If we hit
@@ -540,17 +540,17 @@ nsSVGForeignObjectFrame::DoReflow()
mInReflow = true;
WritingMode wm = kid->GetWritingMode();
ReflowInput reflowState(presContext, kid,
&renderingContext,
LogicalSize(wm, ISize(wm),
NS_UNCONSTRAINEDSIZE));
- nsHTMLReflowMetrics desiredSize(reflowState);
+ ReflowOutput desiredSize(reflowState);
nsReflowStatus status;
// We don't use mRect.height above because that tells the child to do
// page/column breaking at that height.
NS_ASSERTION(reflowState.ComputedPhysicalBorderPadding() == nsMargin(0, 0, 0, 0) &&
reflowState.ComputedPhysicalMargin() == nsMargin(0, 0, 0, 0),
"style system should ensure that :-moz-svg-foreign-content "
"does not get styled");
--- a/layout/svg/nsSVGForeignObjectFrame.h
+++ b/layout/svg/nsSVGForeignObjectFrame.h
@@ -37,17 +37,17 @@ public:
nsIAtom* aAttribute,
int32_t aModType) override;
virtual nsContainerFrame* GetContentInsertionFrame() override {
return PrincipalChildList().FirstChild()->GetContentInsertionFrame();
}
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
/**
--- a/layout/svg/nsSVGOuterSVGFrame.cpp
+++ b/layout/svg/nsSVGOuterSVGFrame.cpp
@@ -352,17 +352,17 @@ nsSVGOuterSVGFrame::ComputeSize(nsRender
cbSize,
aMargin,
aBorder,
aPadding);
}
void
nsSVGOuterSVGFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsSVGOuterSVGFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
("enter nsSVGOuterSVGFrame::Reflow: availSize=%d,%d",
--- a/layout/svg/nsSVGOuterSVGFrame.h
+++ b/layout/svg/nsSVGOuterSVGFrame.h
@@ -50,17 +50,17 @@ public:
const mozilla::LogicalSize& aCBSize,
nscoord aAvailableISize,
const mozilla::LogicalSize& aMargin,
const mozilla::LogicalSize& aBorder,
const mozilla::LogicalSize& aPadding,
ComputeSizeFlags aFlags) override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual void DidReflow(nsPresContext* aPresContext,
const ReflowInput* aReflowState,
nsDidReflowStatus aStatus) override;
virtual void UnionChildOverflow(nsOverflowAreas& aOverflowAreas) override;
--- a/layout/tables/nsTableCellFrame.cpp
+++ b/layout/tables/nsTableCellFrame.cpp
@@ -635,17 +635,17 @@ void nsTableCellFrame::BlockDirAlignChil
if (kidBStart != kidRect.BStart(aWM)) {
// Invalidate at the old position first
firstKid->InvalidateFrameSubtree();
}
firstKid->SetPosition(aWM, LogicalPoint(aWM, kidRect.IStart(aWM),
kidBStart), containerSize);
- nsHTMLReflowMetrics desiredSize(aWM);
+ ReflowOutput desiredSize(aWM);
desiredSize.SetSize(aWM, GetLogicalSize(aWM));
nsRect overflow(nsPoint(0,0), GetSize());
overflow.Inflate(GetBorderOverflow());
desiredSize.mOverflowAreas.SetAllTo(overflow);
ConsiderChildOverflow(desiredSize.mOverflowAreas, firstKid);
FinishAndStoreOverflow(&desiredSize);
if (kidBStart != kidRect.BStart(aWM)) {
@@ -804,17 +804,17 @@ nsTableCellFrame::IntrinsicISizeOffsets(
return result;
}
#ifdef DEBUG
#define PROBABLY_TOO_LARGE 1000000
static
void DebugCheckChildSize(nsIFrame* aChild,
- nsHTMLReflowMetrics& aMet)
+ ReflowOutput& aMet)
{
WritingMode wm = aMet.GetWritingMode();
if ((aMet.ISize(wm) < 0) || (aMet.ISize(wm) > PROBABLY_TOO_LARGE)) {
printf("WARNING: cell content %p has large inline size %d \n",
static_cast<void*>(aChild), int32_t(aMet.ISize(wm)));
}
}
#endif
@@ -852,17 +852,17 @@ CalcUnpaginatedBSize(nsTableCellFrame& a
computedBSize += row->GetUnpaginatedBSize();
}
}
return computedBSize;
}
void
nsTableCellFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsTableCellFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
if (aReflowState.mFlags.mSpecialBSizeReflow) {
@@ -888,17 +888,17 @@ nsTableCellFrame::Reflow(nsPresContext*
}
// Try to reflow the child into the available space. It might not
// fit or might need continuing.
if (availSize.BSize(wm) < 0) {
availSize.BSize(wm) = 1;
}
- nsHTMLReflowMetrics kidSize(wm, aDesiredSize.mFlags);
+ ReflowOutput kidSize(wm, aDesiredSize.mFlags);
kidSize.ClearSize();
SetPriorAvailISize(aReflowState.AvailableISize());
nsIFrame* firstKid = mFrames.FirstChild();
NS_ASSERTION(firstKid, "Frame construction error, a table cell always has an inner cell frame");
nsTableFrame* tableFrame = GetTableFrame();
if (aReflowState.mFlags.mSpecialBSizeReflow) {
const_cast<ReflowInput&>(aReflowState).
--- a/layout/tables/nsTableCellFrame.h
+++ b/layout/tables/nsTableCellFrame.h
@@ -116,17 +116,17 @@ public:
nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists);
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
virtual IntrinsicISizeOffsetData IntrinsicISizeOffsets() override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
/**
* Get the "type" of the frame
*
* @see nsLayoutAtoms::tableCellFrame
*/
@@ -206,17 +206,17 @@ public:
/** set the available isize given to this frame during its last reflow */
inline void SetPriorAvailISize(nscoord aPriorAvailISize);
/** return the desired size returned by this frame during its last reflow */
inline mozilla::LogicalSize GetDesiredSize();
/** set the desired size returned by this frame during its last reflow */
- inline void SetDesiredSize(const nsHTMLReflowMetrics & aDesiredSize);
+ inline void SetDesiredSize(const ReflowOutput & aDesiredSize);
bool GetContentEmpty();
void SetContentEmpty(bool aContentEmpty);
bool HasPctOverBSize();
void SetHasPctOverBSize(bool aValue);
nsTableCellFrame* GetNextCell() const;
@@ -266,17 +266,17 @@ inline nscoord nsTableCellFrame::GetPrio
{ return mPriorAvailISize; }
inline void nsTableCellFrame::SetPriorAvailISize(nscoord aPriorAvailISize)
{ mPriorAvailISize = aPriorAvailISize; }
inline mozilla::LogicalSize nsTableCellFrame::GetDesiredSize()
{ return mDesiredSize; }
-inline void nsTableCellFrame::SetDesiredSize(const nsHTMLReflowMetrics & aDesiredSize)
+inline void nsTableCellFrame::SetDesiredSize(const ReflowOutput & aDesiredSize)
{
mozilla::WritingMode wm = aDesiredSize.GetWritingMode();
mDesiredSize = aDesiredSize.Size(wm).ConvertTo(GetWritingMode(), wm);
}
inline bool nsTableCellFrame::GetContentEmpty()
{
return HasAnyStateBits(NS_TABLE_CELL_CONTENT_EMPTY);
--- a/layout/tables/nsTableColFrame.cpp
+++ b/layout/tables/nsTableColFrame.cpp
@@ -86,17 +86,17 @@ void nsTableColFrame::SetContinuousBCBor
return;
default:
NS_ERROR("invalid side arg");
}
}
void
nsTableColFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsTableColFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
aDesiredSize.ClearSize();
const nsStyleVisibility* colVis = StyleVisibility();
--- a/layout/tables/nsTableColFrame.h
+++ b/layout/tables/nsTableColFrame.h
@@ -50,17 +50,17 @@ public:
int32_t GetColIndex() const;
void SetColIndex (int32_t aColIndex);
nsTableColFrame* GetNextCol() const;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
/**
* Table columns never paint anything, nor receive events.
*/
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
--- a/layout/tables/nsTableColGroupFrame.cpp
+++ b/layout/tables/nsTableColGroupFrame.cpp
@@ -344,17 +344,17 @@ nsTableColGroupFrame::GetLogicalSkipSide
if (nullptr != GetNextInFlow()) {
skip |= eLogicalSideBitsBEnd;
}
return skip;
}
void
nsTableColGroupFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsTableColGroupFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
NS_ASSERTION(nullptr!=mContent, "bad state -- null content for frame");
@@ -364,17 +364,17 @@ nsTableColGroupFrame::Reflow(nsPresConte
GetTableFrame()->SetNeedToCollapse(true);
}
// for every content child that (is a column thingy and does not already have a frame)
// create a frame and adjust it's style
for (nsIFrame *kidFrame = mFrames.FirstChild(); kidFrame;
kidFrame = kidFrame->GetNextSibling()) {
// Give the child frame a chance to reflow, even though we know it'll have 0 size
- nsHTMLReflowMetrics kidSize(aReflowState);
+ ReflowOutput kidSize(aReflowState);
ReflowInput kidReflowState(aPresContext, aReflowState, kidFrame,
LogicalSize(kidFrame->GetWritingMode()));
nsReflowStatus status;
ReflowChild(kidFrame, aPresContext, kidSize, kidReflowState, 0, 0, 0, status);
FinishReflowChild(kidFrame, aPresContext, kidSize, nullptr, 0, 0, 0);
}
--- a/layout/tables/nsTableColGroupFrame.h
+++ b/layout/tables/nsTableColGroupFrame.h
@@ -100,17 +100,17 @@ public:
/** reflow of a column group is a trivial matter of reflowing
* the col group's children (columns), and setting this frame
* to 0-size. Since tables are row-centric, column group frames
* don't play directly in the rendering game. They do however
* maintain important state that effects table and cell layout.
*/
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
/**
* Get the "type" of the frame
*
* @see nsGkAtoms::tableColGroupFrame
*/
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -1803,17 +1803,17 @@ nsTableFrame::RequestSpecialBSizeReflow(
* part of nsIFrame::Reflow. It should then call nsIFrame::Reflow on
* the contents of the cells to do the necessary block-axis resizing.
*
******************************************************************************************/
/* Layout the entire inner table. */
void
nsTableFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsTableFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
bool isPaginated = aPresContext->IsPaginated();
WritingMode wm = aReflowState.GetWritingMode();
@@ -1984,34 +1984,34 @@ nsTableFrame::Reflow(nsPresContext*
}
FinishAndStoreOverflow(&aDesiredSize);
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
}
void
nsTableFrame::FixupPositionedTableParts(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState)
{
FrameTArray* positionedParts = Properties().Get(PositionedTablePartArray());
if (!positionedParts) {
return;
}
OverflowChangedTracker overflowTracker;
overflowTracker.SetSubtreeRoot(this);
for (size_t i = 0; i < positionedParts->Length(); ++i) {
nsIFrame* positionedPart = positionedParts->ElementAt(i);
// As we've already finished reflow, positionedParts's size and overflow
// areas have already been assigned, so we just pull them back out.
nsSize size(positionedPart->GetSize());
- nsHTMLReflowMetrics desiredSize(aReflowState.GetWritingMode());
+ ReflowOutput desiredSize(aReflowState.GetWritingMode());
desiredSize.Width() = size.width;
desiredSize.Height() = size.height;
desiredSize.mOverflowAreas = positionedPart->GetOverflowAreasRelativeToSelf();
// Construct a dummy reflow state and reflow status.
// XXX(seth): Note that the dummy reflow state doesn't have a correct
// chain of parent reflow states. It also doesn't necessarily have a
// correct containing block.
@@ -2065,17 +2065,17 @@ nsTableFrame::ComputeCustomOverflow(nsOv
bounds.Inflate(bcMargin.GetPhysicalMargin(wm));
aOverflowAreas.UnionAllWith(bounds);
}
return nsContainerFrame::ComputeCustomOverflow(aOverflowAreas);
}
void
-nsTableFrame::ReflowTable(nsHTMLReflowMetrics& aDesiredSize,
+nsTableFrame::ReflowTable(ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nscoord aAvailBSize,
nsIFrame*& aLastChildReflowed,
nsReflowStatus& aStatus)
{
aLastChildReflowed = nullptr;
if (!GetPrevInFlow()) {
@@ -2171,17 +2171,17 @@ nsTableFrame::PushChildren(const RowGrou
// Add the frames to our overflow list.
SetOverflowFrames(frames);
}
}
// collapsing row groups, rows, col groups and cols are accounted for after both passes of
// reflow so that it has no effect on the calculations of reflow.
void
-nsTableFrame::AdjustForCollapsingRowsCols(nsHTMLReflowMetrics& aDesiredSize,
+nsTableFrame::AdjustForCollapsingRowsCols(ReflowOutput& aDesiredSize,
const WritingMode aWM,
const LogicalMargin& aBorderPadding)
{
nscoord bTotalOffset = 0; // total offset among all rows in all row groups
// reset the bit, it will be set again if row/rowgroup or col/colgroup are
// collapsed
SetNeedToCollapse(false);
@@ -2768,17 +2768,17 @@ nsTableFrame::InitChildReflowState(Reflo
}
// Position and size aKidFrame and update our reflow state. The origin of
// aKidRect is relative to the upper-left origin of our frame
void
nsTableFrame::PlaceChild(TableReflowInput& aReflowState,
nsIFrame* aKidFrame,
nsPoint aKidPosition,
- nsHTMLReflowMetrics& aKidDesiredSize,
+ ReflowOutput& aKidDesiredSize,
const nsRect& aOriginalKidRect,
const nsRect& aOriginalKidVisualOverflow)
{
WritingMode wm = aReflowState.reflowState.GetWritingMode();
bool isFirstReflow =
aKidFrame->HasAnyStateBits(NS_FRAME_FIRST_REFLOW);
// Place and size the child
@@ -2929,17 +2929,17 @@ nsTableFrame::SetupHeaderFooterChild(con
// XXX check for containerSize.* == NS_UNCONSTRAINEDSIZE
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
ReflowInput kidReflowState(presContext, aReflowState.reflowState,
aFrame, availSize, nullptr,
ReflowInput::CALLER_WILL_INIT);
InitChildReflowState(kidReflowState);
kidReflowState.mFlags.mIsTopOfPage = true;
- nsHTMLReflowMetrics desiredSize(aReflowState.reflowState);
+ ReflowOutput desiredSize(aReflowState.reflowState);
desiredSize.ClearSize();
nsReflowStatus status;
ReflowChild(aFrame, presContext, desiredSize, kidReflowState,
wm, LogicalPoint(wm, aReflowState.iCoord, aReflowState.bCoord),
containerSize, 0, status);
// The child will be reflowed again "for real" so no need to place it now
aFrame->SetRepeatable(IsRepeatable(desiredSize.Height(), pageHeight));
@@ -2967,17 +2967,17 @@ nsTableFrame::PlaceRepeatedFooter(TableR
ReflowInput::CALLER_WILL_INIT);
InitChildReflowState(footerReflowState);
aReflowState.bCoord += GetRowSpacing(GetRowCount());
nsRect origTfootRect = aTfoot->GetRect();
nsRect origTfootVisualOverflow = aTfoot->GetVisualOverflowRect();
nsReflowStatus footerStatus;
- nsHTMLReflowMetrics desiredSize(aReflowState.reflowState);
+ ReflowOutput desiredSize(aReflowState.reflowState);
desiredSize.ClearSize();
LogicalPoint kidPosition(wm, aReflowState.iCoord, aReflowState.bCoord);
ReflowChild(aTfoot, presContext, desiredSize, footerReflowState,
wm, kidPosition, containerSize, 0, footerStatus);
footerReflowState.ApplyRelativePositioning(&kidPosition, containerSize);
PlaceChild(aReflowState, aTfoot,
// We subtract desiredSize.PhysicalSize() from containerSize here
@@ -3089,17 +3089,17 @@ nsTableFrame::ReflowChildren(TableReflow
kidAvailSize.BSize(wm) -= footerHeight + cellSpacingB;
}
}
}
nsRect oldKidRect = kidFrame->GetRect();
nsRect oldKidVisualOverflow = kidFrame->GetVisualOverflowRect();
- nsHTMLReflowMetrics desiredSize(aReflowState.reflowState);
+ ReflowOutput desiredSize(aReflowState.reflowState);
desiredSize.ClearSize();
// Reflow the child into the available space
ReflowInput kidReflowState(presContext, aReflowState.reflowState,
kidFrame,
kidAvailSize,
nullptr,
ReflowInput::CALLER_WILL_INIT);
@@ -3289,17 +3289,17 @@ nsTableFrame::ReflowChildren(TableReflow
mBits.mResizedColumns = false;
ClearGeometryDirty();
}
void
nsTableFrame::ReflowColGroups(nsRenderingContext *aRenderingContext)
{
if (!GetPrevInFlow() && !HaveReflowedColGroups()) {
- nsHTMLReflowMetrics kidMet(GetWritingMode());
+ ReflowOutput kidMet(GetWritingMode());
nsPresContext *presContext = PresContext();
for (nsIFrame* kidFrame : mColGroups) {
if (NS_SUBTREE_DIRTY(kidFrame)) {
// The column groups don't care about dimensions or reflow states.
ReflowInput
kidReflowState(presContext, kidFrame, aRenderingContext,
LogicalSize(kidFrame->GetWritingMode()));
nsReflowStatus cgStatus;
@@ -3309,17 +3309,17 @@ nsTableFrame::ReflowColGroups(nsRenderin
}
}
SetHaveReflowedColGroups(true);
}
}
void
nsTableFrame::CalcDesiredBSize(const ReflowInput& aReflowState,
- nsHTMLReflowMetrics& aDesiredSize)
+ ReflowOutput& aDesiredSize)
{
WritingMode wm = aReflowState.GetWritingMode();
nsTableCellMap* cellMap = GetCellMap();
if (!cellMap) {
NS_ERROR("never ever call me until the cell map is built!");
aDesiredSize.BSize(wm) = 0;
return;
}
@@ -3373,24 +3373,24 @@ nsTableFrame::CalcDesiredBSize(const Ref
}
static
void ResizeCells(nsTableFrame& aTableFrame)
{
nsTableFrame::RowGroupArray rowGroups;
aTableFrame.OrderRowGroups(rowGroups);
WritingMode wm = aTableFrame.GetWritingMode();
- nsHTMLReflowMetrics tableDesiredSize(wm);
+ ReflowOutput tableDesiredSize(wm);
tableDesiredSize.SetSize(wm, aTableFrame.GetLogicalSize(wm));
tableDesiredSize.SetOverflowAreasToDesiredBounds();
for (uint32_t rgIdx = 0; rgIdx < rowGroups.Length(); rgIdx++) {
nsTableRowGroupFrame* rgFrame = rowGroups[rgIdx];
- nsHTMLReflowMetrics groupDesiredSize(wm);
+ ReflowOutput groupDesiredSize(wm);
groupDesiredSize.SetSize(wm, rgFrame->GetLogicalSize(wm));
groupDesiredSize.SetOverflowAreasToDesiredBounds();
nsTableRowFrame* rowFrame = rgFrame->GetFirstRow();
while (rowFrame) {
rowFrame->DidResize();
rgFrame->ConsiderChildOverflow(groupDesiredSize.mOverflowAreas, rowFrame);
rowFrame = rowFrame->GetNextRow();
--- a/layout/tables/nsTableFrame.h
+++ b/layout/tables/nsTableFrame.h
@@ -364,21 +364,21 @@ public:
* set mFirstPassValid to true
* do pass 2
* use column widths to Reflow cells
* </pre>
*
* @see nsIFrame::Reflow
*/
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
- void ReflowTable(nsHTMLReflowMetrics& aDesiredSize,
+ void ReflowTable(ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nscoord aAvailBSize,
nsIFrame*& aLastChildReflowed,
nsReflowStatus& aStatus);
nsFrameList& GetColGroups();
virtual nsStyleContext*
@@ -649,27 +649,27 @@ protected:
const LogicalMargin& aBorderPadding);
/** Adjust the table for visibility.collapse set on rowgroups, rows,
* colgroups and cols
* @param aDesiredSize the metrics of the table
* @param aBorderPadding the border and padding of the table
*/
- void AdjustForCollapsingRowsCols(nsHTMLReflowMetrics& aDesiredSize,
+ void AdjustForCollapsingRowsCols(ReflowOutput& aDesiredSize,
const WritingMode aWM,
const LogicalMargin& aBorderPadding);
/** FixupPositionedTableParts is called at the end of table reflow to reflow
* the absolutely positioned descendants of positioned table parts. This is
* necessary because the dimensions of table parts may change after they've
* been reflowed (e.g. in AdjustForCollapsingRowsCols).
*/
void FixupPositionedTableParts(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState);
// Clears the list of positioned table parts.
void ClearAllPositionedTableParts();
nsITableLayoutStrategy* LayoutStrategy() const {
return static_cast<nsTableFrame*>(FirstInFlow())->
mTableLayoutStrategy;
@@ -693,27 +693,27 @@ public:
nscoord CalcBorderBoxBSize(const ReflowInput& aReflowState);
protected:
// update the desired block-size of this table taking into account the current
// reflow state, the table attributes and the content driven rowgroup bsizes
// this function can change the overflow area
void CalcDesiredBSize(const ReflowInput& aReflowState,
- nsHTMLReflowMetrics& aDesiredSize);
+ ReflowOutput& aDesiredSize);
// The following is a helper for CalcDesiredBSize
void DistributeBSizeToRows(const ReflowInput& aReflowState,
nscoord aAmount);
void PlaceChild(TableReflowInput& aReflowState,
nsIFrame* aKidFrame,
nsPoint aKidPosition,
- nsHTMLReflowMetrics& aKidDesiredSize,
+ ReflowOutput& aKidDesiredSize,
const nsRect& aOriginalKidRect,
const nsRect& aOriginalKidVisualOverflow);
void PlaceRepeatedFooter(TableReflowInput& aReflowState,
nsTableRowGroupFrame *aTfoot,
nscoord aFooterHeight);
nsIFrame* GetFirstBodyRowGroupFrame();
public:
--- a/layout/tables/nsTableRowFrame.cpp
+++ b/layout/tables/nsTableRowFrame.cpp
@@ -321,17 +321,17 @@ nsTableRowFrame::GetFirstCell()
*/
void
nsTableRowFrame::DidResize()
{
// Resize and re-align the cell frames based on our row bsize
nsTableFrame* tableFrame = GetTableFrame();
WritingMode wm = GetWritingMode();
- nsHTMLReflowMetrics desiredSize(wm);
+ ReflowOutput desiredSize(wm);
desiredSize.SetSize(wm, GetLogicalSize(wm));
desiredSize.SetOverflowAreasToDesiredBounds();
nsSize containerSize = mRect.Size();
for (nsIFrame* childFrame : mFrames) {
nsTableCellFrame *cellFrame = do_QueryFrame(childFrame);
if (cellFrame) {
@@ -780,17 +780,17 @@ nscoord CalcBSizeFromUnpaginatedBSize(ns
bsize -= prevInFlow->BSize(aWM);
}
}
return std::max(bsize, 0);
}
void
nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsTableFrame& aTableFrame,
nsReflowStatus& aStatus)
{
aStatus = NS_FRAME_COMPLETE;
// XXXldb Should we be checking constrained bsize instead?
const bool isPaginated = aPresContext->IsPaginated();
@@ -817,17 +817,17 @@ nsTableRowFrame::ReflowChildren(nsPresCo
NS_NOTREACHED("yikes, a non-row child");
// it's an unknown frame type, give it a generic reflow and ignore the results
TableCellReflowInput
kidReflowState(aPresContext, aReflowState, kidFrame,
LogicalSize(kidFrame->GetWritingMode(), 0, 0),
ReflowInput::CALLER_WILL_INIT);
InitChildReflowState(*aPresContext, LogicalSize(wm), false, kidReflowState);
- nsHTMLReflowMetrics desiredSize(aReflowState);
+ ReflowOutput desiredSize(aReflowState);
nsReflowStatus status;
ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState, 0, 0, 0, status);
kidFrame->DidReflow(aPresContext, nullptr, nsDidReflowStatus::FINISHED);
continue;
}
// See if we should only reflow the dirty child frames
@@ -882,17 +882,17 @@ nsTableRowFrame::ReflowChildren(nsPresCo
bool firstReflow = kidFrame->HasAnyStateBits(NS_FRAME_FIRST_REFLOW);
if (doReflowChild) {
// Calculate the available isize for the table cell using the known
// column isizes
nscoord availCellISize = CalcAvailISize(aTableFrame, *cellFrame);
Maybe<TableCellReflowInput> kidReflowState;
- nsHTMLReflowMetrics desiredSize(aReflowState);
+ ReflowOutput desiredSize(aReflowState);
// If the avail isize is not the same as last time we reflowed the cell or
// the cell wants to be bigger than what was available last time or
// it is a style change reflow or we are printing, then we must reflow the
// cell. Otherwise we can skip the reflow.
// XXXldb Why is this condition distinct from doReflowChild above?
WritingMode wm = aReflowState.GetWritingMode();
NS_ASSERTION(cellFrame->GetWritingMode() == wm,
@@ -1075,17 +1075,17 @@ nsTableRowFrame::ReflowChildren(nsPresCo
FinishAndStoreOverflow(&aDesiredSize);
}
/** Layout the entire row.
* This method stacks cells in the inline dir according to HTML 4.0 rules.
*/
void
nsTableRowFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsTableRowFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
WritingMode wm = aReflowState.GetWritingMode();
@@ -1155,17 +1155,17 @@ nsTableRowFrame::ReflowCellFrame(nsPresC
NS_ASSERTION(aCellFrame->GetWritingMode() == wm,
"expected consistent writing-mode within table");
TableCellReflowInput
cellReflowState(aPresContext, aReflowState, aCellFrame, availSize,
ReflowInput::CALLER_WILL_INIT);
InitChildReflowState(*aPresContext, availSize, borderCollapse, cellReflowState);
cellReflowState.mFlags.mIsTopOfPage = aIsTopOfPage;
- nsHTMLReflowMetrics desiredSize(aReflowState);
+ ReflowOutput desiredSize(aReflowState);
ReflowChild(aCellFrame, aPresContext, desiredSize, cellReflowState,
0, 0, NS_FRAME_NO_MOVE_FRAME, aStatus);
bool fullyComplete = NS_FRAME_IS_COMPLETE(aStatus) && !NS_FRAME_IS_TRUNCATED(aStatus);
if (fullyComplete) {
desiredSize.BSize(wm) = aAvailableBSize;
}
aCellFrame->SetSize(wm, LogicalSize(wm, cellSize.ISize(wm),
--- a/layout/tables/nsTableRowFrame.h
+++ b/layout/tables/nsTableRowFrame.h
@@ -94,17 +94,17 @@ public:
* @param aDesiredSize width set to width of the sum of the cells, height set to
* height of cells with rowspan=1.
*
* @see nsIFrame::Reflow
* @see nsTableFrame::BalanceColumnWidths
* @see nsTableFrame::ShrinkWrapChildren
*/
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
void DidResize();
/**
* Get the "type" of the frame
*
@@ -274,17 +274,17 @@ protected:
nscoord ComputeCellXOffset(const ReflowInput& aState,
nsIFrame* aKidFrame,
const nsMargin& aKidMargin) const;
/**
* Called for incremental/dirty and resize reflows. If aDirtyOnly is true then
* only reflow dirty cells.
*/
void ReflowChildren(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsTableFrame& aTableFrame,
nsReflowStatus& aStatus);
private:
struct RowBits {
unsigned mRowIndex:29;
unsigned mHasFixedBSize:1; // set if the dominating style bsize on the row or any cell is pixel based
--- a/layout/tables/nsTableRowGroupFrame.cpp
+++ b/layout/tables/nsTableRowGroupFrame.cpp
@@ -285,17 +285,17 @@ nsTableRowGroupFrame::GetLogicalSkipSide
// Position and size aKidFrame and update our reflow state.
void
nsTableRowGroupFrame::PlaceChild(nsPresContext* aPresContext,
TableRowGroupReflowInput& aReflowState,
nsIFrame* aKidFrame,
WritingMode aWM,
const LogicalPoint& aKidPosition,
const nsSize& aContainerSize,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const nsRect& aOriginalKidRect,
const nsRect& aOriginalKidVisualOverflow)
{
bool isFirstReflow = aKidFrame->HasAnyStateBits(NS_FRAME_FIRST_REFLOW);
// Place and size the child
FinishReflowChild(aKidFrame, aPresContext, aDesiredSize, nullptr,
aWM, aKidPosition, aContainerSize, 0);
@@ -342,17 +342,17 @@ CacheRowBSizesForPrinting(nsPresContext*
row->SetHasUnpaginatedBSize(true);
row->SetUnpaginatedBSize(aPresContext, row->BSize(aWM));
}
}
}
void
nsTableRowGroupFrame::ReflowChildren(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
TableRowGroupReflowInput& aReflowState,
nsReflowStatus& aStatus,
bool* aPageBreakBeforeEnd)
{
if (aPageBreakBeforeEnd) {
*aPageBreakBeforeEnd = false;
}
@@ -395,17 +395,17 @@ nsTableRowGroupFrame::ReflowChildren(nsP
(aReflowState.reflowState.mFlags.mSpecialBSizeReflow &&
(isPaginated ||
kidFrame->HasAnyStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE)))) {
LogicalRect oldKidRect = kidFrame->GetLogicalRect(wm, containerSize);
nsRect oldKidVisualOverflow = kidFrame->GetVisualOverflowRect();
// XXXldb We used to only pass aDesiredSize.mFlags through for the
// incremental reflow codepath.
- nsHTMLReflowMetrics desiredSize(aReflowState.reflowState,
+ ReflowOutput desiredSize(aReflowState.reflowState,
aDesiredSize.mFlags);
desiredSize.ClearSize();
// Reflow the child into the available space, giving it as much bsize as
// it wants. We'll deal with splitting later after we've computed the row
// bsizes, taking into account cells with row spans...
LogicalSize kidAvailSize = aReflowState.availSize;
kidAvailSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
@@ -535,17 +535,17 @@ UpdateBSizes(RowInfo& aRowInfo,
aRowInfo.bSize += aAdditionalBSize;
aTotal += aAdditionalBSize;
if (!aRowInfo.hasStyleBSize) {
aUnconstrainedTotal += aAdditionalBSize;
}
}
void
-nsTableRowGroupFrame::DidResizeRows(nsHTMLReflowMetrics& aDesiredSize)
+nsTableRowGroupFrame::DidResizeRows(ReflowOutput& aDesiredSize)
{
// Update the cells spanning rows with their new bsizes.
// This is the place where all of the cells in the row get set to the bsize
// of the row.
// Reset the overflow area.
aDesiredSize.mOverflowAreas.Clear();
for (nsTableRowFrame* rowFrame = GetFirstRow();
rowFrame; rowFrame = rowFrame->GetNextRow()) {
@@ -556,17 +556,17 @@ nsTableRowGroupFrame::DidResizeRows(nsHT
// This calculates the bsize of all the rows and takes into account
// style bsize on the row group, style bsizes on rows and cells, style bsizes on rowspans.
// Actual row bsizes will be adjusted later if the table has a style bsize.
// Even if rows don't change bsize, this method must be called to set the bsizes of each
// cell in the row to the bsize of its row.
void
nsTableRowGroupFrame::CalculateRowBSizes(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState)
{
nsTableFrame* tableFrame = GetTableFrame();
const bool isPaginated = aPresContext->IsPaginated();
int32_t numEffCols = tableFrame->GetEffectiveColCount();
int32_t startRowIndex = GetStartRowIndex();
@@ -1090,17 +1090,17 @@ GetRowBefore(nsTableRowFrame& aStartRow,
for (nsTableRowFrame* sib = &aStartRow; sib && (sib != &aRow); sib = sib->GetNextRow()) {
rowBefore = sib;
}
return rowBefore;
}
nsresult
nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsTableFrame* aTableFrame,
nsReflowStatus& aStatus,
bool aRowForcedPageBreak)
{
NS_PRECONDITION(aPresContext->IsPaginated(), "SplitRowGroup currently supports only paged media");
nsTableRowFrame* prevRowFrame = nullptr;
@@ -1143,17 +1143,17 @@ nsTableRowGroupFrame::SplitRowGroup(nsPr
ReflowInput rowReflowState(aPresContext, aReflowState, rowFrame,
LogicalSize(rowFrame->GetWritingMode(),
availSize),
nullptr,
ReflowInput::CALLER_WILL_INIT);
InitChildReflowState(*aPresContext, borderCollapse, rowReflowState);
rowReflowState.mFlags.mIsTopOfPage = isTopOfPage; // set top of page
- nsHTMLReflowMetrics rowMetrics(aReflowState);
+ ReflowOutput rowMetrics(aReflowState);
// Get the old size before we reflow.
nsRect oldRowRect = rowFrame->GetRect();
nsRect oldRowVisualOverflow = rowFrame->GetVisualOverflowRect();
// Reflow the cell with the constrained height. A cell with rowspan >1 will get this
// reflow later during SplitSpanningCells.
ReflowChild(rowFrame, aPresContext, rowMetrics, rowReflowState,
@@ -1338,17 +1338,17 @@ nsTableRowGroupFrame::SplitRowGroup(nsPr
}
/** Layout the entire row group.
* This method stacks rows vertically according to HTML 4.0 rules.
* Rows are responsible for layout of their children.
*/
void
nsTableRowGroupFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsTableRowGroupFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
aStatus = NS_FRAME_COMPLETE;
--- a/layout/tables/nsTableRowGroupFrame.h
+++ b/layout/tables/nsTableRowGroupFrame.h
@@ -84,17 +84,17 @@ public:
* <P> rows are not split unless absolutely necessary.
*
* @param aDesiredSize isize set to isize of rows, bsize set to
* sum of bsize of rows that fit in AvailableBSize.
*
* @see nsIFrame::Reflow
*/
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual bool ComputeCustomOverflow(nsOverflowAreas& aOverflowAreas) override;
/**
* Get the "type" of the frame
*
@@ -330,43 +330,43 @@ protected:
virtual LogicalSides GetLogicalSkipSides(const ReflowInput* aReflowState = nullptr) const override;
void PlaceChild(nsPresContext* aPresContext,
TableRowGroupReflowInput& aReflowState,
nsIFrame* aKidFrame,
mozilla::WritingMode aWM,
const mozilla::LogicalPoint& aKidPosition,
const nsSize& aContainerSize,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const nsRect& aOriginalKidRect,
const nsRect& aOriginalKidVisualOverflow);
void CalculateRowBSizes(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState);
- void DidResizeRows(nsHTMLReflowMetrics& aDesiredSize);
+ void DidResizeRows(ReflowOutput& aDesiredSize);
void SlideChild(TableRowGroupReflowInput& aReflowState,
nsIFrame* aKidFrame);
/**
* Reflow the frames we've already created
*
* @param aPresContext presentation context to use
* @param aReflowState current inline state
*/
void ReflowChildren(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
TableRowGroupReflowInput& aReflowState,
nsReflowStatus& aStatus,
bool* aPageBreakBeforeEnd = nullptr);
nsresult SplitRowGroup(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsTableFrame* aTableFrame,
nsReflowStatus& aStatus,
bool aRowForcedPageBreak);
void SplitSpanningCells(nsPresContext& aPresContext,
const ReflowInput& aReflowState,
nsTableFrame& aTableFrame,
--- a/layout/tables/nsTableWrapperFrame.cpp
+++ b/layout/tables/nsTableWrapperFrame.cpp
@@ -774,17 +774,17 @@ nsTableWrapperFrame::OuterBeginReflowChi
}
}
}
void
nsTableWrapperFrame::OuterDoReflowChild(nsPresContext* aPresContext,
nsIFrame* aChildFrame,
const ReflowInput& aChildRS,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
nsReflowStatus& aStatus)
{
// Using zero as containerSize here because we want consistency between
// the GetLogicalPosition and ReflowChild calls, to avoid unnecessarily
// changing the frame's coordinates; but we don't yet know its final
// position anyway so the actual value is unimportant.
const nsSize zeroCSize;
WritingMode wm = aChildRS.GetWritingMode();
@@ -802,28 +802,28 @@ nsTableWrapperFrame::OuterDoReflowChild(
flags |= NS_FRAME_NO_DELETE_NEXT_IN_FLOW_CHILD;
}
ReflowChild(aChildFrame, aPresContext, aMetrics, aChildRS,
wm, childPt, zeroCSize, flags, aStatus);
}
void
-nsTableWrapperFrame::UpdateOverflowAreas(nsHTMLReflowMetrics& aMet)
+nsTableWrapperFrame::UpdateOverflowAreas(ReflowOutput& aMet)
{
aMet.SetOverflowAreasToDesiredBounds();
ConsiderChildOverflow(aMet.mOverflowAreas, InnerTableFrame());
if (mCaptionFrames.NotEmpty()) {
ConsiderChildOverflow(aMet.mOverflowAreas, mCaptionFrames.FirstChild());
}
}
void
nsTableWrapperFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aOuterRS,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsTableWrapperFrame");
DISPLAY_REFLOW(aPresContext, this, aOuterRS, aDesiredSize, aStatus);
// Initialize out parameters
@@ -905,17 +905,17 @@ nsTableWrapperFrame::Reflow(nsPresContex
OuterBeginReflowChild(aPresContext, mCaptionFrames.FirstChild(),
aOuterRS, captionRS,
aOuterRS.ComputedSize(captionWM).ISize(captionWM));
OuterBeginReflowChild(aPresContext, InnerTableFrame(), aOuterRS,
innerRS, aOuterRS.ComputedSize(wm).ISize(wm));
}
// First reflow the caption.
- Maybe<nsHTMLReflowMetrics> captionMet;
+ Maybe<ReflowOutput> captionMet;
LogicalSize captionSize(wm);
LogicalMargin captionMargin(wm);
if (mCaptionFrames.NotEmpty()) {
captionMet.emplace(wm);
nsReflowStatus capStatus; // don't let the caption cause incomplete
OuterDoReflowChild(aPresContext, mCaptionFrames.FirstChild(),
*captionRS, *captionMet, capStatus);
captionSize.ISize(wm) = captionMet->ISize(wm);
@@ -937,17 +937,17 @@ nsTableWrapperFrame::Reflow(nsPresContex
}
innerRS->AvailableBSize() =
std::max(0, innerRS->AvailableBSize() - captionBSize);
}
}
// Then, now that we know how much to reduce the isize of the inner
// table to account for side captions, reflow the inner table.
- nsHTMLReflowMetrics innerMet(innerRS->GetWritingMode());
+ ReflowOutput innerMet(innerRS->GetWritingMode());
OuterDoReflowChild(aPresContext, InnerTableFrame(), *innerRS,
innerMet, aStatus);
LogicalSize innerSize(wm, innerMet.ISize(wm), innerMet.BSize(wm));
LogicalMargin innerMargin = innerRS->ComputedLogicalMargin();
LogicalSize containSize(wm, GetContainingBlockSize(aOuterRS));
// Now that we've reflowed both we can place them.
--- a/layout/tables/nsTableWrapperFrame.h
+++ b/layout/tables/nsTableWrapperFrame.h
@@ -80,17 +80,17 @@ public:
const mozilla::LogicalSize& aBorder,
const mozilla::LogicalSize& aPadding,
bool aShrinkWrap) override;
/** process a reflow command for the table.
* This involves reflowing the caption and the inner table.
* @see nsIFrame::Reflow */
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
/**
* Get the "type" of the frame
*
* @see nsGkAtoms::tableWrapperFrame
*/
@@ -233,21 +233,21 @@ protected:
nsIFrame* aChildFrame,
const ReflowInput& aOuterRS,
mozilla::Maybe<ReflowInput>& aChildRS,
nscoord aAvailISize);
void OuterDoReflowChild(nsPresContext* aPresContext,
nsIFrame* aChildFrame,
const ReflowInput& aChildRS,
- nsHTMLReflowMetrics& aMetrics,
+ ReflowOutput& aMetrics,
nsReflowStatus& aStatus);
// Set the overflow areas in our reflow metrics
- void UpdateOverflowAreas(nsHTMLReflowMetrics& aMet);
+ void UpdateOverflowAreas(ReflowOutput& aMet);
// Get the margin.
void GetChildMargin(nsPresContext* aPresContext,
const ReflowInput& aOuterRS,
nsIFrame* aChildFrame,
nscoord aAvailableWidth,
mozilla::LogicalMargin& aMargin);
--- a/layout/xul/nsBoxFrame.cpp
+++ b/layout/xul/nsBoxFrame.cpp
@@ -624,17 +624,17 @@ nsBoxFrame::GetPrefISize(nsRenderingCont
result = prefSize.width - bp.LeftRight();
result = std::max(result, 0);
return result;
}
void
nsBoxFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
MarkInReflow();
// If you make changes to this method, please keep nsLeafBoxFrame::Reflow
// in sync, if the changes are applicable there.
DO_GLOBAL_REFLOW_COUNT("nsBoxFrame");
@@ -919,17 +919,17 @@ nsBoxFrame::DoXULLayout(nsBoxLayoutState
// Set up a |reflowState| to pass into ReflowAbsoluteFrames
WritingMode wm = GetWritingMode();
ReflowInput reflowState(aState.PresContext(), this,
aState.GetRenderingContext(),
LogicalSize(wm, GetLogicalSize().ISize(wm),
NS_UNCONSTRAINEDSIZE));
// Set up a |desiredSize| to pass into ReflowAbsoluteFrames
- nsHTMLReflowMetrics desiredSize(reflowState);
+ ReflowOutput desiredSize(reflowState);
desiredSize.Width() = mRect.width;
desiredSize.Height() = mRect.height;
// get the ascent (cribbed from ::Reflow)
nscoord ascent = mRect.height;
// getting the ascent could be a lot of work. Don't get it if
// we are the root. The viewport doesn't care about it.
--- a/layout/xul/nsBoxFrame.h
+++ b/layout/xul/nsBoxFrame.h
@@ -89,17 +89,17 @@ public:
nsIAtom* aAttribute,
int32_t aModType) override;
virtual void MarkIntrinsicISizesDirty() override;
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual void SetInitialChildList(ChildListID aListID,
nsFrameList& aChildList) override;
virtual void AppendFrames(ChildListID aListID,
nsFrameList& aFrameList) override;
virtual void InsertFrames(ChildListID aListID,
--- a/layout/xul/nsLeafBoxFrame.cpp
+++ b/layout/xul/nsLeafBoxFrame.cpp
@@ -187,17 +187,17 @@ nsLeafBoxFrame::ComputeAutoSize(nsRender
// Important: NOT calling our direct superclass here!
return nsFrame::ComputeAutoSize(aRenderingContext, aWM,
aCBSize, aAvailableISize,
aMargin, aBorder, aPadding, aShrinkWrap);
}
void
nsLeafBoxFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
// This is mostly a copy of nsBoxFrame::Reflow().
// We aren't able to share an implementation because of the frame
// class hierarchy. If you make changes here, please keep
// nsBoxFrame::Reflow in sync.
--- a/layout/xul/nsLeafBoxFrame.h
+++ b/layout/xul/nsLeafBoxFrame.h
@@ -48,17 +48,17 @@ public:
const mozilla::LogicalSize& aCBSize,
nscoord aAvailableISize,
const mozilla::LogicalSize& aMargin,
const mozilla::LogicalSize& aBorder,
const mozilla::LogicalSize& aPadding,
bool aShrinkWrap) override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual nsresult CharacterDataChanged(CharacterDataChangeInfo* aInfo) override;
virtual void Init(nsIContent* aContent,
nsContainerFrame* aParent,
nsIFrame* asPrevInFlow) override;
--- a/layout/xul/nsRootBoxFrame.cpp
+++ b/layout/xul/nsRootBoxFrame.cpp
@@ -62,17 +62,17 @@ public:
nsFrameList& aFrameList) override;
virtual void InsertFrames(ChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList) override;
virtual void RemoveFrame(ChildListID aListID,
nsIFrame* aOldFrame) override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual nsresult HandleEvent(nsPresContext* aPresContext,
WidgetGUIEvent* aEvent,
nsEventStatus* aEventStatus) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
@@ -156,17 +156,17 @@ nsRootBoxFrame::RemoveFrame(ChildListID
}
#ifdef DEBUG_REFLOW
int32_t gReflows = 0;
#endif
void
nsRootBoxFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
DO_GLOBAL_REFLOW_COUNT("nsRootBoxFrame");
#ifdef DEBUG_REFLOW
gReflows++;
printf("----Reflow %d----\n", gReflows);
--- a/layout/xul/nsScrollbarFrame.cpp
+++ b/layout/xul/nsScrollbarFrame.cpp
@@ -51,17 +51,17 @@ nsScrollbarFrame::Init(nsIContent*
// slider. Any reflow inside the scrollbar frame will be a reflow to
// move the slider and will thus not change anything outside of the
// scrollbar or change the size of the scrollbar frame.
mState |= NS_FRAME_REFLOW_ROOT;
}
void
nsScrollbarFrame::Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus)
{
nsBoxFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
// nsGfxScrollFrame may have told us to shrink to nothing. If so, make sure our
// desired size agrees.
if (aReflowState.AvailableWidth() == 0) {
--- a/layout/xul/nsScrollbarFrame.h
+++ b/layout/xul/nsScrollbarFrame.h
@@ -56,17 +56,17 @@ public:
mozilla::WidgetGUIEvent* aEvent,
nsEventStatus* aEventStatus) override;
virtual void Init(nsIContent* aContent,
nsContainerFrame* aParent,
nsIFrame* aPrevInFlow) override;
virtual void Reflow(nsPresContext* aPresContext,
- nsHTMLReflowMetrics& aDesiredSize,
+ ReflowOutput& aDesiredSize,
const ReflowInput& aReflowState,
nsReflowStatus& aStatus) override;
virtual nsIAtom* GetType() const override;
void SetScrollbarMediatorContent(nsIContent* aMediator);
nsIScrollbarMediator* GetScrollbarMediator();