mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1673056 - Remove nsLayoutUtils::MIN_ISIZE and nsLayoutUtils::PREF_ISIZE. r=mats
Both are aliases to IntrinsicISizeType::MinISize and IntrinsicISizeType::PrefISize. Remove MOZ_ASSERT in nsLayoutUtils::IntrinsicForAxis and nsContainerFrame::DoInlineIntrinsicISize since IntrinsicISizeType is a enum class nowadays, which cannot have other values. I've compiled this patch with DEBUG_INTRINSIC_WIDTH defined in nsLayoutUtils.cpp, and fixed aWM undefined in nsLayoutUtils::MinSizeContributionForAxis(). Differential Revision: https://phabricator.services.mozilla.com/D94618
This commit is contained in:
parent
374af7fb74
commit
b5d7c879c0
@ -4675,7 +4675,7 @@ static nscoord AddIntrinsicSizeOffset(
|
||||
result = NSCoordSaturatingAdd(result, coordOutsideSize);
|
||||
|
||||
nscoord size;
|
||||
if (aType == nsLayoutUtils::MIN_ISIZE &&
|
||||
if (aType == IntrinsicISizeType::MinISize &&
|
||||
::IsReplacedBoxResolvedAgainstZero(aFrame, aStyleSize, aStyleMaxSize)) {
|
||||
// XXX bug 1463700: this doesn't handle calc() according to spec
|
||||
result = 0; // let |min| handle padding/border/margin
|
||||
@ -4742,7 +4742,6 @@ nscoord nsLayoutUtils::IntrinsicForAxis(
|
||||
MOZ_ASSERT(aFrame, "null frame");
|
||||
MOZ_ASSERT(aFrame->GetParent(),
|
||||
"IntrinsicForAxis called on frame not in tree");
|
||||
MOZ_ASSERT(aType == MIN_ISIZE || aType == PREF_ISIZE, "bad type");
|
||||
MOZ_ASSERT(aFrame->GetParent()->Type() != LayoutFrameType::GridContainer ||
|
||||
aPercentageBasis.isSome(),
|
||||
"grid layout should always pass a percentage basis");
|
||||
@ -4752,7 +4751,7 @@ nscoord nsLayoutUtils::IntrinsicForAxis(
|
||||
nsIFrame::IndentBy(stderr, gNoiseIndent);
|
||||
aFrame->ListTag(stderr);
|
||||
printf_stderr(" %s %s intrinsic size for container:\n",
|
||||
aType == MIN_ISIZE ? "min" : "pref",
|
||||
aType == IntrinsicISizeType::MinISize ? "min" : "pref",
|
||||
horizontalAxis ? "horizontal" : "vertical");
|
||||
#endif
|
||||
|
||||
@ -4873,15 +4872,16 @@ nscoord nsLayoutUtils::IntrinsicForAxis(
|
||||
result = aFrame->BSize();
|
||||
}
|
||||
} else {
|
||||
result = aType == MIN_ISIZE ? aFrame->GetMinISize(aRenderingContext)
|
||||
: aFrame->GetPrefISize(aRenderingContext);
|
||||
result = aType == IntrinsicISizeType::MinISize
|
||||
? aFrame->GetMinISize(aRenderingContext)
|
||||
: aFrame->GetPrefISize(aRenderingContext);
|
||||
}
|
||||
#ifdef DEBUG_INTRINSIC_WIDTH
|
||||
--gNoiseIndent;
|
||||
nsIFrame::IndentBy(stderr, gNoiseIndent);
|
||||
aFrame->ListTag(stderr);
|
||||
printf_stderr(" %s %s intrinsic size from frame is %d.\n",
|
||||
aType == MIN_ISIZE ? "min" : "pref",
|
||||
aType == IntrinsicISizeType::MinISize ? "min" : "pref",
|
||||
horizontalAxis ? "horizontal" : "vertical", result);
|
||||
#endif
|
||||
|
||||
@ -5009,7 +5009,7 @@ nscoord nsLayoutUtils::IntrinsicForAxis(
|
||||
nsIFrame::IndentBy(stderr, gNoiseIndent);
|
||||
aFrame->ListTag(stderr);
|
||||
printf_stderr(" %s %s intrinsic size for container is %d twips.\n",
|
||||
aType == MIN_ISIZE ? "min" : "pref",
|
||||
aType == IntrinsicISizeType::MinISize ? "min" : "pref",
|
||||
horizontalAxis ? "horizontal" : "vertical", result);
|
||||
#endif
|
||||
|
||||
@ -5042,8 +5042,8 @@ nscoord nsLayoutUtils::MinSizeContributionForAxis(
|
||||
nsIFrame::IndentBy(stderr, gNoiseIndent);
|
||||
aFrame->ListTag(stderr);
|
||||
printf_stderr(" %s min-isize for %s WM:\n",
|
||||
aType == MIN_ISIZE ? "min" : "pref",
|
||||
aWM.IsVertical() ? "vertical" : "horizontal");
|
||||
aType == IntrinsicISizeType::MinISize ? "min" : "pref",
|
||||
aAxis == eAxisVertical ? "vertical" : "horizontal");
|
||||
#endif
|
||||
|
||||
// Note: this method is only meant for grid/flex items.
|
||||
@ -5108,7 +5108,7 @@ nscoord nsLayoutUtils::MinSizeContributionForAxis(
|
||||
nsIFrame::IndentBy(stderr, gNoiseIndent);
|
||||
aFrame->ListTag(stderr);
|
||||
printf_stderr(" %s min-isize is indefinite.\n",
|
||||
aType == MIN_ISIZE ? "min" : "pref");
|
||||
aType == IntrinsicISizeType::MinISize ? "min" : "pref");
|
||||
#endif
|
||||
return NS_UNCONSTRAINEDSIZE;
|
||||
}
|
||||
@ -5136,7 +5136,7 @@ nscoord nsLayoutUtils::MinSizeContributionForAxis(
|
||||
nsIFrame::IndentBy(stderr, gNoiseIndent);
|
||||
aFrame->ListTag(stderr);
|
||||
printf_stderr(" %s min-isize is %d twips.\n",
|
||||
aType == MIN_ISIZE ? "min" : "pref", result);
|
||||
aType == IntrinsicISizeType::MinISize ? "min" : "pref", result);
|
||||
#endif
|
||||
|
||||
return result;
|
||||
|
@ -1404,8 +1404,6 @@ class nsLayoutUtils {
|
||||
* size by reducing the *content size* (flooring at zero). This is used for:
|
||||
* https://drafts.csswg.org/css-grid/#min-size-auto
|
||||
*/
|
||||
static const auto MIN_ISIZE = mozilla::IntrinsicISizeType::MinISize;
|
||||
static const auto PREF_ISIZE = mozilla::IntrinsicISizeType::PrefISize;
|
||||
enum {
|
||||
IGNORE_PADDING = 0x01,
|
||||
BAIL_IF_REFLOW_NEEDED = 0x02, // returns NS_INTRINSIC_ISIZE_UNKNOWN if so
|
||||
|
@ -751,14 +751,14 @@ nscoord nsComboboxControlFrame::GetIntrinsicISize(gfxContext* aRenderingContext,
|
||||
nscoord dropdownContentISize;
|
||||
bool isUsingOverlayScrollbars =
|
||||
LookAndFeel::GetInt(LookAndFeel::IntID::UseOverlayScrollbars) != 0;
|
||||
if (aType == nsLayoutUtils::MIN_ISIZE) {
|
||||
if (aType == IntrinsicISizeType::MinISize) {
|
||||
dropdownContentISize =
|
||||
isContainSize ? 0 : mDropdownFrame->GetMinISize(aRenderingContext);
|
||||
if (isUsingOverlayScrollbars) {
|
||||
dropdownContentISize += scrollbarWidth;
|
||||
}
|
||||
} else {
|
||||
NS_ASSERTION(aType == nsLayoutUtils::PREF_ISIZE, "Unexpected type");
|
||||
NS_ASSERTION(aType == IntrinsicISizeType::PrefISize, "Unexpected type");
|
||||
dropdownContentISize =
|
||||
isContainSize ? 0 : mDropdownFrame->GetPrefISize(aRenderingContext);
|
||||
if (isUsingOverlayScrollbars) {
|
||||
@ -780,14 +780,15 @@ nscoord nsComboboxControlFrame::GetIntrinsicISize(gfxContext* aRenderingContext,
|
||||
nscoord nsComboboxControlFrame::GetMinISize(gfxContext* aRenderingContext) {
|
||||
nscoord minISize;
|
||||
DISPLAY_MIN_INLINE_SIZE(this, minISize);
|
||||
minISize = GetIntrinsicISize(aRenderingContext, nsLayoutUtils::MIN_ISIZE);
|
||||
minISize = GetIntrinsicISize(aRenderingContext, IntrinsicISizeType::MinISize);
|
||||
return minISize;
|
||||
}
|
||||
|
||||
nscoord nsComboboxControlFrame::GetPrefISize(gfxContext* aRenderingContext) {
|
||||
nscoord prefISize;
|
||||
DISPLAY_PREF_INLINE_SIZE(this, prefISize);
|
||||
prefISize = GetIntrinsicISize(aRenderingContext, nsLayoutUtils::PREF_ISIZE);
|
||||
prefISize =
|
||||
GetIntrinsicISize(aRenderingContext, IntrinsicISizeType::PrefISize);
|
||||
return prefISize;
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ nscoord nsDateTimeControlFrame::GetMinISize(gfxContext* aRenderingContext) {
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
if (kid) { // display:none?
|
||||
result = nsLayoutUtils::IntrinsicForContainer(aRenderingContext, kid,
|
||||
nsLayoutUtils::MIN_ISIZE);
|
||||
IntrinsicISizeType::MinISize);
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
@ -64,8 +64,8 @@ nscoord nsDateTimeControlFrame::GetPrefISize(gfxContext* aRenderingContext) {
|
||||
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
if (kid) { // display:none?
|
||||
result = nsLayoutUtils::IntrinsicForContainer(aRenderingContext, kid,
|
||||
nsLayoutUtils::PREF_ISIZE);
|
||||
result = nsLayoutUtils::IntrinsicForContainer(
|
||||
aRenderingContext, kid, IntrinsicISizeType::PrefISize);
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
|
@ -369,7 +369,7 @@ nscoord nsFieldSetFrame::GetMinISize(gfxContext* aRenderingContext) {
|
||||
nscoord result = 0;
|
||||
DISPLAY_MIN_INLINE_SIZE(this, result);
|
||||
|
||||
result = GetIntrinsicISize(aRenderingContext, nsLayoutUtils::MIN_ISIZE);
|
||||
result = GetIntrinsicISize(aRenderingContext, IntrinsicISizeType::MinISize);
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -377,7 +377,7 @@ nscoord nsFieldSetFrame::GetPrefISize(gfxContext* aRenderingContext) {
|
||||
nscoord result = 0;
|
||||
DISPLAY_PREF_INLINE_SIZE(this, result);
|
||||
|
||||
result = GetIntrinsicISize(aRenderingContext, nsLayoutUtils::PREF_ISIZE);
|
||||
result = GetIntrinsicISize(aRenderingContext, IntrinsicISizeType::PrefISize);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -133,7 +133,7 @@ nscoord nsHTMLButtonControlFrame::GetMinISize(gfxContext* aRenderingContext) {
|
||||
} else {
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
result = nsLayoutUtils::IntrinsicForContainer(aRenderingContext, kid,
|
||||
nsLayoutUtils::MIN_ISIZE);
|
||||
IntrinsicISizeType::MinISize);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -145,8 +145,8 @@ nscoord nsHTMLButtonControlFrame::GetPrefISize(gfxContext* aRenderingContext) {
|
||||
result = 0;
|
||||
} else {
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
result = nsLayoutUtils::IntrinsicForContainer(aRenderingContext, kid,
|
||||
nsLayoutUtils::PREF_ISIZE);
|
||||
result = nsLayoutUtils::IntrinsicForContainer(
|
||||
aRenderingContext, kid, IntrinsicISizeType::PrefISize);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -202,8 +202,8 @@ void BlockReflowInput::ComputeBlockAvailSpace(
|
||||
// If we did that, then for those frames where the condition below is
|
||||
// true but nsBlockFrame::BlockCanIntersectFloats is false,
|
||||
// nsBlockFrame::ISizeToClearPastFloats would need to use the
|
||||
// shrink-wrap formula, max(MIN_ISIZE, min(avail width, PREF_ISIZE))
|
||||
// rather than just using MIN_ISIZE.
|
||||
// shrink-wrap formula, max(MinISize, min(avail width, PrefISize))
|
||||
// rather than just using MinISize.
|
||||
NS_ASSERTION(
|
||||
nsBlockFrame::BlockCanIntersectFloats(aFrame) == !aBlockAvoidsFloats,
|
||||
"unexpected replaced width");
|
||||
|
@ -790,7 +790,7 @@ nscoord nsBlockFrame::GetMinISize(gfxContext* aRenderingContext) {
|
||||
if (line->IsBlock()) {
|
||||
data.ForceBreak();
|
||||
data.mCurrentLine = nsLayoutUtils::IntrinsicForContainer(
|
||||
aRenderingContext, line->mFirstChild, nsLayoutUtils::MIN_ISIZE);
|
||||
aRenderingContext, line->mFirstChild, IntrinsicISizeType::MinISize);
|
||||
data.ForceBreak();
|
||||
} else {
|
||||
if (!curFrame->GetPrevContinuation() &&
|
||||
@ -881,7 +881,8 @@ nscoord nsBlockFrame::GetPrefISize(gfxContext* aRenderingContext) {
|
||||
}
|
||||
data.ForceBreak(breakType);
|
||||
data.mCurrentLine = nsLayoutUtils::IntrinsicForContainer(
|
||||
aRenderingContext, line->mFirstChild, nsLayoutUtils::PREF_ISIZE);
|
||||
aRenderingContext, line->mFirstChild,
|
||||
IntrinsicISizeType::PrefISize);
|
||||
data.ForceBreak();
|
||||
} else {
|
||||
if (!curFrame->GetPrevContinuation() &&
|
||||
|
@ -1021,7 +1021,7 @@ static inline bool IsIgnoreable(const nsIFrame* aFrame, nscoord aISize) {
|
||||
void nsBulletFrame::AddInlineMinISize(gfxContext* aRenderingContext,
|
||||
nsIFrame::InlineMinISizeData* aData) {
|
||||
nscoord isize = nsLayoutUtils::IntrinsicForContainer(
|
||||
aRenderingContext, this, nsLayoutUtils::MIN_ISIZE);
|
||||
aRenderingContext, this, IntrinsicISizeType::MinISize);
|
||||
if (MOZ_LIKELY(!::IsIgnoreable(this, isize))) {
|
||||
aData->DefaultAddInlineMinISize(this, isize);
|
||||
}
|
||||
@ -1031,7 +1031,7 @@ void nsBulletFrame::AddInlineMinISize(gfxContext* aRenderingContext,
|
||||
void nsBulletFrame::AddInlinePrefISize(gfxContext* aRenderingContext,
|
||||
nsIFrame::InlinePrefISizeData* aData) {
|
||||
nscoord isize = nsLayoutUtils::IntrinsicForContainer(
|
||||
aRenderingContext, this, nsLayoutUtils::PREF_ISIZE);
|
||||
aRenderingContext, this, IntrinsicISizeType::PrefISize);
|
||||
if (MOZ_LIKELY(!::IsIgnoreable(this, isize))) {
|
||||
aData->DefaultAddInlinePrefISize(isize);
|
||||
}
|
||||
|
@ -887,10 +887,6 @@ void nsContainerFrame::DoInlineIntrinsicISize(gfxContext* aRenderingContext,
|
||||
IntrinsicISizeType aType) {
|
||||
if (GetPrevInFlow()) return; // Already added.
|
||||
|
||||
MOZ_ASSERT(
|
||||
aType == nsLayoutUtils::MIN_ISIZE || aType == nsLayoutUtils::PREF_ISIZE,
|
||||
"bad type");
|
||||
|
||||
WritingMode wm = GetWritingMode();
|
||||
mozilla::Side startSide = wm.PhysicalSideForInlineAxis(eLogicalEdgeStart);
|
||||
mozilla::Side endSide = wm.PhysicalSideForInlineAxis(eLogicalEdgeEnd);
|
||||
@ -944,12 +940,13 @@ void nsContainerFrame::DoInlineIntrinsicISize(gfxContext* aRenderingContext,
|
||||
aData->mCurrentLine = clonePBM;
|
||||
}
|
||||
for (nsIFrame* kid : nif->mFrames) {
|
||||
if (aType == nsLayoutUtils::MIN_ISIZE)
|
||||
if (aType == IntrinsicISizeType::MinISize) {
|
||||
kid->AddInlineMinISize(aRenderingContext,
|
||||
static_cast<InlineMinISizeData*>(aData));
|
||||
else
|
||||
} else {
|
||||
kid->AddInlinePrefISize(aRenderingContext,
|
||||
static_cast<InlinePrefISizeData*>(aData));
|
||||
}
|
||||
}
|
||||
|
||||
// After we advance to our next-in-flow, the stored line and line container
|
||||
|
@ -99,7 +99,8 @@ nsresult nsFirstLetterFrame::GetChildFrameContainingOffset(
|
||||
/* virtual */
|
||||
void nsFirstLetterFrame::AddInlineMinISize(
|
||||
gfxContext* aRenderingContext, nsIFrame::InlineMinISizeData* aData) {
|
||||
DoInlineIntrinsicISize(aRenderingContext, aData, nsLayoutUtils::MIN_ISIZE);
|
||||
DoInlineIntrinsicISize(aRenderingContext, aData,
|
||||
IntrinsicISizeType::MinISize);
|
||||
}
|
||||
|
||||
// Needed for non-floating first-letter frames and for the continuations
|
||||
@ -107,7 +108,8 @@ void nsFirstLetterFrame::AddInlineMinISize(
|
||||
/* virtual */
|
||||
void nsFirstLetterFrame::AddInlinePrefISize(
|
||||
gfxContext* aRenderingContext, nsIFrame::InlinePrefISizeData* aData) {
|
||||
DoInlineIntrinsicISize(aRenderingContext, aData, nsLayoutUtils::PREF_ISIZE);
|
||||
DoInlineIntrinsicISize(aRenderingContext, aData,
|
||||
IntrinsicISizeType::PrefISize);
|
||||
aData->mLineIsEmpty = false;
|
||||
}
|
||||
|
||||
|
@ -5562,14 +5562,13 @@ nscoord nsFlexContainerFrame::IntrinsicISize(gfxContext* aRenderingContext,
|
||||
// pref isize is former (sum), and its min isize is the latter (max).
|
||||
bool isSingleLine = (StyleFlexWrap::Nowrap == stylePos->mFlexWrap);
|
||||
if (axisTracker.IsRowOriented() &&
|
||||
(isSingleLine || aType == nsLayoutUtils::PREF_ISIZE)) {
|
||||
(isSingleLine || aType == IntrinsicISizeType::PrefISize)) {
|
||||
containerISize += childISize;
|
||||
if (!onFirstChild) {
|
||||
containerISize += mainGapSize;
|
||||
}
|
||||
onFirstChild = false;
|
||||
} else { // (col-oriented, or MIN_ISIZE for multi-line row flex
|
||||
// container)
|
||||
} else { // (col-oriented, or MinISize for multi-line row flex container)
|
||||
containerISize = std::max(containerISize, childISize);
|
||||
}
|
||||
}
|
||||
@ -5585,7 +5584,7 @@ nscoord nsFlexContainerFrame::GetMinISize(gfxContext* aRenderingContext) {
|
||||
mCachedMinISize =
|
||||
StyleDisplay()->IsContainSize()
|
||||
? 0
|
||||
: IntrinsicISize(aRenderingContext, nsLayoutUtils::MIN_ISIZE);
|
||||
: IntrinsicISize(aRenderingContext, IntrinsicISizeType::MinISize);
|
||||
}
|
||||
|
||||
return mCachedMinISize;
|
||||
@ -5598,7 +5597,7 @@ nscoord nsFlexContainerFrame::GetPrefISize(gfxContext* aRenderingContext) {
|
||||
mCachedPrefISize =
|
||||
StyleDisplay()->IsContainSize()
|
||||
? 0
|
||||
: IntrinsicISize(aRenderingContext, nsLayoutUtils::PREF_ISIZE);
|
||||
: IntrinsicISize(aRenderingContext, IntrinsicISizeType::PrefISize);
|
||||
}
|
||||
|
||||
return mCachedPrefISize;
|
||||
|
@ -5299,7 +5299,7 @@ static nscoord MinContentContribution(const GridItemInfo& aGridItem,
|
||||
}
|
||||
nscoord s = ContentContribution(
|
||||
aGridItem, aState, aRC, aCBWM, aAxis, aCache->mPercentageBasis,
|
||||
nsLayoutUtils::MIN_ISIZE, aCache->mMinSizeClamp);
|
||||
IntrinsicISizeType::MinISize, aCache->mMinSizeClamp);
|
||||
aCache->mMinContentContribution.emplace(s);
|
||||
return s;
|
||||
}
|
||||
@ -5318,7 +5318,7 @@ static nscoord MaxContentContribution(const GridItemInfo& aGridItem,
|
||||
}
|
||||
nscoord s = ContentContribution(
|
||||
aGridItem, aState, aRC, aCBWM, aAxis, aCache->mPercentageBasis,
|
||||
nsLayoutUtils::PREF_ISIZE, aCache->mMinSizeClamp);
|
||||
IntrinsicISizeType::PrefISize, aCache->mMinSizeClamp);
|
||||
aCache->mMaxContentContribution.emplace(s);
|
||||
return s;
|
||||
}
|
||||
@ -5372,7 +5372,7 @@ static nscoord MinSize(const GridItemInfo& aGridItem,
|
||||
"baseline offset should be zero when not baseline-aligned");
|
||||
nscoord sz = aGridItem.mBaselineOffset[aAxis] +
|
||||
nsLayoutUtils::MinSizeContributionForAxis(
|
||||
axis, aRC, child, nsLayoutUtils::MIN_ISIZE,
|
||||
axis, aRC, child, IntrinsicISizeType::MinISize,
|
||||
*aCache->mPercentageBasis);
|
||||
const StyleSize& style =
|
||||
axis == eAxisHorizontal ? stylePos->mMinWidth : stylePos->mMinHeight;
|
||||
@ -5387,11 +5387,11 @@ static nscoord MinSize(const GridItemInfo& aGridItem,
|
||||
(isAuto && child->StyleDisplay()->mOverflowX == StyleOverflow::Visible)) {
|
||||
// Now calculate the "content size" part and return whichever is smaller.
|
||||
MOZ_ASSERT(isAuto || sz == NS_UNCONSTRAINEDSIZE);
|
||||
sz = std::min(
|
||||
sz, ContentContribution(aGridItem, aState, aRC, aCBWM, aAxis,
|
||||
aCache->mPercentageBasis,
|
||||
nsLayoutUtils::MIN_ISIZE, aCache->mMinSizeClamp,
|
||||
nsLayoutUtils::MIN_INTRINSIC_ISIZE));
|
||||
sz = std::min(sz, ContentContribution(aGridItem, aState, aRC, aCBWM, aAxis,
|
||||
aCache->mPercentageBasis,
|
||||
IntrinsicISizeType::MinISize,
|
||||
aCache->mMinSizeClamp,
|
||||
nsLayoutUtils::MIN_INTRINSIC_ISIZE));
|
||||
}
|
||||
aCache->mMinSize.emplace(sz);
|
||||
return sz;
|
||||
@ -6368,7 +6368,7 @@ float nsGridContainerFrame::Tracks::FindUsedFlexFraction(
|
||||
// XXX optimize: bug 1194446
|
||||
auto pb = Some(aState.PercentageBasisFor(mAxis, item));
|
||||
nscoord spaceToFill = ContentContribution(item, aState, rc, wm, mAxis, pb,
|
||||
nsLayoutUtils::PREF_ISIZE);
|
||||
IntrinsicISizeType::PrefISize);
|
||||
const LineRange& range =
|
||||
mAxis == eLogicalAxisInline ? item.mArea.mCols : item.mArea.mRows;
|
||||
MOZ_ASSERT(range.Extent() >= 1);
|
||||
@ -8251,8 +8251,8 @@ nscoord nsGridContainerFrame::MasonryLayout(GridReflowInput& aState,
|
||||
LogicalSize percentBasis(
|
||||
aState.PercentageBasisFor(eLogicalAxisInline, *item));
|
||||
IntrinsicISizeType type = aConstraint == SizingConstraint::MaxContent
|
||||
? nsLayoutUtils::PREF_ISIZE
|
||||
: nsLayoutUtils::MIN_ISIZE;
|
||||
? IntrinsicISizeType::PrefISize
|
||||
: IntrinsicISizeType::MinISize;
|
||||
auto sz =
|
||||
::ContentContribution(*item, aState, &aState.mRenderingContext, wm,
|
||||
masonryAxis, Some(percentBasis), type);
|
||||
@ -9178,7 +9178,7 @@ nscoord nsGridContainerFrame::IntrinsicISize(gfxContext* aRenderingContext,
|
||||
grid.mGridRowEnd = subgrid->mGridRowEnd;
|
||||
}
|
||||
|
||||
auto constraint = aType == nsLayoutUtils::MIN_ISIZE
|
||||
auto constraint = aType == IntrinsicISizeType::MinISize
|
||||
? SizingConstraint::MinContent
|
||||
: SizingConstraint::MaxContent;
|
||||
if (IsMasonry(eLogicalAxisInline)) {
|
||||
@ -9221,7 +9221,7 @@ nscoord nsGridContainerFrame::GetMinISize(gfxContext* aRC) {
|
||||
if (mCachedMinISize == NS_INTRINSIC_ISIZE_UNKNOWN) {
|
||||
mCachedMinISize = StyleDisplay()->IsContainSize()
|
||||
? 0
|
||||
: IntrinsicISize(aRC, nsLayoutUtils::MIN_ISIZE);
|
||||
: IntrinsicISize(aRC, IntrinsicISizeType::MinISize);
|
||||
}
|
||||
return mCachedMinISize;
|
||||
}
|
||||
@ -9236,7 +9236,7 @@ nscoord nsGridContainerFrame::GetPrefISize(gfxContext* aRC) {
|
||||
if (mCachedPrefISize == NS_INTRINSIC_ISIZE_UNKNOWN) {
|
||||
mCachedPrefISize = StyleDisplay()->IsContainSize()
|
||||
? 0
|
||||
: IntrinsicISize(aRC, nsLayoutUtils::PREF_ISIZE);
|
||||
: IntrinsicISize(aRC, IntrinsicISizeType::PrefISize);
|
||||
}
|
||||
return mCachedPrefISize;
|
||||
}
|
||||
|
@ -5721,7 +5721,7 @@ nscoord nsIFrame::GetPrefISize(gfxContext* aRenderingContext) {
|
||||
void nsIFrame::AddInlineMinISize(gfxContext* aRenderingContext,
|
||||
nsIFrame::InlineMinISizeData* aData) {
|
||||
nscoord isize = nsLayoutUtils::IntrinsicForContainer(
|
||||
aRenderingContext, this, nsLayoutUtils::MIN_ISIZE);
|
||||
aRenderingContext, this, IntrinsicISizeType::MinISize);
|
||||
aData->DefaultAddInlineMinISize(this, isize);
|
||||
}
|
||||
|
||||
@ -5729,7 +5729,7 @@ void nsIFrame::AddInlineMinISize(gfxContext* aRenderingContext,
|
||||
void nsIFrame::AddInlinePrefISize(gfxContext* aRenderingContext,
|
||||
nsIFrame::InlinePrefISizeData* aData) {
|
||||
nscoord isize = nsLayoutUtils::IntrinsicForContainer(
|
||||
aRenderingContext, this, nsLayoutUtils::PREF_ISIZE);
|
||||
aRenderingContext, this, IntrinsicISizeType::PrefISize);
|
||||
aData->DefaultAddInlinePrefISize(isize);
|
||||
}
|
||||
|
||||
|
@ -2710,7 +2710,7 @@ static bool IsInAutoWidthTableCellForQuirk(nsIFrame* aFrame) {
|
||||
void nsImageFrame::AddInlineMinISize(gfxContext* aRenderingContext,
|
||||
nsIFrame::InlineMinISizeData* aData) {
|
||||
nscoord isize = nsLayoutUtils::IntrinsicForContainer(
|
||||
aRenderingContext, this, nsLayoutUtils::MIN_ISIZE);
|
||||
aRenderingContext, this, IntrinsicISizeType::MinISize);
|
||||
bool canBreak = !IsInAutoWidthTableCellForQuirk(this);
|
||||
aData->DefaultAddInlineMinISize(this, isize, canBreak);
|
||||
}
|
||||
|
@ -226,13 +226,15 @@ void nsInlineFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
/* virtual */
|
||||
void nsInlineFrame::AddInlineMinISize(gfxContext* aRenderingContext,
|
||||
nsIFrame::InlineMinISizeData* aData) {
|
||||
DoInlineIntrinsicISize(aRenderingContext, aData, nsLayoutUtils::MIN_ISIZE);
|
||||
DoInlineIntrinsicISize(aRenderingContext, aData,
|
||||
IntrinsicISizeType::MinISize);
|
||||
}
|
||||
|
||||
/* virtual */
|
||||
void nsInlineFrame::AddInlinePrefISize(gfxContext* aRenderingContext,
|
||||
nsIFrame::InlinePrefISizeData* aData) {
|
||||
DoInlineIntrinsicISize(aRenderingContext, aData, nsLayoutUtils::PREF_ISIZE);
|
||||
DoInlineIntrinsicISize(aRenderingContext, aData,
|
||||
IntrinsicISizeType::PrefISize);
|
||||
aData->mLineIsEmpty = false;
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ void nsPlaceholderFrame::AddInlineMinISize(
|
||||
// ...but push floats onto the list
|
||||
if (mOutOfFlowFrame->IsFloating()) {
|
||||
nscoord floatWidth = nsLayoutUtils::IntrinsicForContainer(
|
||||
aRenderingContext, mOutOfFlowFrame, nsLayoutUtils::MIN_ISIZE);
|
||||
aRenderingContext, mOutOfFlowFrame, IntrinsicISizeType::MinISize);
|
||||
aData->mFloats.AppendElement(
|
||||
InlineIntrinsicISizeData::FloatInfo(mOutOfFlowFrame, floatWidth));
|
||||
}
|
||||
@ -95,7 +95,7 @@ void nsPlaceholderFrame::AddInlinePrefISize(
|
||||
// ...but push floats onto the list
|
||||
if (mOutOfFlowFrame->IsFloating()) {
|
||||
nscoord floatWidth = nsLayoutUtils::IntrinsicForContainer(
|
||||
aRenderingContext, mOutOfFlowFrame, nsLayoutUtils::PREF_ISIZE);
|
||||
aRenderingContext, mOutOfFlowFrame, IntrinsicISizeType::PrefISize);
|
||||
aData->mFloats.AppendElement(
|
||||
InlineIntrinsicISizeData::FloatInfo(mOutOfFlowFrame, floatWidth));
|
||||
}
|
||||
|
@ -595,8 +595,8 @@ nscoord nsVideoFrame::GetMinISize(gfxContext* aRenderingContext) {
|
||||
// "controls" attribute is present.
|
||||
nsIFrame* kid = mFrames.LastChild();
|
||||
if (!StyleDisplay()->IsContainSize() && kid) {
|
||||
result = nsLayoutUtils::IntrinsicForContainer(aRenderingContext, kid,
|
||||
nsLayoutUtils::MIN_ISIZE);
|
||||
result = nsLayoutUtils::IntrinsicForContainer(
|
||||
aRenderingContext, kid, IntrinsicISizeType::MinISize);
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
@ -617,8 +617,8 @@ nscoord nsVideoFrame::GetPrefISize(gfxContext* aRenderingContext) {
|
||||
// "controls" attribute is present.
|
||||
nsIFrame* kid = mFrames.LastChild();
|
||||
if (!StyleDisplay()->IsContainSize() && kid) {
|
||||
result = nsLayoutUtils::IntrinsicForContainer(aRenderingContext, kid,
|
||||
nsLayoutUtils::PREF_ISIZE);
|
||||
result = nsLayoutUtils::IntrinsicForContainer(
|
||||
aRenderingContext, kid, IntrinsicISizeType::PrefISize);
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
|
@ -960,7 +960,7 @@ void nsMathMLContainerFrame::GetIntrinsicISizeMetrics(
|
||||
// margin, so we may end up with too much space, but, with stretchy
|
||||
// characters, this is an approximation anyway.
|
||||
nscoord width = nsLayoutUtils::IntrinsicForContainer(
|
||||
aRenderingContext, childFrame, nsLayoutUtils::PREF_ISIZE);
|
||||
aRenderingContext, childFrame, IntrinsicISizeType::PrefISize);
|
||||
|
||||
childDesiredSize.Width() = width;
|
||||
childDesiredSize.mBoundingMetrics.width = width;
|
||||
|
@ -582,8 +582,8 @@ void nsMathMLmfencedFrame::GetIntrinsicISizeMetrics(
|
||||
// XXX This includes margin while Reflow currently doesn't consider
|
||||
// margin, so we may end up with too much space, but, with stretchy
|
||||
// characters, this is an approximation anyway.
|
||||
width += nsLayoutUtils::IntrinsicForContainer(aRenderingContext, childFrame,
|
||||
nsLayoutUtils::PREF_ISIZE);
|
||||
width += nsLayoutUtils::IntrinsicForContainer(
|
||||
aRenderingContext, childFrame, IntrinsicISizeType::PrefISize);
|
||||
|
||||
if (i < mSeparatorsCount) {
|
||||
width +=
|
||||
|
@ -346,9 +346,9 @@ void nsMathMLmrootFrame::GetIntrinsicISizeMetrics(gfxContext* aRenderingContext,
|
||||
|
||||
float fontSizeInflation = nsLayoutUtils::FontSizeInflationFor(this);
|
||||
nscoord baseWidth = nsLayoutUtils::IntrinsicForContainer(
|
||||
aRenderingContext, baseFrame, nsLayoutUtils::PREF_ISIZE);
|
||||
aRenderingContext, baseFrame, IntrinsicISizeType::PrefISize);
|
||||
nscoord indexWidth = nsLayoutUtils::IntrinsicForContainer(
|
||||
aRenderingContext, indexFrame, nsLayoutUtils::PREF_ISIZE);
|
||||
aRenderingContext, indexFrame, IntrinsicISizeType::PrefISize);
|
||||
nscoord sqrWidth = mSqrChar.GetMaxWidth(
|
||||
this, aRenderingContext->GetDrawTarget(), fontSizeInflation);
|
||||
|
||||
|
@ -93,7 +93,7 @@ nscoord FixedTableLayoutStrategy::GetMinISize(gfxContext* aRenderingContext) {
|
||||
styleISize->AsExtremumLength() ==
|
||||
StyleExtremumLength::MinContent))) {
|
||||
nscoord cellISize = nsLayoutUtils::IntrinsicForContainer(
|
||||
aRenderingContext, cellFrame, nsLayoutUtils::MIN_ISIZE);
|
||||
aRenderingContext, cellFrame, IntrinsicISizeType::MinISize);
|
||||
if (colSpan > 1) {
|
||||
// If a column-spanning cell is in the first row, split up
|
||||
// the space evenly. (XXX This isn't quite right if some of
|
||||
@ -239,13 +239,13 @@ void FixedTableLayoutStrategy::ComputeColumnISizes(
|
||||
styleISize->AsExtremumLength() ==
|
||||
StyleExtremumLength::MinContent))) {
|
||||
// XXX This should use real percentage padding
|
||||
// Note that the difference between MIN_ISIZE and PREF_ISIZE
|
||||
// Note that the difference between MinISize and PrefISize
|
||||
// shouldn't matter for any of these values of styleISize; use
|
||||
// MIN_ISIZE for symmetry with GetMinISize above, just in case
|
||||
// there is a difference.
|
||||
colISize = nsLayoutUtils::IntrinsicForContainer(
|
||||
aReflowInput.mRenderingContext, cellFrame,
|
||||
nsLayoutUtils::MIN_ISIZE);
|
||||
IntrinsicISizeType::MinISize);
|
||||
} else if (styleISize->ConvertsToPercentage()) {
|
||||
// XXX This should use real percentage padding
|
||||
float pct = styleISize->ToPercentage();
|
||||
|
@ -727,7 +727,7 @@ nscoord nsTableCellFrame::GetMinISize(gfxContext* aRenderingContext) {
|
||||
|
||||
nsIFrame* inner = mFrames.FirstChild();
|
||||
result = nsLayoutUtils::IntrinsicForContainer(aRenderingContext, inner,
|
||||
nsLayoutUtils::MIN_ISIZE);
|
||||
IntrinsicISizeType::MinISize);
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -738,7 +738,7 @@ nscoord nsTableCellFrame::GetPrefISize(gfxContext* aRenderingContext) {
|
||||
|
||||
nsIFrame* inner = mFrames.FirstChild();
|
||||
result = nsLayoutUtils::IntrinsicForContainer(aRenderingContext, inner,
|
||||
nsLayoutUtils::PREF_ISIZE);
|
||||
IntrinsicISizeType::PrefISize);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -305,12 +305,12 @@ static nsSize GetContainingBlockSize(const ReflowInput& aOuterRI) {
|
||||
/* virtual */
|
||||
nscoord nsTableWrapperFrame::GetMinISize(gfxContext* aRenderingContext) {
|
||||
nscoord iSize = nsLayoutUtils::IntrinsicForContainer(
|
||||
aRenderingContext, InnerTableFrame(), nsLayoutUtils::MIN_ISIZE);
|
||||
aRenderingContext, InnerTableFrame(), IntrinsicISizeType::MinISize);
|
||||
DISPLAY_MIN_INLINE_SIZE(this, iSize);
|
||||
if (mCaptionFrames.NotEmpty()) {
|
||||
nscoord capISize = nsLayoutUtils::IntrinsicForContainer(
|
||||
aRenderingContext, mCaptionFrames.FirstChild(),
|
||||
nsLayoutUtils::MIN_ISIZE);
|
||||
IntrinsicISizeType::MinISize);
|
||||
if (HasSideCaption()) {
|
||||
iSize += capISize;
|
||||
} else {
|
||||
@ -328,7 +328,7 @@ nscoord nsTableWrapperFrame::GetPrefISize(gfxContext* aRenderingContext) {
|
||||
DISPLAY_PREF_INLINE_SIZE(this, maxISize);
|
||||
|
||||
maxISize = nsLayoutUtils::IntrinsicForContainer(
|
||||
aRenderingContext, InnerTableFrame(), nsLayoutUtils::PREF_ISIZE);
|
||||
aRenderingContext, InnerTableFrame(), IntrinsicISizeType::PrefISize);
|
||||
if (mCaptionFrames.NotEmpty()) {
|
||||
uint8_t captionSide = GetCaptionSide();
|
||||
switch (captionSide) {
|
||||
@ -336,7 +336,7 @@ nscoord nsTableWrapperFrame::GetPrefISize(gfxContext* aRenderingContext) {
|
||||
case NS_STYLE_CAPTION_SIDE_RIGHT: {
|
||||
nscoord capMin = nsLayoutUtils::IntrinsicForContainer(
|
||||
aRenderingContext, mCaptionFrames.FirstChild(),
|
||||
nsLayoutUtils::MIN_ISIZE);
|
||||
IntrinsicISizeType::MinISize);
|
||||
maxISize += capMin;
|
||||
} break;
|
||||
default: {
|
||||
@ -345,12 +345,12 @@ nscoord nsTableWrapperFrame::GetPrefISize(gfxContext* aRenderingContext) {
|
||||
captionSide == NS_STYLE_CAPTION_SIDE_BOTTOM) {
|
||||
// Don't let the caption's pref isize expand the table's pref
|
||||
// isize.
|
||||
iwt = nsLayoutUtils::MIN_ISIZE;
|
||||
iwt = IntrinsicISizeType::MinISize;
|
||||
} else {
|
||||
NS_ASSERTION(captionSide == NS_STYLE_CAPTION_SIDE_TOP_OUTSIDE ||
|
||||
captionSide == NS_STYLE_CAPTION_SIDE_BOTTOM_OUTSIDE,
|
||||
"unexpected caption side");
|
||||
iwt = nsLayoutUtils::PREF_ISIZE;
|
||||
iwt = IntrinsicISizeType::PrefISize;
|
||||
}
|
||||
nscoord capPref = nsLayoutUtils::IntrinsicForContainer(
|
||||
aRenderingContext, mCaptionFrames.FirstChild(), iwt);
|
||||
|
Loading…
Reference in New Issue
Block a user