summaryrefslogtreecommitdiffstats
path: root/layout/generic/nsFlexContainerFrame.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /layout/generic/nsFlexContainerFrame.cpp
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/generic/nsFlexContainerFrame.cpp')
-rw-r--r--layout/generic/nsFlexContainerFrame.cpp205
1 files changed, 105 insertions, 100 deletions
diff --git a/layout/generic/nsFlexContainerFrame.cpp b/layout/generic/nsFlexContainerFrame.cpp
index e5a719fee2..66f1e79609 100644
--- a/layout/generic/nsFlexContainerFrame.cpp
+++ b/layout/generic/nsFlexContainerFrame.cpp
@@ -14,14 +14,12 @@
#include "mozilla/Baseline.h"
#include "mozilla/ComputedStyle.h"
#include "mozilla/CSSOrderAwareFrameIterator.h"
-#include "mozilla/FloatingPoint.h"
#include "mozilla/Logging.h"
#include "mozilla/PresShell.h"
#include "mozilla/StaticPrefs_layout.h"
#include "mozilla/WritingModes.h"
#include "nsBlockFrame.h"
#include "nsContentUtils.h"
-#include "nsCSSAnonBoxes.h"
#include "nsDebug.h"
#include "nsDisplayList.h"
#include "nsFieldSetFrame.h"
@@ -43,10 +41,25 @@ using CachedBAxisMeasurement = nsFlexContainerFrame::CachedBAxisMeasurement;
using CachedFlexItemData = nsFlexContainerFrame::CachedFlexItemData;
static mozilla::LazyLogModule gFlexContainerLog("FlexContainer");
-#define FLEX_LOG(...) \
- MOZ_LOG(gFlexContainerLog, LogLevel::Debug, (__VA_ARGS__));
-#define FLEX_LOGV(...) \
- MOZ_LOG(gFlexContainerLog, LogLevel::Verbose, (__VA_ARGS__));
+
+// FLEX_LOG is a top-level general log print.
+#define FLEX_LOG(message, ...) \
+ MOZ_LOG(gFlexContainerLog, LogLevel::Debug, (message, ##__VA_ARGS__));
+
+// FLEX_ITEM_LOG is a top-level log print for flex item.
+#define FLEX_ITEM_LOG(item_frame, message, ...) \
+ MOZ_LOG(gFlexContainerLog, LogLevel::Debug, \
+ ("Flex item %p: " message, item_frame, ##__VA_ARGS__));
+
+// FLEX_LOGV is a verbose log print with built-in two spaces indentation. The
+// convention to use FLEX_LOGV is that FLEX_LOGV statements should generally be
+// preceded by one FLEX_LOG or FLEX_ITEM_LOG so that there's no need to repeat
+// information presented in the preceding LOG statement. If you want extra level
+// of indentation, just add two extra spaces at the start of the message string.
+#define FLEX_LOGV(message, ...) \
+ MOZ_LOG(gFlexContainerLog, LogLevel::Verbose, (" " message, ##__VA_ARGS__));
+
+static const char* BoolToYesNo(bool aArg) { return aArg ? "yes" : "no"; }
// Returns true if aFlexContainer is a frame for some element that has
// display:-webkit-{inline-}box (or -moz-{inline-}box). aFlexContainer is
@@ -143,10 +156,10 @@ class MOZ_STACK_CLASS nsFlexContainerFrame::FlexboxAxisTracker {
// Accessors:
LogicalAxis MainAxis() const {
- return IsRowOriented() ? eLogicalAxisInline : eLogicalAxisBlock;
+ return IsRowOriented() ? LogicalAxis::Inline : LogicalAxis::Block;
}
LogicalAxis CrossAxis() const {
- return IsRowOriented() ? eLogicalAxisBlock : eLogicalAxisInline;
+ return IsRowOriented() ? LogicalAxis::Block : LogicalAxis::Inline;
}
LogicalSide MainAxisStartSide() const;
@@ -308,7 +321,7 @@ class MOZ_STACK_CLASS nsFlexContainerFrame::FlexboxAxisTracker {
: StyleAlignFlags::END;
}
- MOZ_ASSERT(MainAxis() == eLogicalAxisInline,
+ MOZ_ASSERT(MainAxis() == LogicalAxis::Inline,
"Row-oriented flex container's main axis should be parallel to "
"line-left <-> line-right axis!");
@@ -682,9 +695,8 @@ class nsFlexContainerFrame::FlexItem final {
// to the [min,max] range:
mMainSize = NS_CSS_MINMAX(mFlexBaseSize, mMainMinSize, mMainMaxSize);
- FLEX_LOGV(
- "Set flex base size: %d, hypothetical main size: %d for flex item %p",
- mFlexBaseSize, mMainSize, mFrame);
+ FLEX_ITEM_LOG(mFrame, "Set flex base size: %d, hypothetical main size: %d",
+ mFlexBaseSize, mMainSize);
}
// Setters used while we're resolving flexible lengths
@@ -1305,7 +1317,7 @@ StyleAlignFlags nsFlexContainerFrame::CSSAlignmentForAbsPosChild(
// block axis), then the caller is really asking about our *main* axis.
// Otherwise, the caller is asking about our cross axis.
const bool isMainAxis =
- (axisTracker.IsRowOriented() == (aLogicalAxis == eLogicalAxisInline));
+ (axisTracker.IsRowOriented() == (aLogicalAxis == LogicalAxis::Inline));
const nsStylePosition* containerStylePos = StylePosition();
const bool isAxisReversed = isMainAxis ? axisTracker.IsMainAxisReversed()
: axisTracker.IsCrossAxisReversed();
@@ -1592,7 +1604,7 @@ static nscoord PartiallyResolveAutoMinSize(
if (specifiedSizeSuggestion != nscoord_MAX) {
// We have the specified size suggestion. Return it now since we don't need
// to consider transferred size suggestion.
- FLEX_LOGV(" Specified size suggestion: %d", specifiedSizeSuggestion);
+ FLEX_LOGV("Specified size suggestion: %d", specifiedSizeSuggestion);
return specifiedSizeSuggestion;
}
@@ -1611,7 +1623,7 @@ static nscoord PartiallyResolveAutoMinSize(
transferredSizeSuggestion = aFlexItem.ClampMainSizeViaCrossAxisConstraints(
transferredSizeSuggestion, aItemReflowInput);
- FLEX_LOGV(" Transferred size suggestion: %d", transferredSizeSuggestion);
+ FLEX_LOGV("Transferred size suggestion: %d", transferredSizeSuggestion);
return transferredSizeSuggestion;
}
@@ -1638,8 +1650,10 @@ void nsFlexContainerFrame::ResolveAutoFlexBasisAndMinSize(
return;
}
- FLEX_LOGV("Resolving auto main size or auto min main size for flex item %p",
- aFlexItem.Frame());
+ FLEX_ITEM_LOG(
+ aFlexItem.Frame(),
+ "Resolving auto main size? %s; resolving auto min main size? %s",
+ BoolToYesNo(isMainSizeAuto), BoolToYesNo(isMainMinSizeAuto));
nscoord resolvedMinSize; // (only set/used if isMainMinSizeAuto==true)
bool minSizeNeedsToMeasureContent = false; // assume the best
@@ -1725,7 +1739,7 @@ void nsFlexContainerFrame::ResolveAutoFlexBasisAndMinSize(
contentSizeSuggestion, aItemReflowInput);
}
- FLEX_LOGV(" Content size suggestion: %d", contentSizeSuggestion);
+ FLEX_LOGV("Content size suggestion: %d", contentSizeSuggestion);
resolvedMinSize = std::min(resolvedMinSize, contentSizeSuggestion);
// Clamp the resolved min main size by the max main size if it's definite.
@@ -1739,7 +1753,7 @@ void nsFlexContainerFrame::ResolveAutoFlexBasisAndMinSize(
// nscoord_MAX sentinel value if we reach this point).
resolvedMinSize = nscoord_MAX;
}
- FLEX_LOGV(" Resolved auto min main size: %d", resolvedMinSize);
+ FLEX_LOGV("Resolved auto min main size: %d", resolvedMinSize);
if (resolvedMinSize == contentSizeSuggestion) {
// When we are here, we've measured the item's content-based size, and
@@ -1992,12 +2006,16 @@ const CachedBAxisMeasurement& nsFlexContainerFrame::MeasureBSizeForFlexItem(
if (cachedData && cachedData->mBAxisMeasurement) {
if (!aItem.Frame()->IsSubtreeDirty() &&
cachedData->mBAxisMeasurement->IsValidFor(aChildReflowInput)) {
- FLEX_LOG("[perf] MeasureBSizeForFlexItem accepted cached value");
+ FLEX_ITEM_LOG(aItem.Frame(),
+ "[perf] Accepted cached measurement: block-size %d",
+ cachedData->mBAxisMeasurement->BSize());
return *(cachedData->mBAxisMeasurement);
}
- FLEX_LOG("[perf] MeasureBSizeForFlexItem rejected cached value");
+ FLEX_ITEM_LOG(aItem.Frame(),
+ "[perf] Rejected cached measurement: block-size %d",
+ cachedData->mBAxisMeasurement->BSize());
} else {
- FLEX_LOG("[perf] MeasureBSizeForFlexItem didn't have a cached value");
+ FLEX_ITEM_LOG(aItem.Frame(), "[perf] No cached measurement");
}
// CachedFlexItemData is stored in item's writing mode, so we pass
@@ -2055,7 +2073,7 @@ void nsFlexContainerFrame::MarkIntrinsicISizesDirty() {
nscoord nsFlexContainerFrame::MeasureFlexItemContentBSize(
FlexItem& aFlexItem, bool aForceBResizeForMeasuringReflow,
const ReflowInput& aParentReflowInput) {
- FLEX_LOG("Measuring flex item's content block-size");
+ FLEX_ITEM_LOG(aFlexItem.Frame(), "Measuring item's content block-size");
// Set up a reflow input for measuring the flex item's content block-size:
WritingMode wm = aFlexItem.Frame()->GetWritingMode();
@@ -2070,7 +2088,7 @@ nscoord nsFlexContainerFrame::MeasureFlexItemContentBSize(
// block-size, because that would prevent us from measuring the content
// block-size.
sizeOverrides.mAspectRatio.emplace(AspectRatio());
- FLEX_LOGV(" Cross size override: %d", aFlexItem.CrossSize());
+ FLEX_LOGV("Cross size override: %d", aFlexItem.CrossSize());
}
sizeOverrides.mStyleBSize.emplace(StyleSize::Auto());
@@ -2234,7 +2252,7 @@ FlexItem::FlexItem(ReflowInput& aFlexItemReflowInput, float aFlexGrow,
// getting the physical side that corresponds to these axes' "logical
// start" sides, and we compare those physical sides to find out if
// they're the same vs. opposite.
- mozilla::Side itemBlockStartSide = mWM.PhysicalSide(eLogicalSideBStart);
+ mozilla::Side itemBlockStartSide = mWM.PhysicalSide(LogicalSide::BStart);
// (Note: this is *not* the "flex-start" side; rather, it's the *logical*
// i.e. WM-relative block-start or inline-start side.)
@@ -2363,7 +2381,7 @@ nscoord FlexItem::BaselineOffsetFromOuterCrossEdge(
"Only expecting to be doing baseline computations when the "
"cross axis is the block axis");
- mozilla::Side itemBlockStartSide = mWM.PhysicalSide(eLogicalSideBStart);
+ mozilla::Side itemBlockStartSide = mWM.PhysicalSide(LogicalSide::BStart);
nscoord marginBStartToBaseline = ResolvedAscent(aUseFirstLineBaseline) +
PhysicalMargin().Side(itemBlockStartSide);
@@ -2537,18 +2555,17 @@ static bool FrameHasRelativeBSizeDependency(nsIFrame* aFrame) {
bool FlexItem::NeedsFinalReflow(const ReflowInput& aParentReflowInput) const {
if (!StaticPrefs::layout_flexbox_item_final_reflow_optimization_enabled()) {
- FLEX_LOG(
- "[perf] Flex item %p needed a final reflow due to optimization being "
- "disabled via the preference",
- mFrame);
+ FLEX_ITEM_LOG(mFrame,
+ "[perf] Item needed a final reflow due to optimization being "
+ "disabled via the preference");
return true;
}
// NOTE: We can have continuations from an earlier constrained reflow.
if (mFrame->GetPrevInFlow() || mFrame->GetNextInFlow()) {
// This is an item has continuation(s). Reflow it.
- FLEX_LOG("[frag] Flex item %p needed a final reflow due to continuation(s)",
- mFrame);
+ FLEX_ITEM_LOG(mFrame,
+ "[frag] Item needed a final reflow due to continuation(s)");
return true;
}
@@ -2560,10 +2577,9 @@ bool FlexItem::NeedsFinalReflow(const ReflowInput& aParentReflowInput) const {
// prevent triggering O(n^2) behavior when printing a deeply-nested flex
// container.
if (aParentReflowInput.IsInFragmentedContext()) {
- FLEX_LOG(
- "[frag] Flex item %p needed both a measuring reflow and a final "
- "reflow due to being in a fragmented context.",
- mFrame);
+ FLEX_ITEM_LOG(mFrame,
+ "[frag] Item needed both a measuring reflow and a final "
+ "reflow due to being in a fragmented context");
return true;
}
@@ -2579,10 +2595,9 @@ bool FlexItem::NeedsFinalReflow(const ReflowInput& aParentReflowInput) const {
if (finalSize != mFrame->ContentSize(mWM)) {
// The measuring reflow left the item with a different size than its
// final flexed size. So, we need to reflow to give it the correct size.
- FLEX_LOG(
- "[perf] Flex item %p needed both a measuring reflow and a final "
- "reflow due to measured size disagreeing with final size",
- mFrame);
+ FLEX_ITEM_LOG(mFrame,
+ "[perf] Item needed both a measuring reflow and a final "
+ "reflow due to measured size disagreeing with final size");
return true;
}
@@ -2590,10 +2605,9 @@ bool FlexItem::NeedsFinalReflow(const ReflowInput& aParentReflowInput) const {
// This item has descendants with relative BSizes who may care that its
// size may now be considered "definite" in the final reflow (whereas it
// was indefinite during the measuring reflow).
- FLEX_LOG(
- "[perf] Flex item %p needed both a measuring reflow and a final "
- "reflow due to BSize potentially becoming definite",
- mFrame);
+ FLEX_ITEM_LOG(mFrame,
+ "[perf] Item needed both a measuring reflow and a final "
+ "reflow due to BSize potentially becoming definite");
return true;
}
@@ -2621,10 +2635,9 @@ bool FlexItem::NeedsFinalReflow(const ReflowInput& aParentReflowInput) const {
// definiteness.
// Let's check for each condition that would still require us to reflow:
if (mFrame->IsSubtreeDirty()) {
- FLEX_LOG(
- "[perf] Flex item %p needed a final reflow due to its subtree "
- "being dirty",
- mFrame);
+ FLEX_ITEM_LOG(
+ mFrame,
+ "[perf] Item needed a final reflow due to its subtree being dirty");
return true;
}
@@ -2634,19 +2647,17 @@ bool FlexItem::NeedsFinalReflow(const ReflowInput& aParentReflowInput) const {
// Did we cache the metrics from its most recent "final reflow"?
auto* cache = mFrame->GetProperty(CachedFlexItemData::Prop());
if (!cache || !cache->mFinalReflowMetrics) {
- FLEX_LOG(
- "[perf] Flex item %p needed a final reflow due to lacking a "
- "cached mFinalReflowMetrics (maybe cache was cleared)",
- mFrame);
+ FLEX_ITEM_LOG(mFrame,
+ "[perf] Item needed a final reflow due to lacking a cached "
+ "mFinalReflowMetrics (maybe cache was cleared)");
return true;
}
// Does the cached size match our current size?
if (cache->mFinalReflowMetrics->Size() != finalSize) {
- FLEX_LOG(
- "[perf] Flex item %p needed a final reflow due to having a "
- "different content box size vs. its most recent final reflow",
- mFrame);
+ FLEX_ITEM_LOG(mFrame,
+ "[perf] Item needed a final reflow due to having a different "
+ "content box size vs. its most recent final reflow");
return true;
}
@@ -2659,10 +2670,9 @@ bool FlexItem::NeedsFinalReflow(const ReflowInput& aParentReflowInput) const {
// reflow.
if (cache->mFinalReflowMetrics->BorderPadding() !=
BorderPadding().ConvertTo(mWM, mCBWM)) {
- FLEX_LOG(
- "[perf] Flex item %p needed a final reflow due to having a "
- "different border and padding vs. its most recent final reflow",
- mFrame);
+ FLEX_ITEM_LOG(mFrame,
+ "[perf] Item needed a final reflow due to having a different "
+ "border and padding vs. its most recent final reflow");
return true;
}
@@ -2672,10 +2682,9 @@ bool FlexItem::NeedsFinalReflow(const ReflowInput& aParentReflowInput) const {
if (cache->mFinalReflowMetrics->TreatBSizeAsIndefinite() !=
mTreatBSizeAsIndefinite &&
FrameHasRelativeBSizeDependency(mFrame)) {
- FLEX_LOG(
- "[perf] Flex item %p needed a final reflow due to having "
- "its BSize change definiteness & having a rel-BSize child",
- mFrame);
+ FLEX_ITEM_LOG(mFrame,
+ "[perf] Item needed a final reflow due to having its BSize "
+ "change definiteness & having a rel-BSize child");
return true;
}
@@ -2683,7 +2692,7 @@ bool FlexItem::NeedsFinalReflow(const ReflowInput& aParentReflowInput) const {
// dirty, and our current conditions are sufficiently similar to the most
// recent "final reflow" that it should have left our subtree in the correct
// state.)
- FLEX_LOG("[perf] Flex item %p didn't need a final reflow", mFrame);
+ FLEX_ITEM_LOG(mFrame, "[perf] Item didn't need a final reflow");
return false;
}
@@ -2757,7 +2766,7 @@ class MOZ_STACK_CLASS PositionTracker {
const WritingMode mWM;
// The axis along which we're moving.
- const LogicalAxis mAxis = eLogicalAxisInline;
+ const LogicalAxis mAxis = LogicalAxis::Inline;
// Is the axis along which we're moving reversed (e.g. LTR vs RTL) with
// respect to the corresponding axis on the flex container's WM?
@@ -3150,8 +3159,8 @@ void FlexLine::ResolveFlexibleLengths(nscoord aFlexContainerMainSize,
availableFreeSpace -= item.MainSize();
}
- FLEX_LOG(" available free space: %" PRId64 "; flex items should \"%s\"",
- availableFreeSpace.value, isUsingFlexGrow ? "grow" : "shrink");
+ FLEX_LOGV("Available free space: %" PRId64 "; flex items should \"%s\"",
+ availableFreeSpace.value, isUsingFlexGrow ? "grow" : "shrink");
// The sign of our free space should agree with the type of flexing
// (grow/shrink) that we're doing. Any disagreement should've made us use
@@ -3276,7 +3285,7 @@ void FlexLine::ResolveFlexibleLengths(nscoord aFlexContainerMainSize,
}
}
- FLEX_LOG(" Distributing available space:");
+ FLEX_LOGV("Distributing available space:");
// Since this loop only operates on unfrozen flex items, we can break as
// soon as we have seen all of them.
numUnfrozenItemsToBeSeen = NumItems() - mNumFrozenItems;
@@ -3323,8 +3332,8 @@ void FlexLine::ResolveFlexibleLengths(nscoord aFlexContainerMainSize,
item.SetMainSize(item.MainSize() +
nscoord(sizeDelta.ToMinMaxClamped()));
- FLEX_LOG(" flex item %p receives %" PRId64 ", for a total of %d",
- item.Frame(), sizeDelta.value, item.MainSize());
+ FLEX_LOGV(" Flex item %p receives %" PRId64 ", for a total of %d",
+ item.Frame(), sizeDelta.value, item.MainSize());
}
}
@@ -3360,7 +3369,7 @@ void FlexLine::ResolveFlexibleLengths(nscoord aFlexContainerMainSize,
// Fix min/max violations:
nscoord totalViolation = 0; // keeps track of adjustments for min/max
- FLEX_LOG(" Checking for violations:");
+ FLEX_LOGV("Checking for violations:");
// Since this loop only operates on unfrozen flex items, we can break as
// soon as we have seen all of them.
@@ -3392,7 +3401,7 @@ void FlexLine::ResolveFlexibleLengths(nscoord aFlexContainerMainSize,
FreezeOrRestoreEachFlexibleSize(totalViolation,
iterationCounter + 1 == NumItems());
- FLEX_LOG(" Total violation: %d", totalViolation);
+ FLEX_LOGV("Total violation: %d", totalViolation);
if (mNumFrozenItems == NumItems()) {
break;
@@ -3952,7 +3961,7 @@ void SingleLineCrossAxisPositionTracker::EnterAlignPackingSpace(
if (alignSelf == StyleAlignFlags::SELF_START ||
alignSelf == StyleAlignFlags::SELF_END) {
const LogicalAxis logCrossAxis =
- aAxisTracker.IsRowOriented() ? eLogicalAxisBlock : eLogicalAxisInline;
+ aAxisTracker.IsRowOriented() ? LogicalAxis::Block : LogicalAxis::Inline;
const WritingMode cWM = aAxisTracker.GetWritingMode();
const bool sameStart =
cWM.ParallelAxisStartsOnSameSide(logCrossAxis, aItem.GetWritingMode());
@@ -4560,7 +4569,6 @@ void nsFlexContainerFrame::Reflow(nsPresContext* aPresContext,
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsFlexContainerFrame");
- DISPLAY_REFLOW(aPresContext, this, aReflowInput, aReflowOutput, aStatus);
MOZ_ASSERT(aStatus.IsEmpty(), "Caller should pass a fresh reflow status!");
MOZ_ASSERT(aPresContext == PresContext());
NS_WARNING_ASSERTION(
@@ -4568,7 +4576,7 @@ void nsFlexContainerFrame::Reflow(nsPresContext* aPresContext,
"Unconstrained inline size; this should only result from huge sizes "
"(not intrinsic sizing w/ orthogonal flows)");
- FLEX_LOG("Reflow() for nsFlexContainerFrame %p", this);
+ FLEX_LOG("Reflowing flex container frame %p ...", this);
if (IsFrameTreeTooDeep(aReflowInput, aReflowOutput, aStatus)) {
return;
@@ -5276,8 +5284,8 @@ nsFlexContainerFrame::FlexLayoutResult nsFlexContainerFrame::DoFlexLayout(
} else {
sizeOverrides.mStyleBSize.emplace(item.StyleMainSize());
}
- FLEX_LOG("Sizing flex item %p in cross axis", item.Frame());
- FLEX_LOGV(" Main size override: %d", item.MainSize());
+ FLEX_ITEM_LOG(item.Frame(), "Sizing item in cross axis");
+ FLEX_LOGV("Main size override: %d", item.MainSize());
const WritingMode wm = item.GetWritingMode();
LogicalSize availSize = aReflowInput.ComputedSize(wm);
@@ -5640,10 +5648,10 @@ std::tuple<nscoord, nsReflowStatus> nsFlexContainerFrame::ReflowChildren(
// block-size and add it to
// PerFragmentFlexData::mCumulativeContentBoxBSize even if we are not
// laying out any child.
- FLEX_LOG(
- "[frag] Flex item %p needed to be pushed to container's "
- "next-in-flow due to position below available space's block-end",
- item.Frame());
+ FLEX_ITEM_LOG(
+ item.Frame(),
+ "[frag] Item needed to be pushed to container's next-in-flow due "
+ "to being positioned beyond block-end edge of available space");
pushedItems.Insert(item.Frame());
itemInPushedItems = true;
} else if (item.NeedsFinalReflow(aReflowInput)) {
@@ -5680,11 +5688,10 @@ std::tuple<nscoord, nsReflowStatus> nsFlexContainerFrame::ReflowChildren(
return true;
}();
if (shouldPushItem) {
- FLEX_LOG(
- "[frag] Flex item %p needed to be pushed to container's "
- "next-in-flow because its block-size is larger than the "
- "available space",
- item.Frame());
+ FLEX_ITEM_LOG(
+ item.Frame(),
+ "[frag] Item needed to be pushed to container's next-in-flow "
+ "because its block-size is larger than the available space");
pushedItems.Insert(item.Frame());
itemInPushedItems = true;
} else if (childReflowStatus.IsIncomplete()) {
@@ -6050,8 +6057,8 @@ void nsFlexContainerFrame::MoveFlexItemToFinalPosition(
logicalOffsets, &pos, aContainerSize);
}
- FLEX_LOG("Moving flex item %p to its desired position %s", aItem.Frame(),
- ToString(pos).c_str());
+ FLEX_ITEM_LOG(aItem.Frame(), "Moving item to its desired position %s",
+ ToString(pos).c_str());
aItem.Frame()->SetPosition(outerWM, pos, aContainerSize);
PositionFrameView(aItem.Frame());
PositionChildViews(aItem.Frame());
@@ -6061,7 +6068,7 @@ nsReflowStatus nsFlexContainerFrame::ReflowFlexItem(
const FlexboxAxisTracker& aAxisTracker, const ReflowInput& aReflowInput,
const FlexItem& aItem, const LogicalPoint& aFramePos,
const LogicalSize& aAvailableSize, const nsSize& aContainerSize) {
- FLEX_LOG("Doing final reflow for flex item %p", aItem.Frame());
+ FLEX_ITEM_LOG(aItem.Frame(), "Doing final reflow");
// Returns true if we should use 'auto' in block axis's StyleSizeOverrides to
// allow fragmentation-imposed block-size growth.
@@ -6131,15 +6138,15 @@ nsReflowStatus nsFlexContainerFrame::ReflowFlexItem(
// Override flex item's main size.
if (aItem.IsInlineAxisMainAxis()) {
sizeOverrides.mStyleISize.emplace(aItem.StyleMainSize());
- FLEX_LOGV(" Main size (inline-size) override: %d", aItem.MainSize());
+ FLEX_LOGV("Main size (inline-size) override: %d", aItem.MainSize());
} else {
overrideBSizeWithAuto = ComputeBSizeOverrideWithAuto();
if (overrideBSizeWithAuto) {
sizeOverrides.mStyleBSize.emplace(StyleSize::Auto());
- FLEX_LOGV(" Main size (block-size) override: Auto");
+ FLEX_LOGV("Main size (block-size) override: Auto");
} else {
sizeOverrides.mStyleBSize.emplace(aItem.StyleMainSize());
- FLEX_LOGV(" Main size (block-size) override: %d", aItem.MainSize());
+ FLEX_LOGV("Main size (block-size) override: %d", aItem.MainSize());
}
}
@@ -6148,15 +6155,15 @@ nsReflowStatus nsFlexContainerFrame::ReflowFlexItem(
if (aItem.IsStretched()) {
if (aItem.IsInlineAxisCrossAxis()) {
sizeOverrides.mStyleISize.emplace(aItem.StyleCrossSize());
- FLEX_LOGV(" Cross size (inline-size) override: %d", aItem.CrossSize());
+ FLEX_LOGV("Cross size (inline-size) override: %d", aItem.CrossSize());
} else {
overrideBSizeWithAuto = ComputeBSizeOverrideWithAuto();
if (overrideBSizeWithAuto) {
sizeOverrides.mStyleBSize.emplace(StyleSize::Auto());
- FLEX_LOGV(" Cross size (block-size) override: Auto");
+ FLEX_LOGV("Cross size (block-size) override: Auto");
} else {
sizeOverrides.mStyleBSize.emplace(aItem.StyleCrossSize());
- FLEX_LOGV(" Cross size (block-size) override: %d", aItem.CrossSize());
+ FLEX_LOGV("Cross size (block-size) override: %d", aItem.CrossSize());
}
}
}
@@ -6203,8 +6210,8 @@ nsReflowStatus nsFlexContainerFrame::ReflowFlexItem(
// after this point, because some of its methods (e.g. SetComputedWidth)
// internally call InitResizeFlags and stomp on mVResize & mHResize.
- FLEX_LOG("Reflowing flex item %p at its desired position %s", aItem.Frame(),
- ToString(aFramePos).c_str());
+ FLEX_ITEM_LOG(aItem.Frame(), "Reflowing item at its desired position %s",
+ ToString(aFramePos).c_str());
// CachedFlexItemData is stored in item's writing mode, so we pass
// aChildReflowInput into ReflowOutput's constructor.
@@ -6332,7 +6339,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;
@@ -6347,7 +6353,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;