Bug 1277129 Part 7b - Rename various ReflowState variables to ReflowInput. r=dbaron
This patch is generated by the following script:
function rename() {
find .\
-type f\
! -path "./obj*"\
! -path "./.git"\
! -path "./.hg"\
\( -name "*.cpp" -or\
-name "*.h" \)\
-exec sed -i -r "s/$1/$2/g" "{}" \;
}
rename "([[:alpha:]]*)([rR])eflowState(s?)" "\1\2eflowInput\3"
MozReview-Commit-ID: ITFO7uMTkSb
This commit is contained in:
@@ -185,14 +185,14 @@ nsHTMLButtonControlFrame::GetPrefISize(nsRenderingContext* aRenderingContext)
|
||||
void
|
||||
nsHTMLButtonControlFrame::Reflow(nsPresContext* aPresContext,
|
||||
ReflowOutput& aDesiredSize,
|
||||
const ReflowInput& aReflowState,
|
||||
const ReflowInput& aReflowInput,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
MarkInReflow();
|
||||
DO_GLOBAL_REFLOW_COUNT("nsHTMLButtonControlFrame");
|
||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
||||
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
|
||||
|
||||
NS_PRECONDITION(aReflowState.ComputedISize() != NS_INTRINSICSIZE,
|
||||
NS_PRECONDITION(aReflowInput.ComputedISize() != NS_INTRINSICSIZE,
|
||||
"Should have real computed inline-size by now");
|
||||
|
||||
if (mState & NS_FRAME_FIRST_REFLOW) {
|
||||
@@ -210,14 +210,14 @@ nsHTMLButtonControlFrame::Reflow(nsPresContext* aPresContext,
|
||||
"Button's child frame has unexpected pseudo type!");
|
||||
|
||||
// XXXbz Eventually we may want to check-and-bail if
|
||||
// !aReflowState.ShouldReflowAllKids() &&
|
||||
// !aReflowInput.ShouldReflowAllKids() &&
|
||||
// !NS_SUBTREE_DIRTY(firstKid).
|
||||
// We'd need to cache our ascent for that, of course.
|
||||
|
||||
// Reflow the contents of the button.
|
||||
// (This populates our aDesiredSize, too.)
|
||||
ReflowButtonContents(aPresContext, aDesiredSize,
|
||||
aReflowState, firstKid);
|
||||
aReflowInput, firstKid);
|
||||
|
||||
if (!ShouldClipPaintingToBorderBox()) {
|
||||
ConsiderChildOverflow(aDesiredSize.mOverflowAreas, firstKid);
|
||||
@@ -227,14 +227,14 @@ nsHTMLButtonControlFrame::Reflow(nsPresContext* aPresContext,
|
||||
|
||||
aStatus = NS_FRAME_COMPLETE;
|
||||
FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize,
|
||||
aReflowState, aStatus);
|
||||
aReflowInput, aStatus);
|
||||
|
||||
// We're always complete and we don't support overflow containers
|
||||
// so we shouldn't have a next-in-flow ever.
|
||||
aStatus = NS_FRAME_COMPLETE;
|
||||
MOZ_ASSERT(!GetNextInFlow());
|
||||
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
|
||||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
|
||||
}
|
||||
|
||||
// Helper-function that lets us clone the button's reflow state, but with its
|
||||
@@ -243,22 +243,22 @@ nsHTMLButtonControlFrame::Reflow(nsPresContext* aPresContext,
|
||||
// appropriate content-box size for descendents' percent sizes to resolve
|
||||
// against.)
|
||||
static ReflowInput
|
||||
CloneReflowStateWithReducedContentBox(
|
||||
const ReflowInput& aButtonReflowState,
|
||||
CloneReflowInputWithReducedContentBox(
|
||||
const ReflowInput& aButtonReflowInput,
|
||||
const nsMargin& aFocusPadding)
|
||||
{
|
||||
nscoord adjustedWidth =
|
||||
aButtonReflowState.ComputedWidth() - aFocusPadding.LeftRight();
|
||||
aButtonReflowInput.ComputedWidth() - aFocusPadding.LeftRight();
|
||||
adjustedWidth = std::max(0, adjustedWidth);
|
||||
|
||||
// (Only adjust height if it's an actual length.)
|
||||
nscoord adjustedHeight = aButtonReflowState.ComputedHeight();
|
||||
nscoord adjustedHeight = aButtonReflowInput.ComputedHeight();
|
||||
if (adjustedHeight != NS_INTRINSICSIZE) {
|
||||
adjustedHeight -= aFocusPadding.TopBottom();
|
||||
adjustedHeight = std::max(0, adjustedHeight);
|
||||
}
|
||||
|
||||
ReflowInput clone(aButtonReflowState);
|
||||
ReflowInput clone(aButtonReflowInput);
|
||||
clone.SetComputedWidth(adjustedWidth);
|
||||
clone.SetComputedHeight(adjustedHeight);
|
||||
|
||||
@@ -268,11 +268,11 @@ CloneReflowStateWithReducedContentBox(
|
||||
void
|
||||
nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
|
||||
ReflowOutput& aButtonDesiredSize,
|
||||
const ReflowInput& aButtonReflowState,
|
||||
const ReflowInput& aButtonReflowInput,
|
||||
nsIFrame* aFirstKid)
|
||||
{
|
||||
WritingMode wm = GetWritingMode();
|
||||
LogicalSize availSize = aButtonReflowState.ComputedSize(wm);
|
||||
LogicalSize availSize = aButtonReflowInput.ComputedSize(wm);
|
||||
availSize.BSize(wm) = NS_INTRINSICSIZE;
|
||||
|
||||
// Buttons have some bonus renderer-determined border/padding,
|
||||
@@ -286,8 +286,8 @@ nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
|
||||
// focuspadding (which other browsers don't have) so that there's a
|
||||
// little more space for it.
|
||||
// Note that GetMinISize includes the focusPadding.
|
||||
nscoord IOverflow = GetMinISize(aButtonReflowState.mRenderingContext) -
|
||||
aButtonReflowState.ComputedISize();
|
||||
nscoord IOverflow = GetMinISize(aButtonReflowInput.mRenderingContext) -
|
||||
aButtonReflowInput.ComputedISize();
|
||||
nscoord IFocusPadding = focusPadding.IStartEnd(wm);
|
||||
nscoord focusPaddingReduction = std::min(IFocusPadding,
|
||||
std::max(IOverflow, 0));
|
||||
@@ -303,7 +303,7 @@ nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
|
||||
}
|
||||
|
||||
// shorthand for a value we need to use in a bunch of places
|
||||
const LogicalMargin& clbp = aButtonReflowState.ComputedLogicalBorderPadding();
|
||||
const LogicalMargin& clbp = aButtonReflowInput.ComputedLogicalBorderPadding();
|
||||
|
||||
// Indent the child inside us by the focus border. We must do this separate
|
||||
// from the regular border.
|
||||
@@ -315,16 +315,16 @@ nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
|
||||
|
||||
// Give child a clone of the button's reflow state, with height/width reduced
|
||||
// by focusPadding, so that descendants with height:100% don't protrude.
|
||||
ReflowInput adjustedButtonReflowState =
|
||||
CloneReflowStateWithReducedContentBox(aButtonReflowState,
|
||||
ReflowInput adjustedButtonReflowInput =
|
||||
CloneReflowInputWithReducedContentBox(aButtonReflowInput,
|
||||
focusPadding.GetPhysicalMargin(wm));
|
||||
|
||||
ReflowInput contentsReflowState(aPresContext,
|
||||
adjustedButtonReflowState,
|
||||
ReflowInput contentsReflowInput(aPresContext,
|
||||
adjustedButtonReflowInput,
|
||||
aFirstKid, availSize);
|
||||
|
||||
nsReflowStatus contentsReflowStatus;
|
||||
ReflowOutput contentsDesiredSize(aButtonReflowState);
|
||||
ReflowOutput contentsDesiredSize(aButtonReflowInput);
|
||||
childPos.B(wm) = 0; // This will be set properly later, after reflowing the
|
||||
// child to determine its size.
|
||||
|
||||
@@ -332,7 +332,7 @@ nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
|
||||
// repositioned later by FinishReflowChild.
|
||||
nsSize dummyContainerSize;
|
||||
ReflowChild(aFirstKid, aPresContext,
|
||||
contentsDesiredSize, contentsReflowState,
|
||||
contentsDesiredSize, contentsReflowInput,
|
||||
wm, childPos, dummyContainerSize, 0, contentsReflowStatus);
|
||||
MOZ_ASSERT(NS_FRAME_IS_COMPLETE(contentsReflowStatus),
|
||||
"We gave button-contents frame unconstrained available height, "
|
||||
@@ -340,9 +340,9 @@ nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
|
||||
|
||||
// Compute the button's content-box size:
|
||||
LogicalSize buttonContentBox(wm);
|
||||
if (aButtonReflowState.ComputedBSize() != NS_INTRINSICSIZE) {
|
||||
if (aButtonReflowInput.ComputedBSize() != NS_INTRINSICSIZE) {
|
||||
// Button has a fixed block-size -- that's its content-box bSize.
|
||||
buttonContentBox.BSize(wm) = aButtonReflowState.ComputedBSize();
|
||||
buttonContentBox.BSize(wm) = aButtonReflowInput.ComputedBSize();
|
||||
} else {
|
||||
// Button is intrinsically sized -- it should shrinkwrap the
|
||||
// button-contents' bSize, plus any focus-padding space:
|
||||
@@ -351,23 +351,23 @@ nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
|
||||
|
||||
// Make sure we obey min/max-bSize in the case when we're doing intrinsic
|
||||
// sizing (we get it for free when we have a non-intrinsic
|
||||
// aButtonReflowState.ComputedBSize()). Note that we do this before
|
||||
// aButtonReflowInput.ComputedBSize()). Note that we do this before
|
||||
// adjusting for borderpadding, since mComputedMaxBSize and
|
||||
// mComputedMinBSize are content bSizes.
|
||||
buttonContentBox.BSize(wm) =
|
||||
NS_CSS_MINMAX(buttonContentBox.BSize(wm),
|
||||
aButtonReflowState.ComputedMinBSize(),
|
||||
aButtonReflowState.ComputedMaxBSize());
|
||||
aButtonReflowInput.ComputedMinBSize(),
|
||||
aButtonReflowInput.ComputedMaxBSize());
|
||||
}
|
||||
if (aButtonReflowState.ComputedISize() != NS_INTRINSICSIZE) {
|
||||
buttonContentBox.ISize(wm) = aButtonReflowState.ComputedISize();
|
||||
if (aButtonReflowInput.ComputedISize() != NS_INTRINSICSIZE) {
|
||||
buttonContentBox.ISize(wm) = aButtonReflowInput.ComputedISize();
|
||||
} else {
|
||||
buttonContentBox.ISize(wm) =
|
||||
contentsDesiredSize.ISize(wm) + focusPadding.IStartEnd(wm);
|
||||
buttonContentBox.ISize(wm) =
|
||||
NS_CSS_MINMAX(buttonContentBox.ISize(wm),
|
||||
aButtonReflowState.ComputedMinISize(),
|
||||
aButtonReflowState.ComputedMaxISize());
|
||||
aButtonReflowInput.ComputedMinISize(),
|
||||
aButtonReflowInput.ComputedMaxISize());
|
||||
}
|
||||
|
||||
// Center child in the block-direction in the button
|
||||
@@ -387,13 +387,13 @@ nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
|
||||
|
||||
// Place the child
|
||||
FinishReflowChild(aFirstKid, aPresContext,
|
||||
contentsDesiredSize, &contentsReflowState,
|
||||
contentsDesiredSize, &contentsReflowInput,
|
||||
wm, childPos, containerSize, 0);
|
||||
|
||||
// Make sure we have a useful 'ascent' value for the child
|
||||
if (contentsDesiredSize.BlockStartAscent() ==
|
||||
ReflowOutput::ASK_FOR_BASELINE) {
|
||||
WritingMode wm = aButtonReflowState.GetWritingMode();
|
||||
WritingMode wm = aButtonReflowInput.GetWritingMode();
|
||||
contentsDesiredSize.SetBlockStartAscent(aFirstKid->GetLogicalBaseline(wm));
|
||||
}
|
||||
|
||||
@@ -401,7 +401,7 @@ nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
|
||||
// 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,
|
||||
LogicalSize(wm, aButtonReflowState.ComputedISize() + clbp.IStartEnd(wm),
|
||||
LogicalSize(wm, aButtonReflowInput.ComputedISize() + clbp.IStartEnd(wm),
|
||||
buttonContentBox.BSize(wm) + clbp.BStartEnd(wm)));
|
||||
|
||||
// * Button's ascent is its child's ascent, plus the child's block-offset
|
||||
|
||||
Reference in New Issue
Block a user