Bug 1398963 part 1: Rename frame-state bit from NS_STATE_FLEX_IS_LEGACY_WEBKIT_BOX to NS_STATE_FLEX_IS_EMULATING_LEGACY_BOX (idempotent patch). r?mats
This patch isn't changing semantics of this bit at all - it just renames it to
a more general name. In other words, this patch does not change behavior.
MozReview-Commit-ID: 4wb13X4YinJ
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -380,17 +380,17 @@ IsFlexOrGridContainer(const nsIFrame* aF
}
// Returns true IFF the given nsIFrame is a nsFlexContainerFrame and
// represents a -webkit-{inline-}box container.
static inline bool
IsFlexContainerForLegacyBox(const nsIFrame* aFrame)
{
return aFrame->IsFlexContainerFrame() &&
- aFrame->HasAnyStateBits(NS_STATE_FLEX_IS_LEGACY_WEBKIT_BOX);
+ aFrame->HasAnyStateBits(NS_STATE_FLEX_IS_EMULATING_LEGACY_BOX);
}
#if DEBUG
static void
AssertAnonymousFlexOrGridItemParent(const nsIFrame* aChild,
const nsIFrame* aParent)
{
MOZ_ASSERT(IsAnonymousFlexOrGridItem(aChild),
--- a/layout/generic/nsFlexContainerFrame.cpp
+++ b/layout/generic/nsFlexContainerFrame.cpp
@@ -93,17 +93,17 @@ IsDisplayValueLegacyBox(const nsStyleDis
// "display:-webkit-box" or "display:-webkit-inline-box". aFlexContainer is
// expected to be an instance of nsFlexContainerFrame (enforced with an assert);
// otherwise, this function's state-bit-check here is bogus.
static bool
IsLegacyBox(const nsIFrame* aFlexContainer)
{
MOZ_ASSERT(aFlexContainer->IsFlexContainerFrame(),
"only flex containers may be passed to this function");
- return aFlexContainer->HasAnyStateBits(NS_STATE_FLEX_IS_LEGACY_WEBKIT_BOX);
+ return aFlexContainer->HasAnyStateBits(NS_STATE_FLEX_IS_EMULATING_LEGACY_BOX);
}
// Returns the OrderingProperty enum that we should pass to
// CSSOrderAwareFrameIterator (depending on whether it's a legacy box).
static CSSOrderAwareFrameIterator::OrderingProperty
OrderingPropertyForIter(const nsFlexContainerFrame* aFlexContainer)
{
return IsLegacyBox(aFlexContainer)
@@ -2238,17 +2238,17 @@ nsFlexContainerFrame::Init(nsIContent*
mStyleContext->GetPseudo() == nsCSSAnonBoxes::scrolledContent),
"The only way a nsFlexContainerFrame can have 'display:block' "
"should be if it's the inner part of a scrollable or button "
"element");
isLegacyBox = IsDisplayValueLegacyBox(parentStyleContext->StyleDisplay());
}
if (isLegacyBox) {
- AddStateBits(NS_STATE_FLEX_IS_LEGACY_WEBKIT_BOX);
+ AddStateBits(NS_STATE_FLEX_IS_EMULATING_LEGACY_BOX);
}
}
#ifdef DEBUG_FRAME_DUMP
nsresult
nsFlexContainerFrame::GetFrameName(nsAString& aResult) const
{
return MakeFrameName(NS_LITERAL_STRING("FlexContainer"), aResult);
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -5592,17 +5592,17 @@ nsFrame::ComputeSize(gfxContext*
!(tableWrapper->GetStateBits() & NS_FRAME_OUT_OF_FLOW));
if (isGridItem) {
// When resolving justify/align-self below, we want to use the grid
// container's justify/align-items value and WritingMode.
alignCB = grandParent;
}
}
bool isFlexItem = parentFrame && parentFrame->IsFlexContainerFrame() &&
- !parentFrame->HasAnyStateBits(NS_STATE_FLEX_IS_LEGACY_WEBKIT_BOX) &&
+ !parentFrame->HasAnyStateBits(NS_STATE_FLEX_IS_EMULATING_LEGACY_BOX) &&
!HasAnyStateBits(NS_FRAME_OUT_OF_FLOW);
bool isInlineFlexItem = false;
if (isFlexItem) {
// Flex items use their "flex-basis" property in place of their main-size
// property (e.g. "width") for sizing purposes, *unless* they have
// "flex-basis:auto", in which case they use their main-size property after
// all.
uint32_t flexDirection = GetParent()->StylePosition()->mFlexDirection;
@@ -5823,17 +5823,17 @@ nsFrame::ComputeSizeWithIntrinsicDimensi
{
const nsStylePosition* stylePos = StylePosition();
const nsStyleCoord* inlineStyleCoord = &stylePos->ISize(aWM);
const nsStyleCoord* blockStyleCoord = &stylePos->BSize(aWM);
auto* parentFrame = GetParent();
const bool isGridItem = parentFrame && parentFrame->IsGridContainerFrame() &&
!HasAnyStateBits(NS_FRAME_OUT_OF_FLOW);
const bool isFlexItem = parentFrame && parentFrame->IsFlexContainerFrame() &&
- !parentFrame->HasAnyStateBits(NS_STATE_FLEX_IS_LEGACY_WEBKIT_BOX) &&
+ !parentFrame->HasAnyStateBits(NS_STATE_FLEX_IS_EMULATING_LEGACY_BOX) &&
!HasAnyStateBits(NS_FRAME_OUT_OF_FLOW);
bool isInlineFlexItem = false;
Maybe<nsStyleCoord> imposedMainSizeStyleCoord;
// If this is a flex item, and we're measuring its cross size after flexing
// to resolve its main size, then we need to use the resolved main size
// that the container provides to us *instead of* the main-size coordinate
// from our style struct. (Otherwise, we'll be using an irrelevant value in
--- a/layout/generic/nsFrameStateBits.h
+++ b/layout/generic/nsFrameStateBits.h
@@ -316,17 +316,17 @@ FRAME_STATE_BIT(Box, 61, NS_FRAME_MOUSE_
FRAME_STATE_GROUP(FlexContainer, nsFlexContainerFrame)
// True iff the normal flow children are already in CSS 'order' in the
// order they occur in the child frame list.
FRAME_STATE_BIT(FlexContainer, 20, NS_STATE_FLEX_NORMAL_FLOW_CHILDREN_IN_CSS_ORDER)
// Set for a flex container that is emulating a legacy
// 'display:-webkit-{inline-}box' container.
-FRAME_STATE_BIT(FlexContainer, 21, NS_STATE_FLEX_IS_LEGACY_WEBKIT_BOX)
+FRAME_STATE_BIT(FlexContainer, 21, NS_STATE_FLEX_IS_EMULATING_LEGACY_BOX)
// True iff computed flex values should be generated on the next reflow
FRAME_STATE_BIT(FlexContainer, 22, NS_STATE_FLEX_GENERATE_COMPUTED_VALUES)
// True if the container has no flex items; may lie if there is a pending reflow
FRAME_STATE_BIT(FlexContainer, 23, NS_STATE_FLEX_SYNTHESIZE_BASELINE)
// == Frame state bits that apply to grid container frames ====================