Bug 1277129 Part 1d - Rename nsCSSOffsetState to SizeComputationInput. 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 -e "s/$1/$2/g" "{}" \;
}
rename nsCSSOffsetState SizeComputationInput
MozReview-Commit-ID: GUJ99qNiSwD
This commit is contained in:
@@ -58,7 +58,7 @@ ReflowInput::ReflowInput(nsPresContext* aPresContext,
|
||||
nsRenderingContext* aRenderingContext,
|
||||
const LogicalSize& aAvailableSpace,
|
||||
uint32_t aFlags)
|
||||
: nsCSSOffsetState(aFrame, aRenderingContext)
|
||||
: SizeComputationInput(aFrame, aRenderingContext)
|
||||
, mBlockDelta(0)
|
||||
, mOrthogonalLimit(NS_UNCONSTRAINEDSIZE)
|
||||
, mReflowDepth(0)
|
||||
@@ -145,12 +145,12 @@ FontSizeInflationListMarginAdjustment(const nsIFrame* aFrame)
|
||||
return 0;
|
||||
}
|
||||
|
||||
// NOTE: If we ever want to use nsCSSOffsetState for a flex item or a
|
||||
// NOTE: If we ever want to use SizeComputationInput for a flex item or a
|
||||
// grid item, we need to make it take the containing-block block-size as
|
||||
// well as the inline-size, since flex items and grid items resolve
|
||||
// block-direction percent margins and padding against the
|
||||
// containing-block block-size, rather than its inline-size.
|
||||
nsCSSOffsetState::nsCSSOffsetState(nsIFrame *aFrame,
|
||||
SizeComputationInput::SizeComputationInput(nsIFrame *aFrame,
|
||||
nsRenderingContext *aRenderingContext,
|
||||
WritingMode aContainingBlockWritingMode,
|
||||
nscoord aContainingBlockISize)
|
||||
@@ -163,7 +163,7 @@ nsCSSOffsetState::nsCSSOffsetState(nsIFrame *aFrame,
|
||||
"values against CB inline size, which is incorrect for "
|
||||
"flex/grid items. "
|
||||
"Additionally for grid items, this path doesn't handle baseline "
|
||||
"padding contribution - see nsCSSOffsetState::InitOffsets");
|
||||
"padding contribution - see SizeComputationInput::InitOffsets");
|
||||
LogicalSize cbSize(aContainingBlockWritingMode, aContainingBlockISize,
|
||||
aContainingBlockISize);
|
||||
ReflowStateFlags flags;
|
||||
@@ -180,7 +180,7 @@ ReflowInput::ReflowInput(
|
||||
const LogicalSize& aAvailableSpace,
|
||||
const LogicalSize* aContainingBlockSize,
|
||||
uint32_t aFlags)
|
||||
: nsCSSOffsetState(aFrame, aParentReflowState.rendContext)
|
||||
: SizeComputationInput(aFrame, aParentReflowState.rendContext)
|
||||
, mBlockDelta(0)
|
||||
, mOrthogonalLimit(NS_UNCONSTRAINEDSIZE)
|
||||
, mReflowDepth(aParentReflowState.mReflowDepth + 1)
|
||||
@@ -251,7 +251,7 @@ ReflowInput::ReflowInput(
|
||||
}
|
||||
|
||||
inline nscoord
|
||||
nsCSSOffsetState::ComputeISizeValue(nscoord aContainingBlockISize,
|
||||
SizeComputationInput::ComputeISizeValue(nscoord aContainingBlockISize,
|
||||
nscoord aContentEdgeToBoxSizing,
|
||||
nscoord aBoxSizingToMarginEdge,
|
||||
const nsStyleCoord& aCoord) const
|
||||
@@ -264,7 +264,7 @@ nsCSSOffsetState::ComputeISizeValue(nscoord aContainingBlockISize,
|
||||
}
|
||||
|
||||
nscoord
|
||||
nsCSSOffsetState::ComputeISizeValue(nscoord aContainingBlockISize,
|
||||
SizeComputationInput::ComputeISizeValue(nscoord aContainingBlockISize,
|
||||
StyleBoxSizing aBoxSizing,
|
||||
const nsStyleCoord& aCoord) const
|
||||
{
|
||||
@@ -281,7 +281,7 @@ nsCSSOffsetState::ComputeISizeValue(nscoord aContainingBlockISize,
|
||||
}
|
||||
|
||||
nscoord
|
||||
nsCSSOffsetState::ComputeBSizeValue(nscoord aContainingBlockBSize,
|
||||
SizeComputationInput::ComputeBSizeValue(nscoord aContainingBlockBSize,
|
||||
StyleBoxSizing aBoxSizing,
|
||||
const nsStyleCoord& aCoord) const
|
||||
{
|
||||
@@ -2411,7 +2411,7 @@ UpdateProp(FrameProperties& aProps,
|
||||
}
|
||||
|
||||
void
|
||||
nsCSSOffsetState::InitOffsets(WritingMode aWM,
|
||||
SizeComputationInput::InitOffsets(WritingMode aWM,
|
||||
const LogicalSize& aPercentBasis,
|
||||
nsIAtom* aFrameType,
|
||||
ReflowStateFlags aFlags,
|
||||
@@ -2782,7 +2782,7 @@ ReflowInput::CalcLineHeight(nsIContent* aContent,
|
||||
}
|
||||
|
||||
bool
|
||||
nsCSSOffsetState::ComputeMargin(WritingMode aWM,
|
||||
SizeComputationInput::ComputeMargin(WritingMode aWM,
|
||||
const LogicalSize& aPercentBasis)
|
||||
{
|
||||
// SVG text frames have no margin.
|
||||
@@ -2830,7 +2830,7 @@ nsCSSOffsetState::ComputeMargin(WritingMode aWM,
|
||||
}
|
||||
|
||||
bool
|
||||
nsCSSOffsetState::ComputePadding(WritingMode aWM,
|
||||
SizeComputationInput::ComputePadding(WritingMode aWM,
|
||||
const LogicalSize& aPercentBasis,
|
||||
nsIAtom* aFrameType)
|
||||
{
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace mozilla {
|
||||
|
||||
// A base class of ReflowInput that computes only the padding,
|
||||
// border, and margin, since those values are needed more often.
|
||||
struct nsCSSOffsetState {
|
||||
struct SizeComputationInput {
|
||||
public:
|
||||
typedef mozilla::WritingMode WritingMode;
|
||||
typedef mozilla::LogicalMargin LogicalMargin;
|
||||
@@ -164,14 +164,14 @@ protected:
|
||||
|
||||
public:
|
||||
// Callers using this constructor must call InitOffsets on their own.
|
||||
nsCSSOffsetState(nsIFrame *aFrame, nsRenderingContext *aRenderingContext)
|
||||
SizeComputationInput(nsIFrame *aFrame, nsRenderingContext *aRenderingContext)
|
||||
: frame(aFrame)
|
||||
, rendContext(aRenderingContext)
|
||||
, mWritingMode(aFrame->GetWritingMode())
|
||||
{
|
||||
}
|
||||
|
||||
nsCSSOffsetState(nsIFrame *aFrame, nsRenderingContext *aRenderingContext,
|
||||
SizeComputationInput(nsIFrame *aFrame, nsRenderingContext *aRenderingContext,
|
||||
mozilla::WritingMode aContainingBlockWritingMode,
|
||||
nscoord aContainingBlockISize);
|
||||
|
||||
@@ -225,12 +225,12 @@ public:
|
||||
// to the display-reflow infrastructure.
|
||||
static void* DisplayInitOffsetsEnter(
|
||||
nsIFrame* aFrame,
|
||||
nsCSSOffsetState* aState,
|
||||
SizeComputationInput* aState,
|
||||
const mozilla::LogicalSize& aPercentBasis,
|
||||
const nsMargin* aBorder,
|
||||
const nsMargin* aPadding);
|
||||
static void DisplayInitOffsetsExit(nsIFrame* aFrame,
|
||||
nsCSSOffsetState* aState,
|
||||
SizeComputationInput* aState,
|
||||
void* aValue);
|
||||
#endif
|
||||
|
||||
@@ -314,7 +314,7 @@ protected:
|
||||
*
|
||||
* @see nsIFrame#Reflow()
|
||||
*/
|
||||
struct ReflowInput : public nsCSSOffsetState {
|
||||
struct ReflowInput : public SizeComputationInput {
|
||||
// the reflow states are linked together. this is the pointer to the
|
||||
// parent's reflow state
|
||||
const ReflowInput* mParentReflowState;
|
||||
|
||||
@@ -7398,7 +7398,7 @@ nsBlockFrame::ISizeToClearPastFloats(const nsBlockReflowState& aState,
|
||||
{
|
||||
nscoord inlineStartOffset, inlineEndOffset;
|
||||
WritingMode wm = aState.mReflowState.GetWritingMode();
|
||||
nsCSSOffsetState offsetState(aFrame, aState.mReflowState.rendContext,
|
||||
SizeComputationInput offsetState(aFrame, aState.mReflowState.rendContext,
|
||||
wm, aState.mContentArea.ISize(wm));
|
||||
|
||||
ReplacedElementISizeToClear result;
|
||||
@@ -7412,7 +7412,7 @@ nsBlockFrame::ISizeToClearPastFloats(const nsBlockReflowState& aState,
|
||||
// want to displace if the width won't compute to a value small enough
|
||||
// to fit.
|
||||
// All we really need here is the result of ComputeSize, and we
|
||||
// could *almost* get that from an nsCSSOffsetState, except for the
|
||||
// could *almost* get that from an SizeComputationInput, except for the
|
||||
// last argument.
|
||||
WritingMode frWM = aFrame->GetWritingMode();
|
||||
LogicalSize availSpace = LogicalSize(wm, availISize, NS_UNCONSTRAINEDSIZE).
|
||||
|
||||
@@ -181,7 +181,7 @@ nsBlockReflowState::ComputeReplacedBlockOffsetsForFloats(
|
||||
iEndOffset = 0;
|
||||
} else {
|
||||
LogicalMargin frameMargin(wm);
|
||||
nsCSSOffsetState os(aFrame, mReflowState.rendContext,
|
||||
SizeComputationInput os(aFrame, mReflowState.rendContext,
|
||||
wm, mContentArea.ISize(wm));
|
||||
frameMargin =
|
||||
os.ComputedLogicalMargin().ConvertTo(wm, aFrame->GetWritingMode());
|
||||
@@ -209,7 +209,7 @@ GetBEndMarginClone(nsIFrame* aFrame,
|
||||
{
|
||||
if (aFrame->StyleBorder()->mBoxDecorationBreak ==
|
||||
NS_STYLE_BOX_DECORATION_BREAK_CLONE) {
|
||||
nsCSSOffsetState os(aFrame, aRenderingContext, aWritingMode,
|
||||
SizeComputationInput os(aFrame, aRenderingContext, aWritingMode,
|
||||
aContentArea.ISize(aWritingMode));
|
||||
return os.ComputedLogicalMargin().
|
||||
ConvertTo(aWritingMode,
|
||||
@@ -679,7 +679,7 @@ static nscoord
|
||||
FloatMarginISize(const ReflowInput& aCBReflowState,
|
||||
nscoord aFloatAvailableISize,
|
||||
nsIFrame *aFloat,
|
||||
const nsCSSOffsetState& aFloatOffsetState)
|
||||
const SizeComputationInput& aFloatOffsetState)
|
||||
{
|
||||
AutoMaybeDisableFontInflation an(aFloat);
|
||||
WritingMode wm = aFloatOffsetState.GetWritingMode();
|
||||
@@ -746,7 +746,7 @@ nsBlockReflowState::FlowAndPlaceFloat(nsIFrame* aFloat)
|
||||
NS_ASSERTION(aFloat->GetParent() == mBlock,
|
||||
"Float frame has wrong parent");
|
||||
|
||||
nsCSSOffsetState offsets(aFloat, mReflowState.rendContext,
|
||||
SizeComputationInput offsets(aFloat, mReflowState.rendContext,
|
||||
wm, mReflowState.ComputedISize());
|
||||
|
||||
nscoord floatMarginISize = FloatMarginISize(mReflowState,
|
||||
|
||||
@@ -9697,7 +9697,7 @@ DR_init_constraints_cookie::~DR_init_constraints_cookie()
|
||||
|
||||
DR_init_offsets_cookie::DR_init_offsets_cookie(
|
||||
nsIFrame* aFrame,
|
||||
nsCSSOffsetState* aState,
|
||||
SizeComputationInput* aState,
|
||||
const LogicalSize& aPercentBasis,
|
||||
const nsMargin* aMargin,
|
||||
const nsMargin* aPadding)
|
||||
@@ -9705,7 +9705,7 @@ DR_init_offsets_cookie::DR_init_offsets_cookie(
|
||||
, mState(aState)
|
||||
{
|
||||
MOZ_COUNT_CTOR(DR_init_offsets_cookie);
|
||||
mValue = nsCSSOffsetState::DisplayInitOffsetsEnter(mFrame, mState,
|
||||
mValue = SizeComputationInput::DisplayInitOffsetsEnter(mFrame, mState,
|
||||
aPercentBasis,
|
||||
aMargin, aPadding);
|
||||
}
|
||||
@@ -9713,7 +9713,7 @@ DR_init_offsets_cookie::DR_init_offsets_cookie(
|
||||
DR_init_offsets_cookie::~DR_init_offsets_cookie()
|
||||
{
|
||||
MOZ_COUNT_DTOR(DR_init_offsets_cookie);
|
||||
nsCSSOffsetState::DisplayInitOffsetsExit(mFrame, mState, mValue);
|
||||
SizeComputationInput::DisplayInitOffsetsExit(mFrame, mState, mValue);
|
||||
}
|
||||
|
||||
DR_init_type_cookie::DR_init_type_cookie(
|
||||
@@ -10649,8 +10649,8 @@ ReflowInput::DisplayInitConstraintsExit(nsIFrame* aFrame,
|
||||
|
||||
|
||||
/* static */ void*
|
||||
nsCSSOffsetState::DisplayInitOffsetsEnter(nsIFrame* aFrame,
|
||||
nsCSSOffsetState* aState,
|
||||
SizeComputationInput::DisplayInitOffsetsEnter(nsIFrame* aFrame,
|
||||
SizeComputationInput* aState,
|
||||
const LogicalSize& aPercentBasis,
|
||||
const nsMargin* aBorder,
|
||||
const nsMargin* aPadding)
|
||||
@@ -10681,8 +10681,8 @@ nsCSSOffsetState::DisplayInitOffsetsEnter(nsIFrame* aFrame,
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
nsCSSOffsetState::DisplayInitOffsetsExit(nsIFrame* aFrame,
|
||||
nsCSSOffsetState* aState,
|
||||
SizeComputationInput::DisplayInitOffsetsExit(nsIFrame* aFrame,
|
||||
SizeComputationInput* aState,
|
||||
void* aValue)
|
||||
{
|
||||
NS_PRECONDITION(aFrame, "non-null frame required");
|
||||
|
||||
@@ -826,14 +826,14 @@ public:
|
||||
};
|
||||
|
||||
struct DR_init_offsets_cookie {
|
||||
DR_init_offsets_cookie(nsIFrame* aFrame, mozilla::nsCSSOffsetState* aState,
|
||||
DR_init_offsets_cookie(nsIFrame* aFrame, mozilla::SizeComputationInput* aState,
|
||||
const mozilla::LogicalSize& aPercentBasis,
|
||||
const nsMargin* aBorder,
|
||||
const nsMargin* aPadding);
|
||||
~DR_init_offsets_cookie();
|
||||
|
||||
nsIFrame* mFrame;
|
||||
mozilla::nsCSSOffsetState* mState;
|
||||
mozilla::SizeComputationInput* mState;
|
||||
void* mValue;
|
||||
};
|
||||
|
||||
|
||||
@@ -4652,7 +4652,7 @@ nsGridContainerFrame::ReflowInFlowChild(nsIFrame* aChild,
|
||||
aState.mRows.AlignBaselineSubtree(*aGridItemInfo);
|
||||
aState.mCols.AlignBaselineSubtree(*aGridItemInfo);
|
||||
// Setup [align|justify]-content:[last-]baseline related frame properties.
|
||||
// These are added to the padding in nsCSSOffsetState::InitOffsets.
|
||||
// These are added to the padding in SizeComputationInput::InitOffsets.
|
||||
// (a negative value signals the value is for 'last-baseline' and should be
|
||||
// added to the (logical) end padding)
|
||||
typedef const FramePropertyDescriptor<SmallValueHolder<nscoord>>* Prop;
|
||||
|
||||
@@ -117,7 +117,7 @@ nsMathMLSelectedFrame::ComputeSize(nsRenderingContext *aRenderingContext,
|
||||
nscoord availableISize = aAvailableISize - aBorder.ISize(aWM) -
|
||||
aPadding.ISize(aWM) - aMargin.ISize(aWM);
|
||||
LogicalSize cbSize = aCBSize - aBorder - aPadding - aMargin;
|
||||
nsCSSOffsetState offsetState(childFrame, aRenderingContext, aWM,
|
||||
SizeComputationInput offsetState(childFrame, aRenderingContext, aWM,
|
||||
availableISize);
|
||||
LogicalSize size =
|
||||
childFrame->ComputeSize(aRenderingContext, aWM, cbSize,
|
||||
|
||||
@@ -374,7 +374,7 @@ ChildShrinkWrapISize(nsRenderingContext *aRenderingContext,
|
||||
// For the caption frame, child's WM may differ from the table's main WM.
|
||||
WritingMode childWM = aChildFrame->GetWritingMode();
|
||||
|
||||
nsCSSOffsetState offsets(aChildFrame, aRenderingContext, aWM,
|
||||
SizeComputationInput offsets(aChildFrame, aRenderingContext, aWM,
|
||||
aCBSize.ISize(aWM));
|
||||
LogicalSize marginSize =
|
||||
offsets.ComputedLogicalMargin().Size(childWM).ConvertTo(aWM, childWM);
|
||||
|
||||
Reference in New Issue
Block a user