Skip to content

Commit

Permalink
Bug 1466448 - Part 2: Remove unused ReflowOutput::mFlags. r=mats
Browse files Browse the repository at this point in the history
--HG--
extra : rebase_source : 41f141ad1f9830c45a4a11cab825ea3d956051ea
  • Loading branch information
heycam committed Jun 4, 2018
1 parent 51296f8 commit 3cd117e
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 40 deletions.
3 changes: 1 addition & 2 deletions layout/forms/nsFieldSetFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,7 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
std::max(0, aReflowInput.ComputedMaxBSize() - mLegendSpace);
}

ReflowOutput kidDesiredSize(kidReflowInput,
aDesiredSize.mFlags);
ReflowOutput kidDesiredSize(kidReflowInput);
// Reflow the frame
NS_ASSERTION(kidReflowInput.ComputedPhysicalMargin() == nsMargin(0,0,0,0),
"Margins on anonymous fieldset child not supported!");
Expand Down
9 changes: 2 additions & 7 deletions layout/generic/ReflowOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,8 @@ nsOverflowAreas::SetAllTo(const nsRect& aRect)

namespace mozilla {

ReflowOutput::ReflowOutput(const ReflowInput& aReflowInput,
uint32_t aFlags)
: mISize(0)
, mBSize(0)
, mBlockStartAscent(ASK_FOR_BASELINE)
, mFlags(aFlags)
, mWritingMode(aReflowInput.GetWritingMode())
ReflowOutput::ReflowOutput(const ReflowInput& aReflowInput)
: ReflowOutput(aReflowInput.GetWritingMode())
{
}

Expand Down
19 changes: 4 additions & 15 deletions layout/generic/ReflowOutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,21 +200,15 @@ namespace mozilla {
*/
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 ReflowOutput(mozilla::WritingMode aWritingMode, uint32_t aFlags = 0)
explicit ReflowOutput(mozilla::WritingMode aWritingMode)
: mISize(0)
, mBSize(0)
, mBlockStartAscent(ASK_FOR_BASELINE)
, mFlags(aFlags)
, mWritingMode(aWritingMode)
{}
{
}

explicit ReflowOutput(const ReflowInput& aState, uint32_t aFlags = 0);
explicit ReflowOutput(const ReflowInput& aReflowInput);

// ISize and BSize are logical-coordinate dimensions:
// ISize is the size in the writing mode's inline direction (which equates to
Expand Down Expand Up @@ -328,11 +322,6 @@ class ReflowOutput {
private:
nscoord mISize, mBSize; // [OUT] desired width and height (border-box)
nscoord mBlockStartAscent; // [OUT] baseline (in Block direction), or ASK_FOR_BASELINE

public:
uint32_t mFlags;

private:
mozilla::WritingMode mWritingMode;
};

Expand Down
2 changes: 1 addition & 1 deletion layout/generic/nsColumnSetFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ nsColumnSetFrame::ReflowChildren(ReflowOutput& aDesiredSize,
kidReflowInput.mFlags.mNextInFlowUntouched = true;
}

ReflowOutput kidDesiredSize(wm, aDesiredSize.mFlags);
ReflowOutput kidDesiredSize(wm);

// XXX it would be cool to consult the float manager for the
// previous block to figure out the region of floats from the
Expand Down
2 changes: 1 addition & 1 deletion layout/generic/nsGfxScrollFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ void
nsHTMLScrollFrame::ReflowContents(ScrollReflowInput* aState,
const ReflowOutput& aDesiredSize)
{
ReflowOutput kidDesiredSize(aDesiredSize.GetWritingMode(), aDesiredSize.mFlags);
ReflowOutput kidDesiredSize(aDesiredSize.GetWritingMode());
ReflowScrolledFrame(aState, GuessHScrollbarNeeded(*aState),
GuessVScrollbarNeeded(*aState), &kidDesiredSize, true);

Expand Down
2 changes: 1 addition & 1 deletion layout/generic/nsHTMLCanvasFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ nsHTMLCanvasFrame::Reflow(nsPresContext* aPresContext,
LogicalSize availSize = aReflowInput.ComputedSize(childWM);
availSize.BSize(childWM) = NS_UNCONSTRAINEDSIZE;
NS_ASSERTION(!childFrame->GetNextSibling(), "HTML canvas should have 1 kid");
ReflowOutput childDesiredSize(aReflowInput.GetWritingMode(), aMetrics.mFlags);
ReflowOutput childDesiredSize(aReflowInput.GetWritingMode());
ReflowInput childReflowInput(aPresContext, aReflowInput, childFrame,
availSize);
ReflowChild(childFrame, aPresContext, childDesiredSize, childReflowInput,
Expand Down
3 changes: 1 addition & 2 deletions layout/mathml/nsMathMLContainerFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -882,8 +882,7 @@ nsMathMLContainerFrame::Reflow(nsPresContext* aPresContext,
nsReflowStatus childStatus;
nsIFrame* childFrame = mFrames.FirstChild();
while (childFrame) {
ReflowOutput childDesiredSize(aReflowInput, // ???
aDesiredSize.mFlags);
ReflowOutput childDesiredSize(aReflowInput);
WritingMode wm = childFrame->GetWritingMode();
LogicalSize availSize = aReflowInput.ComputedSize(wm);
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
Expand Down
3 changes: 1 addition & 2 deletions layout/mathml/nsMathMLTokenFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@ nsMathMLTokenFrame::Reflow(nsPresContext* aPresContext,

for (nsIFrame* childFrame : PrincipalChildList()) {
// ask our children to compute their bounding metrics
ReflowOutput childDesiredSize(aReflowInput.GetWritingMode(),
aDesiredSize.mFlags);
ReflowOutput childDesiredSize(aReflowInput.GetWritingMode());
WritingMode wm = childFrame->GetWritingMode();
LogicalSize availSize = aReflowInput.ComputedSize(wm);
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
Expand Down
3 changes: 1 addition & 2 deletions layout/mathml/nsMathMLmfencedFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,7 @@ nsMathMLmfencedFrame::Reflow(nsPresContext* aPresContext,
descent = fm->MaxDescent();
}
while (childFrame) {
ReflowOutput childDesiredSize(aReflowInput,
aDesiredSize.mFlags);
ReflowOutput childDesiredSize(aReflowInput);
WritingMode wm = childFrame->GetWritingMode();
LogicalSize availSize = aReflowInput.ComputedSize(wm);
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
Expand Down
3 changes: 1 addition & 2 deletions layout/mathml/nsMathMLmrootFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,7 @@ nsMathMLmrootFrame::Reflow(nsPresContext* aPresContext,
nsIFrame* childFrame = mFrames.FirstChild();
while (childFrame) {
// ask our children to compute their bounding metrics
ReflowOutput childDesiredSize(aReflowInput,
aDesiredSize.mFlags);
ReflowOutput childDesiredSize(aReflowInput);
WritingMode wm = childFrame->GetWritingMode();
LogicalSize availSize = aReflowInput.ComputedSize(wm);
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
Expand Down
2 changes: 1 addition & 1 deletion layout/tables/nsTableCellFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ nsTableCellFrame::Reflow(nsPresContext* aPresContext,
availSize.BSize(wm) = 1;
}

ReflowOutput kidSize(wm, aDesiredSize.mFlags);
ReflowOutput kidSize(wm);
kidSize.ClearSize();
SetPriorAvailISize(aReflowInput.AvailableISize());
nsIFrame* firstKid = mFrames.FirstChild();
Expand Down
5 changes: 1 addition & 4 deletions layout/tables/nsTableRowGroupFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,10 +391,7 @@ nsTableRowGroupFrame::ReflowChildren(nsPresContext* aPresContext,
LogicalRect oldKidRect = kidFrame->GetLogicalRect(wm, containerSize);
nsRect oldKidVisualOverflow = kidFrame->GetVisualOverflowRect();

// XXXldb We used to only pass aDesiredSize.mFlags through for the
// incremental reflow codepath.
ReflowOutput desiredSize(aReflowInput.reflowInput,
aDesiredSize.mFlags);
ReflowOutput desiredSize(aReflowInput.reflowInput);
desiredSize.ClearSize();

// Reflow the child into the available space, giving it as much bsize as
Expand Down

0 comments on commit 3cd117e

Please sign in to comment.