Bug 1888535 Part 4 - Remove DISPLAY_PREF_INLINE_SIZE and DISPLAY_MIN_INLINE_SIZE. r=layout-reviewers,emilio

The two macros are used in `GetPrefISize()` and `GetMinISize()` implementations.
After removing them, we could further simplify some implementations because we
don't need a `result` variable in many cases.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D206316
This commit is contained in:
Ting-Yu Lin 2024-04-02 19:03:04 +00:00
parent 72b3afbd86
commit 26c26e265f
33 changed files with 66 additions and 295 deletions

View file

@ -5320,7 +5320,6 @@ nscoord nsLayoutUtils::MinISizeFromInline(nsIFrame* aFrame,
"should not be container for font size inflation");
nsIFrame::InlineMinISizeData data;
DISPLAY_MIN_INLINE_SIZE(aFrame, data.mPrevLines);
aFrame->AddInlineMinISize(aRenderingContext, &data);
data.ForceBreak();
return data.mPrevLines;
@ -5333,7 +5332,6 @@ nscoord nsLayoutUtils::PrefISizeFromInline(nsIFrame* aFrame,
"should not be container for font size inflation");
nsIFrame::InlinePrefISizeData data;
DISPLAY_PREF_INLINE_SIZE(aFrame, data.mPrevLines);
aFrame->AddInlinePrefISize(aRenderingContext, &data);
data.ForceBreak();
return data.mPrevLines;

View file

@ -52,18 +52,12 @@ void nsCheckboxRadioFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
/* virtual */
nscoord nsCheckboxRadioFrame::GetMinISize(gfxContext* aRenderingContext) {
nscoord result;
DISPLAY_MIN_INLINE_SIZE(this, result);
result = StyleDisplay()->HasAppearance() ? DefaultSize() : 0;
return result;
return StyleDisplay()->HasAppearance() ? DefaultSize() : 0;
}
/* virtual */
nscoord nsCheckboxRadioFrame::GetPrefISize(gfxContext* aRenderingContext) {
nscoord result;
DISPLAY_PREF_INLINE_SIZE(this, result);
result = StyleDisplay()->HasAppearance() ? DefaultSize() : 0;
return result;
return StyleDisplay()->HasAppearance() ? DefaultSize() : 0;
}
/* virtual */

View file

@ -190,14 +190,12 @@ nscoord nsComboboxControlFrame::GetIntrinsicISize(gfxContext* aRenderingContext,
nscoord nsComboboxControlFrame::GetMinISize(gfxContext* aRenderingContext) {
nscoord minISize;
DISPLAY_MIN_INLINE_SIZE(this, minISize);
minISize = GetIntrinsicISize(aRenderingContext, IntrinsicISizeType::MinISize);
return minISize;
}
nscoord nsComboboxControlFrame::GetPrefISize(gfxContext* aRenderingContext) {
nscoord prefISize;
DISPLAY_PREF_INLINE_SIZE(this, prefISize);
prefISize =
GetIntrinsicISize(aRenderingContext, IntrinsicISizeType::PrefISize);
return prefISize;

View file

@ -35,33 +35,21 @@ nsDateTimeControlFrame::nsDateTimeControlFrame(ComputedStyle* aStyle,
: nsContainerFrame(aStyle, aPresContext, kClassID) {}
nscoord nsDateTimeControlFrame::GetMinISize(gfxContext* aRenderingContext) {
nscoord result;
DISPLAY_MIN_INLINE_SIZE(this, result);
nsIFrame* kid = mFrames.FirstChild();
if (kid) { // display:none?
result = nsLayoutUtils::IntrinsicForContainer(aRenderingContext, kid,
IntrinsicISizeType::MinISize);
} else {
result = 0;
if (!kid) {
return 0;
}
return result;
return nsLayoutUtils::IntrinsicForContainer(aRenderingContext, kid,
IntrinsicISizeType::MinISize);
}
nscoord nsDateTimeControlFrame::GetPrefISize(gfxContext* aRenderingContext) {
nscoord result;
DISPLAY_PREF_INLINE_SIZE(this, result);
nsIFrame* kid = mFrames.FirstChild();
if (kid) { // display:none?
result = nsLayoutUtils::IntrinsicForContainer(
aRenderingContext, kid, IntrinsicISizeType::PrefISize);
} else {
result = 0;
if (!kid) {
return 0;
}
return result;
return nsLayoutUtils::IntrinsicForContainer(aRenderingContext, kid,
IntrinsicISizeType::PrefISize);
}
Maybe<nscoord> nsDateTimeControlFrame::GetNaturalBaselineBOffset(

View file

@ -348,19 +348,11 @@ nscoord nsFieldSetFrame::GetIntrinsicISize(gfxContext* aRenderingContext,
}
nscoord nsFieldSetFrame::GetMinISize(gfxContext* aRenderingContext) {
nscoord result = 0;
DISPLAY_MIN_INLINE_SIZE(this, result);
result = GetIntrinsicISize(aRenderingContext, IntrinsicISizeType::MinISize);
return result;
return GetIntrinsicISize(aRenderingContext, IntrinsicISizeType::MinISize);
}
nscoord nsFieldSetFrame::GetPrefISize(gfxContext* aRenderingContext) {
nscoord result = 0;
DISPLAY_PREF_INLINE_SIZE(this, result);
result = GetIntrinsicISize(aRenderingContext, IntrinsicISizeType::PrefISize);
return result;
return GetIntrinsicISize(aRenderingContext, IntrinsicISizeType::PrefISize);
}
/* virtual */

View file

@ -238,29 +238,21 @@ void nsHTMLButtonControlFrame::BuildDisplayList(
}
nscoord nsHTMLButtonControlFrame::GetMinISize(gfxContext* aRenderingContext) {
nscoord result;
DISPLAY_MIN_INLINE_SIZE(this, result);
if (Maybe<nscoord> containISize = ContainIntrinsicISize()) {
result = *containISize;
} else {
nsIFrame* kid = mFrames.FirstChild();
result = nsLayoutUtils::IntrinsicForContainer(aRenderingContext, kid,
IntrinsicISizeType::MinISize);
return *containISize;
}
return result;
nsIFrame* kid = mFrames.FirstChild();
return nsLayoutUtils::IntrinsicForContainer(aRenderingContext, kid,
IntrinsicISizeType::MinISize);
}
nscoord nsHTMLButtonControlFrame::GetPrefISize(gfxContext* aRenderingContext) {
nscoord result;
DISPLAY_PREF_INLINE_SIZE(this, result);
if (Maybe<nscoord> containISize = ContainIntrinsicISize()) {
result = *containISize;
} else {
nsIFrame* kid = mFrames.FirstChild();
result = nsLayoutUtils::IntrinsicForContainer(
aRenderingContext, kid, IntrinsicISizeType::PrefISize);
return *containISize;
}
return result;
nsIFrame* kid = mFrames.FirstChild();
return nsLayoutUtils::IntrinsicForContainer(aRenderingContext, kid,
IntrinsicISizeType::PrefISize);
}
void nsHTMLButtonControlFrame::Reflow(nsPresContext* aPresContext,

View file

@ -230,34 +230,30 @@ nscoord nsListControlFrame::CalcBSizeOfARow() {
}
nscoord nsListControlFrame::GetPrefISize(gfxContext* aRenderingContext) {
nscoord result;
DISPLAY_PREF_INLINE_SIZE(this, result);
// Always add scrollbar inline sizes to the pref-inline-size of the
// scrolled content. Combobox frames depend on this happening in the
// dropdown, and standalone listboxes are overflow:scroll so they need
// it too.
WritingMode wm = GetWritingMode();
Maybe<nscoord> containISize = ContainIntrinsicISize();
result = containISize ? *containISize
: GetScrolledFrame()->GetPrefISize(aRenderingContext);
nscoord result = containISize
? *containISize
: GetScrolledFrame()->GetPrefISize(aRenderingContext);
LogicalMargin scrollbarSize(wm, GetDesiredScrollbarSizes());
result = NSCoordSaturatingAdd(result, scrollbarSize.IStartEnd(wm));
return result;
}
nscoord nsListControlFrame::GetMinISize(gfxContext* aRenderingContext) {
nscoord result;
DISPLAY_MIN_INLINE_SIZE(this, result);
// Always add scrollbar inline sizes to the min-inline-size of the
// scrolled content. Combobox frames depend on this happening in the
// dropdown, and standalone listboxes are overflow:scroll so they need
// it too.
WritingMode wm = GetWritingMode();
Maybe<nscoord> containISize = ContainIntrinsicISize();
result = containISize ? *containISize
: GetScrolledFrame()->GetMinISize(aRenderingContext);
nscoord result = containISize
? *containISize
: GetScrolledFrame()->GetMinISize(aRenderingContext);
LogicalMargin scrollbarSize(wm, GetDesiredScrollbarSizes());
result += scrollbarSize.IStartEnd(wm);

View file

@ -553,19 +553,14 @@ void nsTextControlFrame::AppendAnonymousContentTo(
}
nscoord nsTextControlFrame::GetPrefISize(gfxContext* aRenderingContext) {
nscoord result = 0;
DISPLAY_PREF_INLINE_SIZE(this, result);
WritingMode wm = GetWritingMode();
result = CalcIntrinsicSize(aRenderingContext, wm).ISize(wm);
return result;
return CalcIntrinsicSize(aRenderingContext, wm).ISize(wm);
}
nscoord nsTextControlFrame::GetMinISize(gfxContext* aRenderingContext) {
// Our min inline size is just our preferred width if we have auto inline size
nscoord result;
DISPLAY_MIN_INLINE_SIZE(this, result);
result = GetPrefISize(aRenderingContext);
return result;
// Our min inline size is just our preferred inline-size if we have auto
// inline size.
return GetPrefISize(aRenderingContext);
}
Maybe<nscoord> nsTextControlFrame::ComputeBaseline(

View file

@ -186,18 +186,10 @@ void BRFrame::AddInlinePrefISize(gfxContext* aRenderingContext,
}
/* virtual */
nscoord BRFrame::GetMinISize(gfxContext* aRenderingContext) {
nscoord result = 0;
DISPLAY_MIN_INLINE_SIZE(this, result);
return result;
}
nscoord BRFrame::GetMinISize(gfxContext* aRenderingContext) { return 0; }
/* virtual */
nscoord BRFrame::GetPrefISize(gfxContext* aRenderingContext) {
nscoord result = 0;
DISPLAY_PREF_INLINE_SIZE(this, result);
return result;
}
nscoord BRFrame::GetPrefISize(gfxContext* aRenderingContext) { return 0; }
Maybe<nscoord> BRFrame::GetNaturalBaselineBOffset(
WritingMode aWM, BaselineSharingGroup aBaselineGroup,

View file

@ -151,7 +151,6 @@ void ColumnSetWrapperFrame::MarkIntrinsicISizesDirty() {
nscoord ColumnSetWrapperFrame::GetMinISize(gfxContext* aRenderingContext) {
nscoord iSize = 0;
DISPLAY_MIN_INLINE_SIZE(this, iSize);
if (Maybe<nscoord> containISize =
ContainIntrinsicISize(NS_UNCONSTRAINEDSIZE)) {
@ -193,7 +192,6 @@ nscoord ColumnSetWrapperFrame::GetMinISize(gfxContext* aRenderingContext) {
nscoord ColumnSetWrapperFrame::GetPrefISize(gfxContext* aRenderingContext) {
nscoord iSize = 0;
DISPLAY_PREF_INLINE_SIZE(this, iSize);
if (Maybe<nscoord> containISize =
ContainIntrinsicISize(NS_UNCONSTRAINEDSIZE)) {

View file

@ -57,18 +57,11 @@ void MiddleCroppingBlockFrame::UpdateDisplayedValueToUncroppedValue(
}
nscoord MiddleCroppingBlockFrame::GetMinISize(gfxContext* aRenderingContext) {
nscoord result;
DISPLAY_MIN_INLINE_SIZE(this, result);
// Our min inline size is our pref inline size
result = GetPrefISize(aRenderingContext);
return result;
return GetPrefISize(aRenderingContext);
}
nscoord MiddleCroppingBlockFrame::GetPrefISize(gfxContext* aRenderingContext) {
nscoord result;
DISPLAY_PREF_INLINE_SIZE(this, result);
nsAutoString prevValue;
bool restoreOldValue = false;
@ -79,7 +72,7 @@ nscoord MiddleCroppingBlockFrame::GetPrefISize(gfxContext* aRenderingContext) {
UpdateDisplayedValueToUncroppedValue(false);
}
result = nsBlockFrame::GetPrefISize(aRenderingContext);
nscoord result = nsBlockFrame::GetPrefISize(aRenderingContext);
if (restoreOldValue) {
UpdateDisplayedValue(prevValue, /* aIsCropped = */ true, false);

View file

@ -271,26 +271,16 @@ void ViewportFrame::RemoveFrame(DestroyContext& aContext, ChildListID aListID,
/* virtual */
nscoord ViewportFrame::GetMinISize(gfxContext* aRenderingContext) {
nscoord result;
DISPLAY_MIN_INLINE_SIZE(this, result);
if (mFrames.IsEmpty())
result = 0;
else
result = mFrames.FirstChild()->GetMinISize(aRenderingContext);
return result;
return mFrames.IsEmpty()
? 0
: mFrames.FirstChild()->GetMinISize(aRenderingContext);
}
/* virtual */
nscoord ViewportFrame::GetPrefISize(gfxContext* aRenderingContext) {
nscoord result;
DISPLAY_PREF_INLINE_SIZE(this, result);
if (mFrames.IsEmpty())
result = 0;
else
result = mFrames.FirstChild()->GetPrefISize(aRenderingContext);
return result;
return mFrames.IsEmpty()
? 0
: mFrames.FirstChild()->GetPrefISize(aRenderingContext);
}
nsPoint ViewportFrame::AdjustReflowInputForScrollbars(

View file

@ -813,8 +813,6 @@ nscoord nsBlockFrame::GetMinISize(gfxContext* aRenderingContext) {
return firstInFlow->GetMinISize(aRenderingContext);
}
DISPLAY_MIN_INLINE_SIZE(this, mCachedMinISize);
CheckIntrinsicCacheAgainstShrinkWrapState();
if (mCachedMinISize != NS_INTRINSIC_ISIZE_UNKNOWN) {
@ -902,8 +900,6 @@ nscoord nsBlockFrame::GetPrefISize(gfxContext* aRenderingContext) {
return firstInFlow->GetPrefISize(aRenderingContext);
}
DISPLAY_PREF_INLINE_SIZE(this, mCachedPrefISize);
CheckIntrinsicCacheAgainstShrinkWrapState();
if (mCachedPrefISize != NS_INTRINSIC_ISIZE_UNKNOWN) {

View file

@ -606,24 +606,16 @@ void nsCanvasFrame::PaintFocus(DrawTarget* aDrawTarget, nsPoint aPt) {
/* virtual */
nscoord nsCanvasFrame::GetMinISize(gfxContext* aRenderingContext) {
nscoord result;
DISPLAY_MIN_INLINE_SIZE(this, result);
if (mFrames.IsEmpty())
result = 0;
else
result = mFrames.FirstChild()->GetMinISize(aRenderingContext);
return result;
return mFrames.IsEmpty()
? 0
: mFrames.FirstChild()->GetMinISize(aRenderingContext);
}
/* virtual */
nscoord nsCanvasFrame::GetPrefISize(gfxContext* aRenderingContext) {
nscoord result;
DISPLAY_PREF_INLINE_SIZE(this, result);
if (mFrames.IsEmpty())
result = 0;
else
result = mFrames.FirstChild()->GetPrefISize(aRenderingContext);
return result;
return mFrames.IsEmpty()
? 0
: mFrames.FirstChild()->GetPrefISize(aRenderingContext);
}
void nsCanvasFrame::Reflow(nsPresContext* aPresContext,

View file

@ -408,7 +408,6 @@ static void MoveChildTo(nsIFrame* aChild, LogicalPoint aOrigin, WritingMode aWM,
nscoord nsColumnSetFrame::GetMinISize(gfxContext* aRenderingContext) {
nscoord iSize = 0;
DISPLAY_MIN_INLINE_SIZE(this, iSize);
if (mFrames.FirstChild()) {
// We want to ignore this in the case that we're size contained
@ -443,8 +442,6 @@ nscoord nsColumnSetFrame::GetPrefISize(gfxContext* aRenderingContext) {
// the child's preferred width, times the number of columns, plus the width
// of any required column gaps
// XXX what about forced column breaks here?
nscoord result = 0;
DISPLAY_PREF_INLINE_SIZE(this, result);
const nsStyleColumn* colStyle = StyleColumn();
nscoord colISize;
@ -466,8 +463,7 @@ nscoord nsColumnSetFrame::GetPrefISize(gfxContext* aRenderingContext) {
? 1
: colStyle->mColumnCount;
nscoord colGap = ColumnUtils::GetColumnGap(this, NS_UNCONSTRAINEDSIZE);
result = ColumnUtils::IntrinsicISize(numColumns, colGap, colISize);
return result;
return ColumnUtils::IntrinsicISize(numColumns, colGap, colISize);
}
nsColumnSetFrame::ColumnBalanceData nsColumnSetFrame::ReflowColumns(

View file

@ -1093,34 +1093,15 @@ struct DR_cookie {
void* mValue;
};
struct DR_intrinsic_inline_size_cookie {
DR_intrinsic_inline_size_cookie(nsIFrame* aFrame, const char* aType,
nscoord& aResult);
~DR_intrinsic_inline_size_cookie();
nsIFrame* mFrame;
const char* mType;
nscoord& mResult;
void* mValue;
};
# define DISPLAY_REFLOW(dr_pres_context, dr_frame, dr_rf_state, \
dr_rf_metrics, dr_rf_status) \
DR_cookie dr_cookie(dr_pres_context, dr_frame, dr_rf_state, dr_rf_metrics, \
dr_rf_status);
# define DISPLAY_MIN_INLINE_SIZE(dr_frame, dr_result) \
DR_intrinsic_inline_size_cookie dr_cookie(dr_frame, "Min", dr_result)
# define DISPLAY_PREF_INLINE_SIZE(dr_frame, dr_result) \
DR_intrinsic_inline_size_cookie dr_cookie(dr_frame, "Pref", dr_result)
#else
# define DISPLAY_REFLOW(dr_pres_context, dr_frame, dr_rf_state, \
dr_rf_metrics, dr_rf_status)
# define DISPLAY_MIN_INLINE_SIZE(dr_frame, dr_result) \
PR_BEGIN_MACRO PR_END_MACRO
# define DISPLAY_PREF_INLINE_SIZE(dr_frame, dr_result) \
PR_BEGIN_MACRO PR_END_MACRO
#endif
// End Display Reflow Debugging

View file

@ -6330,7 +6330,6 @@ nscoord nsFlexContainerFrame::IntrinsicISize(gfxContext* aRenderingContext,
/* virtual */
nscoord nsFlexContainerFrame::GetMinISize(gfxContext* aRenderingContext) {
DISPLAY_MIN_INLINE_SIZE(this, mCachedMinISize);
if (mCachedMinISize == NS_INTRINSIC_ISIZE_UNKNOWN) {
if (Maybe<nscoord> containISize = ContainIntrinsicISize()) {
mCachedMinISize = *containISize;
@ -6345,7 +6344,6 @@ nscoord nsFlexContainerFrame::GetMinISize(gfxContext* aRenderingContext) {
/* virtual */
nscoord nsFlexContainerFrame::GetPrefISize(gfxContext* aRenderingContext) {
DISPLAY_PREF_INLINE_SIZE(this, mCachedPrefISize);
if (mCachedPrefISize == NS_INTRINSIC_ISIZE_UNKNOWN) {
if (Maybe<nscoord> containISize = ContainIntrinsicISize()) {
mCachedPrefISize = *containISize;

View file

@ -1290,7 +1290,6 @@ nscoord nsHTMLScrollFrame::GetMinISize(gfxContext* aRenderingContext) {
return mScrolledFrame->GetMinISize(aRenderingContext);
}();
DISPLAY_MIN_INLINE_SIZE(this, result);
return result + IntrinsicScrollbarGutterSizeAtInlineEdges();
}
@ -1300,7 +1299,6 @@ nscoord nsHTMLScrollFrame::GetPrefISize(gfxContext* aRenderingContext) {
nscoord result = containISize
? *containISize
: mScrolledFrame->GetPrefISize(aRenderingContext);
DISPLAY_PREF_INLINE_SIZE(this, result);
return NSCoordSaturatingAdd(result,
IntrinsicScrollbarGutterSizeAtInlineEdges());
}

View file

@ -9678,7 +9678,6 @@ nscoord nsGridContainerFrame::GetMinISize(gfxContext* aRC) {
return f->GetMinISize(aRC);
}
DISPLAY_MIN_INLINE_SIZE(this, mCachedMinISize);
if (mCachedMinISize == NS_INTRINSIC_ISIZE_UNKNOWN) {
Maybe<nscoord> containISize = ContainIntrinsicISize();
mCachedMinISize = containISize
@ -9694,7 +9693,6 @@ nscoord nsGridContainerFrame::GetPrefISize(gfxContext* aRC) {
return f->GetPrefISize(aRC);
}
DISPLAY_PREF_INLINE_SIZE(this, mCachedPrefISize);
if (mCachedPrefISize == NS_INTRINSIC_ISIZE_UNKNOWN) {
Maybe<nscoord> containISize = ContainIntrinsicISize();
mCachedPrefISize = containISize

View file

@ -382,7 +382,6 @@ nscoord nsHTMLCanvasFrame::GetMinISize(gfxContext* aRenderingContext) {
result = nsPresContext::CSSPixelsToAppUnits(
vertical ? GetCanvasSize().height : GetCanvasSize().width);
}
DISPLAY_MIN_INLINE_SIZE(this, result);
return result;
}
@ -398,7 +397,6 @@ nscoord nsHTMLCanvasFrame::GetPrefISize(gfxContext* aRenderingContext) {
result = nsPresContext::CSSPixelsToAppUnits(
vertical ? GetCanvasSize().height : GetCanvasSize().width);
}
DISPLAY_PREF_INLINE_SIZE(this, result);
return result;
}

View file

@ -6006,18 +6006,10 @@ void nsIFrame::MarkSubtreeDirty() {
}
/* virtual */
nscoord nsIFrame::GetMinISize(gfxContext* aRenderingContext) {
nscoord result = 0;
DISPLAY_MIN_INLINE_SIZE(this, result);
return result;
}
nscoord nsIFrame::GetMinISize(gfxContext* aRenderingContext) { return 0; }
/* virtual */
nscoord nsIFrame::GetPrefISize(gfxContext* aRenderingContext) {
nscoord result = 0;
DISPLAY_PREF_INLINE_SIZE(this, result);
return result;
}
nscoord nsIFrame::GetPrefISize(gfxContext* aRenderingContext) { return 0; }
/* virtual */
void nsIFrame::AddInlineMinISize(gfxContext* aRenderingContext,
@ -11699,18 +11691,6 @@ DR_cookie::~DR_cookie() {
nsIFrame::DisplayReflowExit(mPresContext, mFrame, mMetrics, mStatus, mValue);
}
DR_intrinsic_inline_size_cookie::DR_intrinsic_inline_size_cookie(
nsIFrame* aFrame, const char* aType, nscoord& aResult)
: mFrame(aFrame), mType(aType), mResult(aResult) {
MOZ_COUNT_CTOR(DR_intrinsic_inline_size_cookie);
mValue = nsIFrame::DisplayIntrinsicISizeEnter(mFrame, mType);
}
DR_intrinsic_inline_size_cookie::~DR_intrinsic_inline_size_cookie() {
MOZ_COUNT_DTOR(DR_intrinsic_inline_size_cookie);
nsIFrame::DisplayIntrinsicISizeExit(mFrame, mType, mResult, mValue);
}
struct DR_Rule;
struct DR_FrameTypeInfo {
@ -12346,21 +12326,6 @@ void* nsIFrame::DisplayReflowEnter(nsPresContext* aPresContext,
return treeNode;
}
void* nsIFrame::DisplayIntrinsicISizeEnter(nsIFrame* aFrame,
const char* aType) {
if (!DR_state->mInited) DR_state->Init();
if (!DR_state->mActive) return nullptr;
NS_ASSERTION(aFrame, "invalid call");
DR_FrameTreeNode* treeNode = DR_state->CreateTreeNode(aFrame, nullptr);
if (treeNode && treeNode->mDisplay) {
DR_state->DisplayFrameTypeInfo(aFrame, treeNode->mIndent);
printf("Get%sISize\n", aType);
}
return treeNode;
}
void nsIFrame::DisplayReflowExit(nsPresContext* aPresContext, nsIFrame* aFrame,
ReflowOutput& aMetrics,
const nsReflowStatus& aStatus,
@ -12422,24 +12387,6 @@ void nsIFrame::DisplayReflowExit(nsPresContext* aPresContext, nsIFrame* aFrame,
DR_state->DeleteTreeNode(*treeNode);
}
void nsIFrame::DisplayIntrinsicISizeExit(nsIFrame* aFrame, const char* aType,
nscoord aResult,
void* aFrameTreeNode) {
if (!DR_state->mActive) return;
NS_ASSERTION(aFrame, "non-null frame required");
if (!aFrameTreeNode) return;
DR_FrameTreeNode* treeNode = (DR_FrameTreeNode*)aFrameTreeNode;
if (treeNode->mDisplay) {
DR_state->DisplayFrameTypeInfo(aFrame, treeNode->mIndent);
char iSize[16];
DR_state->PrettyUC(aResult, iSize, 16);
printf("Get%sISize=%s\n", aType, iSize);
}
DR_state->DeleteTreeNode(*treeNode);
}
/* static */
void nsIFrame::DisplayReflowStartup() { DR_state = new DR_State(); }

View file

@ -5492,13 +5492,10 @@ class nsIFrame : public nsQueryFrame {
// Display Reflow Debugging
static void* DisplayReflowEnter(nsPresContext* aPresContext, nsIFrame* aFrame,
const ReflowInput& aReflowInput);
static void* DisplayIntrinsicISizeEnter(nsIFrame* aFrame, const char* aType);
static void DisplayReflowExit(nsPresContext* aPresContext, nsIFrame* aFrame,
ReflowOutput& aMetrics,
const nsReflowStatus& aStatus,
void* aFrameTreeNode);
static void DisplayIntrinsicISizeExit(nsIFrame* aFrame, const char* aType,
nscoord aResult, void* aFrameTreeNode);
static void DisplayReflowStartup();
static void DisplayReflowShutdown();

View file

@ -1476,8 +1476,6 @@ nscoord nsImageFrame::GetContinuationOffset() const {
nscoord nsImageFrame::GetMinISize(gfxContext* aRenderingContext) {
// XXX The caller doesn't account for constraints of the block-size,
// min-block-size, and max-block-size properties.
DebugOnly<nscoord> result;
DISPLAY_MIN_INLINE_SIZE(this, result);
EnsureIntrinsicSizeAndRatio();
const auto& iSize = GetWritingMode().IsVertical() ? mIntrinsicSize.height
: mIntrinsicSize.width;
@ -1487,8 +1485,6 @@ nscoord nsImageFrame::GetMinISize(gfxContext* aRenderingContext) {
nscoord nsImageFrame::GetPrefISize(gfxContext* aRenderingContext) {
// XXX The caller doesn't account for constraints of the block-size,
// min-block-size, and max-block-size properties.
DebugOnly<nscoord> result;
DISPLAY_PREF_INLINE_SIZE(this, result);
EnsureIntrinsicSizeAndRatio();
const auto& iSize = GetWritingMode().IsVertical() ? mIntrinsicSize.height
: mIntrinsicSize.width;

View file

@ -24,18 +24,12 @@ void nsLeafFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
/* virtual */
nscoord nsLeafFrame::GetMinISize(gfxContext* aRenderingContext) {
nscoord result;
DISPLAY_MIN_INLINE_SIZE(this, result);
result = GetIntrinsicISize();
return result;
return GetIntrinsicISize();
}
/* virtual */
nscoord nsLeafFrame::GetPrefISize(gfxContext* aRenderingContext) {
nscoord result;
DISPLAY_PREF_INLINE_SIZE(this, result);
result = GetIntrinsicISize();
return result;
return GetIntrinsicISize();
}
/* virtual */

View file

@ -555,7 +555,6 @@ nsresult nsSubDocumentFrame::GetFrameName(nsAString& aResult) const {
/* virtual */
nscoord nsSubDocumentFrame::GetMinISize(gfxContext* aRenderingContext) {
nscoord result;
DISPLAY_MIN_INLINE_SIZE(this, result);
nsCOMPtr<nsIObjectLoadingContent> iolc = do_QueryInterface(mContent);
auto olc = static_cast<nsObjectLoadingContent*>(iolc.get());
@ -575,18 +574,13 @@ nscoord nsSubDocumentFrame::GetMinISize(gfxContext* aRenderingContext) {
/* virtual */
nscoord nsSubDocumentFrame::GetPrefISize(gfxContext* aRenderingContext) {
nscoord result;
DISPLAY_PREF_INLINE_SIZE(this, result);
// If the subdocument is an SVG document, then in theory we want to return
// the same thing that SVGOuterSVGFrame::GetPrefISize does. That method
// has some special handling of percentage values to avoid unhelpful zero
// sizing in the presence of orthogonal writing modes. We don't bother
// with that for SVG documents in <embed> and <object>, since that special
// handling doesn't look up across document boundaries anyway.
result = GetIntrinsicISize();
return result;
return GetIntrinsicISize();
}
/* virtual */

View file

@ -375,14 +375,9 @@ nsIFrame::SizeComputationResult nsVideoFrame::ComputeSize(
}
nscoord nsVideoFrame::GetMinISize(gfxContext* aRenderingContext) {
nscoord result;
// Bind the result variable to a RAII-based debug object - the variable
// therefore must match the function's return value.
DISPLAY_MIN_INLINE_SIZE(this, result);
// This call handles size-containment
nsSize size = GetIntrinsicSize().ToSize().valueOr(nsSize());
result = GetWritingMode().IsVertical() ? size.height : size.width;
return result;
return GetWritingMode().IsVertical() ? size.height : size.width;
}
nscoord nsVideoFrame::GetPrefISize(gfxContext* aRenderingContext) {

View file

@ -848,20 +848,14 @@ void nsMathMLContainerFrame::UpdateIntrinsicWidth(
/* virtual */
nscoord nsMathMLContainerFrame::GetMinISize(gfxContext* aRenderingContext) {
nscoord result;
DISPLAY_MIN_INLINE_SIZE(this, result);
UpdateIntrinsicWidth(aRenderingContext);
result = mIntrinsicWidth;
return result;
return mIntrinsicWidth;
}
/* virtual */
nscoord nsMathMLContainerFrame::GetPrefISize(gfxContext* aRenderingContext) {
nscoord result;
DISPLAY_PREF_INLINE_SIZE(this, result);
UpdateIntrinsicWidth(aRenderingContext);
result = mIntrinsicWidth;
return result;
return mIntrinsicWidth;
}
/* virtual */

View file

@ -126,20 +126,14 @@ NS_QUERYFRAME_TAIL_INHERITING(SVGDisplayContainerFrame)
/* virtual */
nscoord SVGOuterSVGFrame::GetMinISize(gfxContext* aRenderingContext) {
nscoord result;
DISPLAY_MIN_INLINE_SIZE(this, result);
// If this ever changes to return something other than zero, then
// nsSubDocumentFrame::GetMinISize will also need to change.
result = nscoord(0);
return result;
return 0;
}
/* virtual */
nscoord SVGOuterSVGFrame::GetPrefISize(gfxContext* aRenderingContext) {
nscoord result;
DISPLAY_PREF_INLINE_SIZE(this, result);
SVGSVGElement* svg = static_cast<SVGSVGElement*>(GetContent());
WritingMode wm = GetWritingMode();

View file

@ -37,7 +37,6 @@ BasicTableLayoutStrategy::~BasicTableLayoutStrategy() = default;
/* virtual */
nscoord BasicTableLayoutStrategy::GetMinISize(gfxContext* aRenderingContext) {
DISPLAY_MIN_INLINE_SIZE(mTableFrame, mMinISize);
if (mMinISize == NS_INTRINSIC_ISIZE_UNKNOWN) {
ComputeIntrinsicISizes(aRenderingContext);
}
@ -47,7 +46,6 @@ nscoord BasicTableLayoutStrategy::GetMinISize(gfxContext* aRenderingContext) {
/* virtual */
nscoord BasicTableLayoutStrategy::GetPrefISize(gfxContext* aRenderingContext,
bool aComputingSize) {
DISPLAY_PREF_INLINE_SIZE(mTableFrame, mPrefISize);
NS_ASSERTION((mPrefISize == NS_INTRINSIC_ISIZE_UNKNOWN) ==
(mPrefISizePctExpand == NS_INTRINSIC_ISIZE_UNKNOWN),
"dirtyness out of sync");

View file

@ -32,7 +32,6 @@ FixedTableLayoutStrategy::~FixedTableLayoutStrategy() = default;
/* virtual */
nscoord FixedTableLayoutStrategy::GetMinISize(gfxContext* aRenderingContext) {
DISPLAY_MIN_INLINE_SIZE(mTableFrame, mMinISize);
if (mMinISize != NS_INTRINSIC_ISIZE_UNKNOWN) {
return mMinISize;
}
@ -119,9 +118,7 @@ nscoord FixedTableLayoutStrategy::GetPrefISize(gfxContext* aRenderingContext,
// algorithm to find the narrowest inline size that would hold all of
// those intrinsic inline sizes), but it wouldn't be compatible with
// other browsers.
nscoord result = nscoord_MAX;
DISPLAY_PREF_INLINE_SIZE(mTableFrame, result);
return result;
return nscoord_MAX;
}
/* virtual */

View file

@ -595,26 +595,18 @@ nsIScrollableFrame* nsTableCellFrame::GetScrollTargetFrame() const {
/* virtual */
nscoord nsTableCellFrame::GetMinISize(gfxContext* aRenderingContext) {
nscoord result = 0;
DISPLAY_MIN_INLINE_SIZE(this, result);
nsIFrame* inner = mFrames.FirstChild();
result = nsLayoutUtils::IntrinsicForContainer(aRenderingContext, inner,
IntrinsicISizeType::MinISize,
nsLayoutUtils::IGNORE_PADDING);
return result;
return nsLayoutUtils::IntrinsicForContainer(aRenderingContext, inner,
IntrinsicISizeType::MinISize,
nsLayoutUtils::IGNORE_PADDING);
}
/* virtual */
nscoord nsTableCellFrame::GetPrefISize(gfxContext* aRenderingContext) {
nscoord result = 0;
DISPLAY_PREF_INLINE_SIZE(this, result);
nsIFrame* inner = mFrames.FirstChild();
result = nsLayoutUtils::IntrinsicForContainer(aRenderingContext, inner,
IntrinsicISizeType::PrefISize,
nsLayoutUtils::IGNORE_PADDING);
return result;
return nsLayoutUtils::IntrinsicForContainer(aRenderingContext, inner,
IntrinsicISizeType::PrefISize,
nsLayoutUtils::IGNORE_PADDING);
}
/* virtual */ nsIFrame::IntrinsicSizeOffsetData

View file

@ -242,7 +242,6 @@ ComputedStyle* nsTableWrapperFrame::GetParentComputedStyle(
nscoord nsTableWrapperFrame::GetMinISize(gfxContext* aRenderingContext) {
nscoord iSize = nsLayoutUtils::IntrinsicForContainer(
aRenderingContext, InnerTableFrame(), IntrinsicISizeType::MinISize);
DISPLAY_MIN_INLINE_SIZE(this, iSize);
if (mCaptionFrames.NotEmpty()) {
nscoord capISize = nsLayoutUtils::IntrinsicForContainer(
aRenderingContext, mCaptionFrames.FirstChild(),
@ -256,10 +255,7 @@ nscoord nsTableWrapperFrame::GetMinISize(gfxContext* aRenderingContext) {
/* virtual */
nscoord nsTableWrapperFrame::GetPrefISize(gfxContext* aRenderingContext) {
nscoord maxISize;
DISPLAY_PREF_INLINE_SIZE(this, maxISize);
maxISize = nsLayoutUtils::IntrinsicForContainer(
nscoord maxISize = nsLayoutUtils::IntrinsicForContainer(
aRenderingContext, InnerTableFrame(), IntrinsicISizeType::PrefISize);
if (mCaptionFrames.NotEmpty()) {
// Don't let the caption's pref isize expand the table's pref isize.

View file

@ -491,19 +491,13 @@ void nsMenuPopupFrame::TweakMinPrefISize(nscoord& aSize) {
}
nscoord nsMenuPopupFrame::GetMinISize(gfxContext* aRC) {
nscoord result;
DISPLAY_PREF_INLINE_SIZE(this, result);
result = nsBlockFrame::GetMinISize(aRC);
nscoord result = nsBlockFrame::GetMinISize(aRC);
TweakMinPrefISize(result);
return result;
}
nscoord nsMenuPopupFrame::GetPrefISize(gfxContext* aRC) {
nscoord result;
DISPLAY_PREF_INLINE_SIZE(this, result);
result = nsBlockFrame::GetPrefISize(aRC);
nscoord result = nsBlockFrame::GetPrefISize(aRC);
TweakMinPrefISize(result);
return result;
}