Bug 1799732 Part 2 - Flatten the namespace for FrameChildList and co. by removing namespace layout. r=emilio

After moving FrameChildListID into mozilla namespace, `kPrincipalList` etc. are
also exposed in the mozilla namespace. In the next part, I'll convert
FrameChildListID enum into an enum class, so the naming pollution shouldn't be
an issue.

This patch has a nice side effect that it is now easier to remove all the
aliases of FrameChildListID (`kPrincipalList` etc.) defined in multiple places
since it is confusion to have the same thing written in different ways, e.g.
`nsIFrame::kPrincipalList`, `mozilla::layout::kPrincipalList`,
`FrameChildListID::kPrincipalList`, `kPrincipalList`.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D161863
This commit is contained in:
Ting-Yu Lin 2022-11-11 23:44:16 +00:00
Родитель 15dcf36084
Коммит 75940b1777
28 изменённых файлов: 158 добавлений и 230 удалений

Просмотреть файл

@ -6061,7 +6061,7 @@ void PresShell::MarkFramesInSubtreeApproximatelyVisible(
bool preserves3DChildren = aFrame->Extend3DContext();
for (const auto& [list, listID] : aFrame->ChildLists()) {
if (listID == nsIFrame::kPopupList) {
if (listID == kPopupList) {
// We assume all frames in popups are visible, so we skip them here.
continue;
}
@ -11200,8 +11200,7 @@ size_t PresShell::SizeOfTextRuns(MallocSizeOf aMallocSizeOf) const {
void PresShell::MarkFixedFramesForReflow(IntrinsicDirty aIntrinsicDirty) {
nsIFrame* rootFrame = mFrameConstructor->GetRootFrame();
if (rootFrame) {
const nsFrameList& childList =
rootFrame->GetChildList(nsIFrame::kFixedList);
const nsFrameList& childList = rootFrame->GetChildList(kFixedList);
for (nsIFrame* childFrame : childList) {
FrameNeedsReflow(childFrame, aIntrinsicDirty, NS_FRAME_IS_DIRTY);
}

Просмотреть файл

@ -1176,7 +1176,7 @@ static void SyncViewsAndInvalidateDescendants(nsIFrame* aFrame,
nsIFrame* outOfFlowFrame =
nsPlaceholderFrame::GetRealFrameForPlaceholder(child);
DoApplyRenderingChangeToTree(outOfFlowFrame, aChange);
} else if (listID == nsIFrame::kPopupList) {
} else if (listID == kPopupList) {
DoApplyRenderingChangeToTree(child, aChange);
} else { // regular frame
SyncViewsAndInvalidateDescendants(child, aChange);
@ -2502,7 +2502,7 @@ static void UpdateBackdropIfNeeded(nsIFrame* aFrame, ServoStyleSet& aStyleSet,
MOZ_ASSERT(display->IsAbsolutelyPositionedStyle());
nsIFrame* backdropPlaceholder =
aFrame->GetChildList(nsIFrame::kBackdropList).FirstChild();
aFrame->GetChildList(kBackdropList).FirstChild();
if (!backdropPlaceholder) {
return;
}

Просмотреть файл

@ -649,8 +649,8 @@ static void SplitInlineAncestors(nsContainerFrame* aParent,
// The parent's continuation adopts the siblings after the split.
MOZ_ASSERT(!newParent->IsBlockFrameOrSubclass(),
"blocks should not be IsBidiSplittable");
newParent->InsertFrames(nsIFrame::kNoReflowPrincipalList, nullptr,
nullptr, std::move(tail));
newParent->InsertFrames(kNoReflowPrincipalList, nullptr, nullptr,
std::move(tail));
// While passing &aLine to InsertFrames for a non-block isn't harmful
// because it's a no-op, it doesn't really make sense. However, the
@ -666,8 +666,8 @@ static void SplitInlineAncestors(nsContainerFrame* aParent,
// The list name kNoReflowPrincipalList would indicate we don't want
// reflow
grandparent->InsertFrames(nsIFrame::kNoReflowPrincipalList, parent,
parentLine, nsFrameList(newParent, newParent));
grandparent->InsertFrames(kNoReflowPrincipalList, parent, parentLine,
nsFrameList(newParent, newParent));
}
frame = parent;
@ -761,7 +761,7 @@ static void CreateContinuation(nsIFrame* aFrame,
// The list name kNoReflowPrincipalList would indicate we don't want reflow
// XXXbz this needs higher-level framelist love
parent->InsertFrames(nsIFrame::kNoReflowPrincipalList, aFrame, parentLine,
parent->InsertFrames(kNoReflowPrincipalList, aFrame, parentLine,
nsFrameList(*aNewFrame, *aNewFrame));
if (!aIsFluid) {
@ -1387,7 +1387,7 @@ void nsBidiPresUtils::TraverseFrames(nsIFrame* aCurrentFrame,
} else {
// For a non-leaf frame, recurse into TraverseFrames
nsIFrame* kid = frame->PrincipalChildList().FirstChild();
MOZ_ASSERT(!frame->GetChildList(nsIFrame::kOverflowList).FirstChild(),
MOZ_ASSERT(!frame->GetChildList(kOverflowList).FirstChild(),
"should have drained the overflow list above");
if (kid) {
TraverseFrames(kid, aBpd);

Просмотреть файл

@ -131,9 +131,6 @@
using namespace mozilla;
using namespace mozilla::dom;
// An alias for convenience.
static const nsIFrame::ChildListID kPrincipalList = nsIFrame::kPrincipalList;
nsIFrame* NS_NewHTMLCanvasFrame(PresShell* aPresShell, ComputedStyle* aStyle);
nsIFrame* NS_NewHTMLVideoFrame(PresShell* aPresShell, ComputedStyle* aStyle);
@ -568,7 +565,6 @@ struct AbsoluteFrameList final : public nsFrameList {
// blocks. The destructor restores the state to its previous state
class MOZ_STACK_CLASS nsFrameConstructorSaveState {
public:
typedef nsIFrame::ChildListID ChildListID;
~nsFrameConstructorSaveState();
private:
@ -581,7 +577,7 @@ class MOZ_STACK_CLASS nsFrameConstructorSaveState {
AbsoluteFrameList mSavedList;
// The name of the child list in which our frames would belong.
ChildListID mChildListID = kPrincipalList;
mozilla::FrameChildListID mChildListID = kPrincipalList;
nsFrameConstructorState* mState = nullptr;
// Only used when saving an absolute list. See the description of
@ -595,8 +591,6 @@ class MOZ_STACK_CLASS nsFrameConstructorSaveState {
// frame construction process
class MOZ_STACK_CLASS nsFrameConstructorState {
public:
typedef nsIFrame::ChildListID ChildListID;
nsPresContext* mPresContext;
PresShell* mPresShell;
nsFrameManager* mFrameManager;
@ -763,7 +757,7 @@ class MOZ_STACK_CLASS nsFrameConstructorState {
* kids to the aChildListID child list of |aFrameList.containingBlock|.
*/
void ProcessFrameInsertions(AbsoluteFrameList& aFrameList,
ChildListID aChildListID);
mozilla::FrameChildListID aChildListID);
/**
* GetOutOfFlowFrameList selects the out-of-flow frame list the new
@ -828,11 +822,11 @@ nsFrameConstructorState::~nsFrameConstructorState() {
}
void nsFrameConstructorState::ProcessFrameInsertionsForAllLists() {
ProcessFrameInsertions(mTopLayerFixedList, nsIFrame::kFixedList);
ProcessFrameInsertions(mTopLayerAbsoluteList, nsIFrame::kAbsoluteList);
ProcessFrameInsertions(mFloatedList, nsIFrame::kFloatList);
ProcessFrameInsertions(mAbsoluteList, nsIFrame::kAbsoluteList);
ProcessFrameInsertions(mFixedList, nsIFrame::kFixedList);
ProcessFrameInsertions(mTopLayerFixedList, kFixedList);
ProcessFrameInsertions(mTopLayerAbsoluteList, kAbsoluteList);
ProcessFrameInsertions(mFloatedList, kFloatList);
ProcessFrameInsertions(mAbsoluteList, kAbsoluteList);
ProcessFrameInsertions(mFixedList, kFixedList);
}
void nsFrameConstructorState::PushAbsoluteContainingBlock(
@ -841,7 +835,7 @@ void nsFrameConstructorState::PushAbsoluteContainingBlock(
MOZ_ASSERT(!!aNewAbsoluteContainingBlock == !!aPositionedFrame,
"We should have both or none");
aSaveState.mList = &mAbsoluteList;
aSaveState.mChildListID = nsIFrame::kAbsoluteList;
aSaveState.mChildListID = kAbsoluteList;
aSaveState.mState = this;
aSaveState.mSavedFixedPosIsAbsPos = mFixedPosIsAbsPos;
@ -903,7 +897,7 @@ void nsFrameConstructorState::PushFloatContainingBlock(
"floats as a float containing block!");
aSaveState.mList = &mFloatedList;
aSaveState.mSavedList = std::move(mFloatedList);
aSaveState.mChildListID = nsIFrame::kFloatList;
aSaveState.mChildListID = kFloatList;
aSaveState.mState = this;
mFloatedList = AbsoluteFrameList(aNewFloatContainingBlock);
}
@ -1089,7 +1083,7 @@ void nsFrameConstructorState::ConstructBackdropFrameFor(nsIContent* aContent,
nsIFrame* placeholder = nsCSSFrameConstructor::CreatePlaceholderFrameFor(
mPresShell, aContent, backdropFrame, frame, nullptr, placeholderType);
frame->SetInitialChildList(nsIFrame::kBackdropList,
frame->SetInitialChildList(kBackdropList,
nsFrameList(placeholder, placeholder));
frameList->AppendFrame(nullptr, backdropFrame);
@ -1152,14 +1146,14 @@ void nsFrameConstructorState::AddChild(
// platforms where stack limits are low, we can't afford to incorporate this
// function's `AutoTArray`s into its callers' stack frames, so disable inlining.
MOZ_NEVER_INLINE void nsFrameConstructorState::ProcessFrameInsertions(
AbsoluteFrameList& aFrameList, ChildListID aChildListID) {
AbsoluteFrameList& aFrameList, FrameChildListID aChildListID) {
#define NS_NONXUL_LIST_TEST \
(&aFrameList == &mFloatedList && aChildListID == nsIFrame::kFloatList) || \
(&aFrameList == &mFloatedList && aChildListID == kFloatList) || \
((&aFrameList == &mAbsoluteList || \
&aFrameList == &mTopLayerAbsoluteList) && \
aChildListID == nsIFrame::kAbsoluteList) || \
aChildListID == kAbsoluteList) || \
((&aFrameList == &mFixedList || &aFrameList == &mTopLayerFixedList) && \
aChildListID == nsIFrame::kFixedList)
aChildListID == kFixedList)
MOZ_ASSERT(NS_NONXUL_LIST_TEST,
"Unexpected aFrameList/aChildListID combination");
@ -1171,7 +1165,7 @@ MOZ_NEVER_INLINE void nsFrameConstructorState::ProcessFrameInsertions(
NS_ASSERTION(containingBlock, "Child list without containing block?");
if (aChildListID == nsIFrame::kFixedList) {
if (aChildListID == kFixedList) {
// Put this frame on the transformed-frame's abs-pos list instead, if
// it has abs-pos children instead of fixed-pos children.
aChildListID = containingBlock->GetAbsoluteListID();
@ -1191,8 +1185,7 @@ MOZ_NEVER_INLINE void nsFrameConstructorState::ProcessFrameInsertions(
} else {
containingBlock->SetInitialChildList(aChildListID, std::move(aFrameList));
}
} else if (aChildListID == nsIFrame::kFixedList ||
aChildListID == nsIFrame::kAbsoluteList) {
} else if (aChildListID == kFixedList || aChildListID == kAbsoluteList) {
// The order is not important for abs-pos/fixed-pos frame list, just
// append the frame items to the list directly.
mFrameManager->AppendFrames(containingBlock, aChildListID,
@ -2014,8 +2007,7 @@ nsIFrame* nsCSSFrameConstructor::ConstructTable(nsFrameConstructorState& aState,
// Set the table wrapper frame's secondary childlist lists
if (captionList.NotEmpty()) {
captionList.ApplySetParent(newFrame);
newFrame->SetInitialChildList(nsIFrame::kCaptionList,
std::move(captionList));
newFrame->SetInitialChildList(kCaptionList, std::move(captionList));
}
return newFrame;
@ -3145,8 +3137,7 @@ nsIFrame* nsCSSFrameConstructor::ConstructFieldSetFrame(
// We use AppendFrames here because the rendered legend will already
// be present in the principal child list if it exists.
fieldsetFrame->AppendFrames(nsIFrame::kNoReflowPrincipalList,
std::move(fieldsetKids));
fieldsetFrame->AppendFrames(kNoReflowPrincipalList, std::move(fieldsetKids));
return fieldsetFrame;
}
@ -6694,7 +6685,7 @@ void nsCSSFrameConstructor::ContentAppended(nsIContent* aFirstNewContent,
NS_ASSERTION(LayoutFrameType::Table == frameType, "how did that happen?");
nsContainerFrame* outerTable = parentFrame->GetParent();
captionList.ApplySetParent(outerTable);
AppendFrames(outerTable, nsIFrame::kCaptionList, std::move(captionList));
AppendFrames(outerTable, kCaptionList, std::move(captionList));
}
LAYOUT_PHASE_TEMP_EXIT();
@ -7181,9 +7172,9 @@ void nsCSSFrameConstructor::ContentRangeInserted(nsIContent* aStartChild,
captionList.ApplySetParent(outerTable);
if (captionIsAppend) {
AppendFrames(outerTable, nsIFrame::kCaptionList, std::move(captionList));
AppendFrames(outerTable, kCaptionList, std::move(captionList));
} else {
InsertFrames(outerTable, nsIFrame::kCaptionList, captionPrevSibling,
InsertFrames(outerTable, kCaptionList, captionPrevSibling,
std::move(captionList));
}
}
@ -8002,7 +7993,7 @@ nsresult nsCSSFrameConstructor::ReplicateFixedFrames(
nsFrameList fixedPlaceholders;
nsIFrame* firstFixed =
prevPageContentFrame->GetChildList(nsIFrame::kFixedList).FirstChild();
prevPageContentFrame->GetChildList(kFixedList).FirstChild();
if (!firstFixed) {
return NS_OK;
}
@ -8212,12 +8203,10 @@ bool nsCSSFrameConstructor::MaybeRecreateContainerForFrameRemoval(
// If we're a table-column-group, then the OnlyChild check above is
// not going to catch cases when we're the first child.
(inFlowFrame->IsTableColGroupFrame() &&
parent->GetChildList(nsIFrame::kColGroupList).FirstChild() ==
inFlowFrame) ||
parent->GetChildList(kColGroupList).FirstChild() == inFlowFrame) ||
// Similar if we're a table-caption.
(inFlowFrame->IsTableCaption() &&
parent->GetChildList(nsIFrame::kCaptionList).FirstChild() ==
inFlowFrame)) {
parent->GetChildList(kCaptionList).FirstChild() == inFlowFrame)) {
TRACE("Table or ruby pseudo parent");
RecreateFramesForContent(parent->GetContent(), InsertionKind::Async);
return true;
@ -10158,7 +10147,7 @@ void nsCSSFrameConstructor::WrapFramesInFirstLetterFrame(
}
static nsIFrame* FindFirstLetterFrame(nsIFrame* aFrame,
nsIFrame::ChildListID aListID) {
FrameChildListID aListID) {
for (nsIFrame* f : aFrame->GetChildList(aListID)) {
if (f->IsLetterFrame()) {
return f;
@ -10183,11 +10172,9 @@ static void ClearHasFirstLetterChildFrom(nsContainerFrame* aParentFrame) {
void nsCSSFrameConstructor::RemoveFloatingFirstLetterFrames(
PresShell* aPresShell, nsIFrame* aBlockFrame) {
// Look for the first letter frame on the kFloatList, then kPushedFloatsList.
nsIFrame* floatFrame =
::FindFirstLetterFrame(aBlockFrame, nsIFrame::kFloatList);
nsIFrame* floatFrame = ::FindFirstLetterFrame(aBlockFrame, kFloatList);
if (!floatFrame) {
floatFrame =
::FindFirstLetterFrame(aBlockFrame, nsIFrame::kPushedFloatsList);
floatFrame = ::FindFirstLetterFrame(aBlockFrame, kPushedFloatsList);
if (!floatFrame) {
return;
}

Просмотреть файл

@ -59,7 +59,7 @@ void nsFrameManager::Destroy() {
//----------------------------------------------------------------------
void nsFrameManager::AppendFrames(nsContainerFrame* aParentFrame,
ChildListID aListID,
FrameChildListID aListID,
nsFrameList&& aFrameList) {
if (aParentFrame->IsAbsoluteContainer() &&
aListID == aParentFrame->GetAbsoluteListID()) {
@ -71,7 +71,8 @@ void nsFrameManager::AppendFrames(nsContainerFrame* aParentFrame,
}
void nsFrameManager::InsertFrames(nsContainerFrame* aParentFrame,
ChildListID aListID, nsIFrame* aPrevFrame,
FrameChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList&& aFrameList) {
MOZ_ASSERT(
!aPrevFrame ||
@ -91,7 +92,8 @@ void nsFrameManager::InsertFrames(nsContainerFrame* aParentFrame,
}
}
void nsFrameManager::RemoveFrame(ChildListID aListID, nsIFrame* aOldFrame) {
void nsFrameManager::RemoveFrame(FrameChildListID aListID,
nsIFrame* aOldFrame) {
// In case the reflow doesn't invalidate anything since it just leaves
// a gap where the old frame was, we invalidate it here. (This is
// reasonably likely to happen when removing a last child in a way

Просмотреть файл

@ -30,11 +30,8 @@ class PresShell;
* frame.
*/
class nsFrameManager {
typedef mozilla::PresShell PresShell;
typedef mozilla::layout::FrameChildListID ChildListID;
public:
explicit nsFrameManager(PresShell* aPresShell)
explicit nsFrameManager(mozilla::PresShell* aPresShell)
: mPresShell(aPresShell), mRootFrame(nullptr) {
MOZ_ASSERT(mPresShell, "need a pres shell");
}
@ -59,13 +56,15 @@ class nsFrameManager {
void Destroy();
// Functions for manipulating the frame model
void AppendFrames(nsContainerFrame* aParentFrame, ChildListID aListID,
void AppendFrames(nsContainerFrame* aParentFrame,
mozilla::FrameChildListID aListID,
nsFrameList&& aFrameList);
void InsertFrames(nsContainerFrame* aParentFrame, ChildListID aListID,
nsIFrame* aPrevFrame, nsFrameList&& aFrameList);
void InsertFrames(nsContainerFrame* aParentFrame,
mozilla::FrameChildListID aListID, nsIFrame* aPrevFrame,
nsFrameList&& aFrameList);
void RemoveFrame(ChildListID aListID, nsIFrame* aOldFrame);
void RemoveFrame(mozilla::FrameChildListID aListID, nsIFrame* aOldFrame);
/*
* Capture/restore frame state for the frame subtree rooted at aFrame.
@ -91,7 +90,7 @@ class nsFrameManager {
protected:
// weak link, because the pres shell owns us
PresShell* MOZ_NON_OWNING_REF mPresShell;
mozilla::PresShell* MOZ_NON_OWNING_REF mPresShell;
nsIFrame* mRootFrame;
};

Просмотреть файл

@ -18,8 +18,6 @@ using namespace mozilla;
class nsFrameIterator : public nsIFrameEnumerator {
public:
typedef nsIFrame::ChildListID ChildListID;
NS_DECL_ISUPPORTS
virtual void First() override;

Просмотреть файл

@ -573,7 +573,7 @@ void nsLayoutUtils::UnionChildOverflow(nsIFrame* aFrame,
FrameChildListIDs aSkipChildLists) {
// Iterate over all children except pop-ups.
FrameChildListIDs skip(aSkipChildLists);
skip += nsIFrame::kPopupList;
skip += kPopupList;
for (const auto& [list, listID] : aFrame->ChildLists()) {
if (skip.contains(listID)) {
@ -810,16 +810,16 @@ nsContainerFrame* nsLayoutUtils::LastContinuationWithChild(
// static
FrameChildListID nsLayoutUtils::GetChildListNameFor(nsIFrame* aChildFrame) {
nsIFrame::ChildListID id = nsIFrame::kPrincipalList;
FrameChildListID id = kPrincipalList;
MOZ_DIAGNOSTIC_ASSERT(!aChildFrame->HasAnyStateBits(NS_FRAME_OUT_OF_FLOW));
if (aChildFrame->HasAnyStateBits(NS_FRAME_IS_OVERFLOW_CONTAINER)) {
nsIFrame* pif = aChildFrame->GetPrevInFlow();
if (pif->GetParent() == aChildFrame->GetParent()) {
id = nsIFrame::kExcessOverflowContainersList;
id = kExcessOverflowContainersList;
} else {
id = nsIFrame::kOverflowContainersList;
id = kOverflowContainersList;
}
} else {
LayoutFrameType childType = aChildFrame->Type();
@ -828,18 +828,16 @@ FrameChildListID nsLayoutUtils::GetChildListNameFor(nsIFrame* aChildFrame) {
MOZ_ASSERT(parent, "nsMenuPopupFrame can't be the root frame");
MOZ_ASSERT(parent->IsMenuFrame(),
"nsMenuPopupFrame should be out of flow if not under a menu");
nsIFrame* firstPopup =
parent->GetChildList(nsIFrame::kPopupList).FirstChild();
nsIFrame* firstPopup = parent->GetChildList(kPopupList).FirstChild();
MOZ_ASSERT(!firstPopup || !firstPopup->GetNextSibling(),
"We assume popupList only has one child, but it has more.");
id = firstPopup == aChildFrame ? nsIFrame::kPopupList
: nsIFrame::kPrincipalList;
id = firstPopup == aChildFrame ? kPopupList : kPrincipalList;
} else if (LayoutFrameType::TableColGroup == childType) {
id = nsIFrame::kColGroupList;
id = kColGroupList;
} else if (aChildFrame->IsTableCaption()) {
id = nsIFrame::kCaptionList;
id = kCaptionList;
} else {
id = nsIFrame::kPrincipalList;
id = kPrincipalList;
}
}
@ -849,8 +847,7 @@ FrameChildListID nsLayoutUtils::GetChildListNameFor(nsIFrame* aChildFrame) {
nsContainerFrame* parent = aChildFrame->GetParent();
bool found = parent->GetChildList(id).ContainsFrame(aChildFrame);
if (!found) {
found = parent->GetChildList(nsIFrame::kOverflowList)
.ContainsFrame(aChildFrame);
found = parent->GetChildList(kOverflowList).ContainsFrame(aChildFrame);
MOZ_ASSERT(found, "not in child list");
}
#endif
@ -3590,7 +3587,7 @@ void nsLayoutUtils::AddBoxesForFrame(nsIFrame* aFrame,
if (pseudoType == PseudoStyleType::tableWrapper) {
AddBoxesForFrame(aFrame->PrincipalChildList().FirstChild(), aCallback);
if (aCallback->mIncludeCaptionBoxForTable) {
nsIFrame* kid = aFrame->GetChildList(nsIFrame::kCaptionList).FirstChild();
nsIFrame* kid = aFrame->GetChildList(kCaptionList).FirstChild();
if (kid) {
AddBoxesForFrame(kid, aCallback);
}
@ -3625,7 +3622,7 @@ nsIFrame* nsLayoutUtils::GetFirstNonAnonymousFrame(nsIFrame* aFrame) {
if (f) {
return f;
}
nsIFrame* kid = aFrame->GetChildList(nsIFrame::kCaptionList).FirstChild();
nsIFrame* kid = aFrame->GetChildList(kCaptionList).FirstChild();
if (kid) {
f = GetFirstNonAnonymousFrame(kid);
if (f) {
@ -6014,14 +6011,13 @@ nscoord nsLayoutUtils::CalculateContentBEnd(WritingMode aWM, nsIFrame* aFrame) {
// calculation is intended to affect layout.
LogicalSize overflowSize(aWM, aFrame->ScrollableOverflowRect().Size());
if (overflowSize.BSize(aWM) > contentBEnd) {
nsIFrame::ChildListIDs skip = {nsIFrame::kOverflowList,
nsIFrame::kExcessOverflowContainersList,
nsIFrame::kOverflowOutOfFlowList};
FrameChildListIDs skip = {kOverflowList, kExcessOverflowContainersList,
kOverflowOutOfFlowList};
nsBlockFrame* blockFrame = do_QueryFrame(aFrame);
if (blockFrame) {
contentBEnd =
std::max(contentBEnd, CalculateBlockContentBEnd(aWM, blockFrame));
skip += nsIFrame::kPrincipalList;
skip += kPrincipalList;
}
for (const auto& [list, listID] : aFrame->ChildLists()) {
if (!skip.contains(listID)) {
@ -7595,8 +7591,7 @@ static void GetFontFacesForFramesInner(
return;
}
nsIFrame::ChildListID childLists[] = {nsIFrame::kPrincipalList,
nsIFrame::kPopupList};
FrameChildListID childLists[] = {kPrincipalList, kPopupList};
for (size_t i = 0; i < ArrayLength(childLists); ++i) {
for (nsIFrame* child : aFrame->GetChildList(childLists[i])) {
child = nsPlaceholderFrame::GetRealFrameFor(child);

Просмотреть файл

@ -247,8 +247,7 @@ class nsLayoutUtils {
* Use heuristics to figure out the child list that
* aChildFrame is currently in.
*/
static mozilla::layout::FrameChildListID GetChildListNameFor(
nsIFrame* aChildFrame);
static mozilla::FrameChildListID GetChildListNameFor(nsIFrame* aChildFrame);
/**
* Returns the ::before pseudo-element for aContent, if any.
@ -2470,8 +2469,7 @@ class nsLayoutUtils {
*/
static void UnionChildOverflow(
nsIFrame* aFrame, mozilla::OverflowAreas& aOverflowAreas,
mozilla::layout::FrameChildListIDs aSkipChildLists =
mozilla::layout::FrameChildListIDs());
mozilla::FrameChildListIDs aSkipChildLists = {});
/**
* Return the font size inflation *ratio* for a given frame. This is

Просмотреть файл

@ -60,7 +60,7 @@ class CSSOrderAwareFrameIteratorT {
BoxOrdinalGroup // Legacy behavior: use prefixed "box-ordinal-group".
};
CSSOrderAwareFrameIteratorT(
nsIFrame* aContainer, nsIFrame::ChildListID aListID,
nsIFrame* aContainer, FrameChildListID aListID,
ChildFilter aFilter = ChildFilter::SkipPlaceholders,
OrderState aState = OrderState::Unknown,
OrderingProperty aOrderProp = OrderingProperty::Order)
@ -254,7 +254,7 @@ class CSSOrderAwareFrameIteratorT {
bool mSkipPlaceholders;
#ifdef DEBUG
nsIFrame* mContainer;
nsIFrame::ChildListID mListID;
FrameChildListID mListID;
#endif
};

Просмотреть файл

@ -673,10 +673,8 @@ nsIFrame* ScrollAnchorContainer::FindAnchorIn(nsIFrame* aFrame) const {
// following placeholders in the in-flow lists so that we visit these
// frames in DOM order.
// XXX do we actually need to exclude kOverflowOutOfFlowList too?
if (listID == FrameChildListID::kAbsoluteList ||
listID == FrameChildListID::kFixedList ||
listID == FrameChildListID::kFloatList ||
listID == FrameChildListID::kOverflowOutOfFlowList) {
if (listID == kAbsoluteList || listID == kFixedList ||
listID == kFloatList || listID == kOverflowOutOfFlowList) {
continue;
}
@ -694,8 +692,7 @@ nsIFrame* ScrollAnchorContainer::FindAnchorIn(nsIFrame* aFrame) const {
// implementation, and is needed for a WPT test.
//
// [1] https://github.com/w3c/csswg-drafts/issues/3465
const nsFrameList& absPosList =
aFrame->GetChildList(FrameChildListID::kAbsoluteList);
const nsFrameList& absPosList = aFrame->GetChildList(kAbsoluteList);
if (nsIFrame* anchor = FindAnchorInList(absPosList)) {
return anchor;
}

Просмотреть файл

@ -106,7 +106,7 @@ class ViewportFrame : public nsContainerFrame {
void SetViewInternal(nsView* aView) override { mView = aView; }
private:
virtual mozilla::layout::FrameChildListID GetAbsoluteListID() const override {
mozilla::FrameChildListID GetAbsoluteListID() const override {
return kFixedList;
}

Просмотреть файл

@ -45,7 +45,7 @@ using namespace mozilla;
typedef mozilla::CSSAlignUtils::AlignJustifyFlags AlignJustifyFlags;
void nsAbsoluteContainingBlock::SetInitialChildList(nsIFrame* aDelegatingFrame,
ChildListID aListID,
FrameChildListID aListID,
nsFrameList&& aChildList) {
MOZ_ASSERT(mChildListID == aListID, "unexpected child list name");
#ifdef DEBUG
@ -58,7 +58,7 @@ void nsAbsoluteContainingBlock::SetInitialChildList(nsIFrame* aDelegatingFrame,
}
void nsAbsoluteContainingBlock::AppendFrames(nsIFrame* aDelegatingFrame,
ChildListID aListID,
FrameChildListID aListID,
nsFrameList&& aFrameList) {
NS_ASSERTION(mChildListID == aListID, "unexpected child list");
@ -75,7 +75,7 @@ void nsAbsoluteContainingBlock::AppendFrames(nsIFrame* aDelegatingFrame,
}
void nsAbsoluteContainingBlock::InsertFrames(nsIFrame* aDelegatingFrame,
ChildListID aListID,
FrameChildListID aListID,
nsIFrame* aPrevFrame,
nsFrameList&& aFrameList) {
NS_ASSERTION(mChildListID == aListID, "unexpected child list");
@ -94,7 +94,7 @@ void nsAbsoluteContainingBlock::InsertFrames(nsIFrame* aDelegatingFrame,
}
void nsAbsoluteContainingBlock::RemoveFrame(nsIFrame* aDelegatingFrame,
ChildListID aListID,
FrameChildListID aListID,
nsIFrame* aOldFrame) {
NS_ASSERTION(mChildListID == aListID, "unexpected child list");
nsIFrame* nif = aOldFrame->GetNextInFlow();
@ -161,7 +161,7 @@ void nsAbsoluteContainingBlock::Reflow(nsContainerFrame* aDelegatingFrame,
// them contributing to overflow areas because that means we'll create new
// pages ad infinitum if one of them overflows the page.
if (aDelegatingFrame->IsPageContentFrame()) {
MOZ_ASSERT(mChildListID == nsAtomicContainerFrame::kFixedList);
MOZ_ASSERT(mChildListID == kFixedList);
aOverflowAreas = nullptr;
}

Просмотреть файл

@ -36,33 +36,34 @@ class nsAbsoluteContainingBlock {
using ReflowInput = mozilla::ReflowInput;
public:
typedef nsIFrame::ChildListID ChildListID;
explicit nsAbsoluteContainingBlock(ChildListID aChildListID)
explicit nsAbsoluteContainingBlock(mozilla::FrameChildListID aChildListID)
#ifdef DEBUG
: mChildListID(aChildListID)
#endif
{
MOZ_ASSERT(mChildListID == nsIFrame::kAbsoluteList ||
mChildListID == nsIFrame::kFixedList,
MOZ_ASSERT(mChildListID == mozilla::kAbsoluteList ||
mChildListID == mozilla::kFixedList,
"should either represent position:fixed or absolute content");
}
const nsFrameList& GetChildList() const { return mAbsoluteFrames; }
void AppendChildList(nsTArray<nsIFrame::ChildList>* aLists,
ChildListID aListID) const {
void AppendChildList(nsTArray<mozilla::FrameChildList>* aLists,
mozilla::FrameChildListID aListID) const {
NS_ASSERTION(aListID == mChildListID, "wrong list ID");
GetChildList().AppendIfNonempty(aLists, aListID);
}
void SetInitialChildList(nsIFrame* aDelegatingFrame, ChildListID aListID,
void SetInitialChildList(nsIFrame* aDelegatingFrame,
mozilla::FrameChildListID aListID,
nsFrameList&& aChildList);
void AppendFrames(nsIFrame* aDelegatingFrame, ChildListID aListID,
void AppendFrames(nsIFrame* aDelegatingFrame,
mozilla::FrameChildListID aListID,
nsFrameList&& aFrameList);
void InsertFrames(nsIFrame* aDelegatingFrame, ChildListID aListID,
nsIFrame* aPrevFrame, nsFrameList&& aFrameList);
void RemoveFrame(nsIFrame* aDelegatingFrame, ChildListID aListID,
nsIFrame* aOldFrame);
void InsertFrames(nsIFrame* aDelegatingFrame,
mozilla::FrameChildListID aListID, nsIFrame* aPrevFrame,
nsFrameList&& aFrameList);
void RemoveFrame(nsIFrame* aDelegatingFrame,
mozilla::FrameChildListID aListID, nsIFrame* aOldFrame);
enum class AbsPosReflowFlags {
ConstrainHeight = 0x1,
@ -169,7 +170,7 @@ class nsAbsoluteContainingBlock {
nsFrameList mAbsoluteFrames; // additional named child list
#ifdef DEBUG
ChildListID const mChildListID; // kFixedList or kAbsoluteList
mozilla::FrameChildListID const mChildListID; // kFixedList or kAbsoluteList
#endif
};

Просмотреть файл

@ -115,7 +115,7 @@ static bool BlockHasAnyFloats(nsIFrame* aFrame) {
if (!block) {
return false;
}
if (block->GetChildList(nsIFrame::kFloatList).FirstChild()) {
if (block->GetChildList(kFloatList).FirstChild()) {
return true;
}
@ -8170,8 +8170,7 @@ void nsBlockFrame::VerifyOverflowSituation() {
// A child float next-in-flow's parent must be |this| or a next-in-flow of
// |this|. Later next-in-flows must have the same or later parents.
nsIFrame::ChildListID childLists[] = {nsIFrame::kFloatList,
nsIFrame::kPushedFloatsList};
ChildListID childLists[] = {kFloatList, kPushedFloatsList};
for (size_t i = 0; i < ArrayLength(childLists); ++i) {
const nsFrameList& children = GetChildList(childLists[i]);
for (nsIFrame* f : children) {

Просмотреть файл

@ -42,8 +42,8 @@ void nsFrameList::DestroyFrames() {
mLastChild = nullptr;
}
void nsFrameList::DestroyFramesFrom(
nsIFrame* aDestructRoot, layout::PostFrameDestroyData& aPostDestroyData) {
void nsFrameList::DestroyFramesFrom(nsIFrame* aDestructRoot,
PostFrameDestroyData& aPostDestroyData) {
MOZ_ASSERT(aDestructRoot, "Missing destruct root");
while (nsIFrame* frame = RemoveFirstChild()) {
@ -437,7 +437,6 @@ void nsFrameList::VerifyList() const {
#endif
namespace mozilla {
namespace layout {
#ifdef DEBUG_FRAME_DUMP
const char* ChildListName(FrameChildListID aListID) {
@ -479,8 +478,6 @@ const char* ChildListName(FrameChildListID aListID) {
}
#endif
} // namespace layout
AutoFrameListPtr::~AutoFrameListPtr() {
if (mFrameList) {
mFrameList->Delete(mPresContext->PresShell());

Просмотреть файл

@ -27,7 +27,6 @@ class nsPresContext;
namespace mozilla {
class PresShell;
namespace layout {
class FrameChildList;
enum FrameChildListID {
// The individual concrete child lists.
@ -61,7 +60,6 @@ struct PostFrameDestroyData {
mAnonymousContent.AppendElement(aContent);
}
};
} // namespace layout
} // namespace mozilla
// Uncomment this to enable expensive frame-list integrity checking
@ -145,9 +143,8 @@ class nsFrameList {
* For each frame in this list: remove it from the list then call
* DestroyFrom(aDestructRoot, aPostDestroyData) on it.
*/
void DestroyFramesFrom(
nsIFrame* aDestructRoot,
mozilla::layout::PostFrameDestroyData& aPostDestroyData);
void DestroyFramesFrom(nsIFrame* aDestructRoot,
mozilla::PostFrameDestroyData& aPostDestroyData);
void Clear() { mFirstChild = mLastChild = nullptr; }
@ -331,9 +328,8 @@ class nsFrameList {
* If this frame list is non-empty then append it to aLists as the
* aListID child list.
*/
inline void AppendIfNonempty(
nsTArray<mozilla::layout::FrameChildList>* aLists,
mozilla::layout::FrameChildListID aListID) const {
inline void AppendIfNonempty(nsTArray<mozilla::FrameChildList>* aLists,
mozilla::FrameChildListID aListID) const {
if (NotEmpty()) {
aLists->EmplaceBack(*this, aListID);
}
@ -464,7 +460,6 @@ class nsFrameList {
};
namespace mozilla {
namespace layout {
#ifdef DEBUG_FRAME_DUMP
extern const char* ChildListName(FrameChildListID aListID);
@ -480,8 +475,6 @@ class FrameChildList {
FrameChildListID mID;
};
} // namespace layout
/**
* Simple "auto_ptr" for nsFrameLists allocated from the shell arena.
* The frame list given to the constructor will be deallocated (if non-null)

Просмотреть файл

@ -1213,7 +1213,7 @@ static void GetScrollableOverflowForPerspective(
nsPoint aOffset, nsRect& aScrolledFrameOverflowArea) {
// Iterate over all children except pop-ups.
for (const auto& [list, listID] : aCurrentFrame->ChildLists()) {
if (listID == nsIFrame::kPopupList) {
if (listID == kPopupList) {
continue;
}
@ -2750,7 +2750,7 @@ static void AdjustViews(nsIFrame* aFrame) {
// Call AdjustViews recursively for all child frames except the popup list as
// the views for popups are not scrolled.
for (const auto& [list, listID] : aFrame->ChildLists()) {
if (listID == nsIFrame::kPopupList) {
if (listID == kPopupList) {
continue;
}
for (nsIFrame* child : list) {
@ -5235,7 +5235,7 @@ static nsSize GetScrollPortSizeExcludingHeadersAndFooters(
const nsRect& aScrollPort) {
AutoTArray<TopAndBottom, 10> list;
if (aViewportFrame) {
for (nsIFrame* f : aViewportFrame->GetChildList(nsIFrame::kFixedList)) {
for (nsIFrame* f : aViewportFrame->GetChildList(kFixedList)) {
AddToListIfHeaderFooter(f, aViewportFrame, aScrollPort, list);
}
}
@ -6815,7 +6815,7 @@ bool ScrollFrameHelper::ReflowFinished() {
mMayHaveDirtyFixedChildren = false;
nsIFrame* parentFrame = mOuter->GetParent();
for (nsIFrame* fixedChild =
parentFrame->GetChildList(nsIFrame::kFixedList).FirstChild();
parentFrame->GetChildList(kFixedList).FirstChild();
fixedChild; fixedChild = fixedChild->GetNextSibling()) {
// force a reflow of the fixed child
mOuter->PresShell()->FrameNeedsReflow(fixedChild, IntrinsicDirty::Resize,

Просмотреть файл

@ -1573,27 +1573,6 @@ void nsIFrame::CreateView() {
("nsIFrame::CreateView: frame=%p view=%p", this, view));
}
// MSVC fails with link error "one or more multiply defined symbols found",
// gcc fails with "hidden symbol `nsIFrame::kPrincipalList' isn't defined"
// etc if they are not defined.
#ifndef _MSC_VER
// static nsIFrame constants; initialized in the header file.
const nsIFrame::ChildListID nsIFrame::kPrincipalList;
const nsIFrame::ChildListID nsIFrame::kAbsoluteList;
const nsIFrame::ChildListID nsIFrame::kBulletList;
const nsIFrame::ChildListID nsIFrame::kCaptionList;
const nsIFrame::ChildListID nsIFrame::kColGroupList;
const nsIFrame::ChildListID nsIFrame::kExcessOverflowContainersList;
const nsIFrame::ChildListID nsIFrame::kFixedList;
const nsIFrame::ChildListID nsIFrame::kFloatList;
const nsIFrame::ChildListID nsIFrame::kOverflowContainersList;
const nsIFrame::ChildListID nsIFrame::kOverflowList;
const nsIFrame::ChildListID nsIFrame::kOverflowOutOfFlowList;
const nsIFrame::ChildListID nsIFrame::kPopupList;
const nsIFrame::ChildListID nsIFrame::kPushedFloatsList;
const nsIFrame::ChildListID nsIFrame::kNoReflowPrincipalList;
#endif
/* virtual */
nsMargin nsIFrame::GetUsedMargin() const {
nsMargin margin(0, 0, 0, 0);
@ -2136,7 +2115,7 @@ AutoTArray<nsIFrame::ChildList, 4> nsIFrame::CrossDocChildLists() {
if (root) {
childLists.EmplaceBack(
nsFrameList(root, nsLayoutUtils::GetLastSibling(root)),
nsIFrame::kPrincipalList);
kPrincipalList);
}
}
@ -9593,9 +9572,8 @@ static nsRect ComputeOutlineInnerRect(
// Iterate over all children except pop-up, absolutely-positioned,
// float, and overflow ones.
const nsIFrame::ChildListIDs skip = {
nsIFrame::kPopupList, nsIFrame::kAbsoluteList, nsIFrame::kFixedList,
nsIFrame::kFloatList, nsIFrame::kOverflowList};
const FrameChildListIDs skip = {kPopupList, kAbsoluteList, kFixedList,
kFloatList, kOverflowList};
for (const auto& [list, listID] : aFrame->ChildLists()) {
if (skip.contains(listID)) {
continue;

Просмотреть файл

@ -546,9 +546,6 @@ class nsIFrame : public nsQueryFrame {
typedef mozilla::FrameProperties FrameProperties;
typedef mozilla::layers::Layer Layer;
typedef mozilla::layers::LayerManager LayerManager;
typedef mozilla::layout::FrameChildList ChildList;
typedef mozilla::layout::FrameChildListID ChildListID;
typedef mozilla::layout::FrameChildListIDs ChildListIDs;
typedef mozilla::gfx::DrawTarget DrawTarget;
typedef mozilla::gfx::Matrix Matrix;
typedef mozilla::gfx::Matrix4x4 Matrix4x4;
@ -559,6 +556,12 @@ class nsIFrame : public nsQueryFrame {
typedef nsQueryFrame::ClassID ClassID;
protected:
using ChildList = mozilla::FrameChildList;
using ChildListID = mozilla::FrameChildListID;
using ChildListIDs = mozilla::FrameChildListIDs;
public:
// nsQueryFrame
NS_DECL_QUERYFRAME
NS_DECL_QUERYFRAME_TARGET(nsIFrame)
@ -635,7 +638,7 @@ class nsIFrame : public nsQueryFrame {
void* operator new(size_t, mozilla::PresShell*) MOZ_MUST_OVERRIDE;
using PostDestroyData = mozilla::layout::PostFrameDestroyData;
using PostDestroyData = mozilla::PostFrameDestroyData;
struct MOZ_RAII AutoPostDestroyData {
explicit AutoPostDestroyData(nsPresContext* aPresContext)
: mPresContext(aPresContext) {}
@ -1737,7 +1740,7 @@ class nsIFrame : public nsQueryFrame {
*/
virtual const nsFrameList& GetChildList(ChildListID aListID) const;
const nsFrameList& PrincipalChildList() const {
return GetChildList(kPrincipalList);
return GetChildList(mozilla::kPrincipalList);
}
/**
@ -1761,29 +1764,6 @@ class nsIFrame : public nsQueryFrame {
*/
AutoTArray<ChildList, 4> CrossDocChildLists();
// The individual concrete child lists.
static const ChildListID kPrincipalList = mozilla::layout::kPrincipalList;
static const ChildListID kAbsoluteList = mozilla::layout::kAbsoluteList;
static const ChildListID kBulletList = mozilla::layout::kBulletList;
static const ChildListID kCaptionList = mozilla::layout::kCaptionList;
static const ChildListID kColGroupList = mozilla::layout::kColGroupList;
static const ChildListID kExcessOverflowContainersList =
mozilla::layout::kExcessOverflowContainersList;
static const ChildListID kFixedList = mozilla::layout::kFixedList;
static const ChildListID kFloatList = mozilla::layout::kFloatList;
static const ChildListID kOverflowContainersList =
mozilla::layout::kOverflowContainersList;
static const ChildListID kOverflowList = mozilla::layout::kOverflowList;
static const ChildListID kOverflowOutOfFlowList =
mozilla::layout::kOverflowOutOfFlowList;
static const ChildListID kPopupList = mozilla::layout::kPopupList;
static const ChildListID kPushedFloatsList =
mozilla::layout::kPushedFloatsList;
static const ChildListID kBackdropList = mozilla::layout::kBackdropList;
// A special alias for kPrincipalList that do not request reflow.
static const ChildListID kNoReflowPrincipalList =
mozilla::layout::kNoReflowPrincipalList;
/**
* Child frames are linked together in a doubly-linked list
*/
@ -1898,7 +1878,7 @@ class nsIFrame : public nsQueryFrame {
* https://drafts.csswg.org/css-flexbox/#painting
*/
static DisplayChildFlags DisplayFlagsForFlexOrGridItem() {
return DisplayChildFlags {DisplayChildFlag::ForcePseudoStackingContext};
return DisplayChildFlags{DisplayChildFlag::ForcePseudoStackingContext};
}
bool RefusedAsyncAnimation() const {
@ -4495,8 +4475,8 @@ class nsIFrame : public nsQueryFrame {
void MarkAsNotAbsoluteContainingBlock();
// Child frame types override this function to select their own child list
// name
virtual mozilla::layout::FrameChildListID GetAbsoluteListID() const {
return kAbsoluteList;
virtual mozilla::FrameChildListID GetAbsoluteListID() const {
return mozilla::kAbsoluteList;
}
// Checks if we (or any of our descendants) have NS_FRAME_PAINTED_THEBES set,

Просмотреть файл

@ -150,20 +150,20 @@ void nsPlaceholderFrame::Reflow(nsPresContext* aPresContext,
aDesiredSize.ClearSize();
}
static nsIFrame::ChildListID ChildListIDForOutOfFlow(
nsFrameState aPlaceholderState, const nsIFrame* aChild) {
static FrameChildListID ChildListIDForOutOfFlow(nsFrameState aPlaceholderState,
const nsIFrame* aChild) {
if (aPlaceholderState & PLACEHOLDER_FOR_FLOAT) {
return nsIFrame::kFloatList;
return kFloatList;
}
if (aPlaceholderState & PLACEHOLDER_FOR_FIXEDPOS) {
return nsLayoutUtils::MayBeReallyFixedPos(aChild) ? nsIFrame::kFixedList
: nsIFrame::kAbsoluteList;
return nsLayoutUtils::MayBeReallyFixedPos(aChild) ? kFixedList
: kAbsoluteList;
}
if (aPlaceholderState & PLACEHOLDER_FOR_ABSPOS) {
return nsIFrame::kAbsoluteList;
return kAbsoluteList;
}
MOZ_DIAGNOSTIC_ASSERT(false, "unknown list");
return nsIFrame::kFloatList;
return kFloatList;
}
void nsPlaceholderFrame::DestroyFrom(nsIFrame* aDestructRoot,

Просмотреть файл

@ -1378,7 +1378,7 @@ static FrameTextTraversal CanTextCrossFrameBoundary(nsIFrame* aFrame) {
if (continuesTextRun) {
result.mFrameToScan = aFrame->PrincipalChildList().FirstChild();
result.mOverflowFrameToScan =
aFrame->GetChildList(nsIFrame::kOverflowList).FirstChild();
aFrame->GetChildList(kOverflowList).FirstChild();
NS_WARNING_ASSERTION(
!result.mOverflowFrameToScan,
"Scanning overflow inline frames is something we should avoid");
@ -9282,7 +9282,7 @@ static void RemoveEmptyInFlows(nsTextFrame* aFrame,
} else {
// Just remove it normally; use kNoReflowPrincipalList to avoid posting
// new reflows.
parent->RemoveFrame(nsIFrame::kNoReflowPrincipalList, aFrame);
parent->RemoveFrame(kNoReflowPrincipalList, aFrame);
}
}

Просмотреть файл

@ -386,39 +386,43 @@ class nsMathMLmathBlockFrame final : public nsBlockFrame {
// mFrames
void SetInitialChildList(ChildListID aListID,
nsFrameList&& aChildList) override {
MOZ_ASSERT(aListID == kPrincipalList || aListID == kBackdropList,
"unexpected frame list");
MOZ_ASSERT(
aListID == mozilla::kPrincipalList || aListID == mozilla::kBackdropList,
"unexpected frame list");
nsBlockFrame::SetInitialChildList(aListID, std::move(aChildList));
if (aListID == kPrincipalList) {
if (aListID == mozilla::kPrincipalList) {
// re-resolve our subtree to set any mathml-expected data
nsMathMLContainerFrame::RebuildAutomaticDataForChildren(this);
}
}
void AppendFrames(ChildListID aListID, nsFrameList&& aFrameList) override {
NS_ASSERTION(aListID == kPrincipalList || aListID == kNoReflowPrincipalList,
NS_ASSERTION(aListID == mozilla::kPrincipalList ||
aListID == mozilla::kNoReflowPrincipalList,
"unexpected frame list");
nsBlockFrame::AppendFrames(aListID, std::move(aFrameList));
if (MOZ_LIKELY(aListID == kPrincipalList))
if (MOZ_LIKELY(aListID == mozilla::kPrincipalList))
nsMathMLContainerFrame::ReLayoutChildren(this);
}
void InsertFrames(ChildListID aListID, nsIFrame* aPrevFrame,
const nsLineList::iterator* aPrevFrameLine,
nsFrameList&& aFrameList) override {
NS_ASSERTION(aListID == kPrincipalList || aListID == kNoReflowPrincipalList,
NS_ASSERTION(aListID == mozilla::kPrincipalList ||
aListID == mozilla::kNoReflowPrincipalList,
"unexpected frame list");
nsBlockFrame::InsertFrames(aListID, aPrevFrame, aPrevFrameLine,
std::move(aFrameList));
if (MOZ_LIKELY(aListID == kPrincipalList))
if (MOZ_LIKELY(aListID == mozilla::kPrincipalList))
nsMathMLContainerFrame::ReLayoutChildren(this);
}
virtual void RemoveFrame(ChildListID aListID, nsIFrame* aOldFrame) override {
NS_ASSERTION(aListID == kPrincipalList || aListID == kNoReflowPrincipalList,
NS_ASSERTION(aListID == mozilla::kPrincipalList ||
aListID == mozilla::kNoReflowPrincipalList,
"unexpected frame list");
nsBlockFrame::RemoveFrame(aListID, aOldFrame);
if (MOZ_LIKELY(aListID == kPrincipalList))
if (MOZ_LIKELY(aListID == mozilla::kPrincipalList))
nsMathMLContainerFrame::ReLayoutChildren(this);
}
@ -456,36 +460,39 @@ class nsMathMLmathInlineFrame final : public nsInlineFrame,
void SetInitialChildList(ChildListID aListID,
nsFrameList&& aChildList) override {
NS_ASSERTION(aListID == kPrincipalList, "unexpected frame list");
NS_ASSERTION(aListID == mozilla::kPrincipalList, "unexpected frame list");
nsInlineFrame::SetInitialChildList(aListID, std::move(aChildList));
// re-resolve our subtree to set any mathml-expected data
nsMathMLContainerFrame::RebuildAutomaticDataForChildren(this);
}
void AppendFrames(ChildListID aListID, nsFrameList&& aFrameList) override {
NS_ASSERTION(aListID == kPrincipalList || aListID == kNoReflowPrincipalList,
NS_ASSERTION(aListID == mozilla::kPrincipalList ||
aListID == mozilla::kNoReflowPrincipalList,
"unexpected frame list");
nsInlineFrame::AppendFrames(aListID, std::move(aFrameList));
if (MOZ_LIKELY(aListID == kPrincipalList))
if (MOZ_LIKELY(aListID == mozilla::kPrincipalList))
nsMathMLContainerFrame::ReLayoutChildren(this);
}
void InsertFrames(ChildListID aListID, nsIFrame* aPrevFrame,
const nsLineList::iterator* aPrevFrameLine,
nsFrameList&& aFrameList) override {
NS_ASSERTION(aListID == kPrincipalList || aListID == kNoReflowPrincipalList,
NS_ASSERTION(aListID == mozilla::kPrincipalList ||
aListID == mozilla::kNoReflowPrincipalList,
"unexpected frame list");
nsInlineFrame::InsertFrames(aListID, aPrevFrame, aPrevFrameLine,
std::move(aFrameList));
if (MOZ_LIKELY(aListID == kPrincipalList))
if (MOZ_LIKELY(aListID == mozilla::kPrincipalList))
nsMathMLContainerFrame::ReLayoutChildren(this);
}
virtual void RemoveFrame(ChildListID aListID, nsIFrame* aOldFrame) override {
NS_ASSERTION(aListID == kPrincipalList || aListID == kNoReflowPrincipalList,
NS_ASSERTION(aListID == mozilla::kPrincipalList ||
aListID == mozilla::kNoReflowPrincipalList,
"unexpected frame list");
nsInlineFrame::RemoveFrame(aListID, aOldFrame);
if (MOZ_LIKELY(aListID == kPrincipalList))
if (MOZ_LIKELY(aListID == mozilla::kPrincipalList))
nsMathMLContainerFrame::ReLayoutChildren(this);
}

Просмотреть файл

@ -1182,8 +1182,7 @@ static void FindContainingBlocks(nsIFrame* aFrame,
f->SetForceDescendIntoIfVisible(true);
CRR_LOG("Considering OOFs for %p\n", f);
AddFramesForContainingBlock(f, f->GetChildList(nsIFrame::kFloatList),
aExtraFrames);
AddFramesForContainingBlock(f, f->GetChildList(kFloatList), aExtraFrames);
AddFramesForContainingBlock(f, f->GetChildList(f->GetAbsoluteListID()),
aExtraFrames);
}

Просмотреть файл

@ -121,7 +121,7 @@ nsIFrame* nsBoxFrame::SlowOrdinalGroupAwareSibling(nsIFrame* aBox, bool aNext) {
return nullptr;
}
CSSOrderAwareFrameIterator iter(
parent, layout::kPrincipalList,
parent, kPrincipalList,
CSSOrderAwareFrameIterator::ChildFilter::IncludeAll,
CSSOrderAwareFrameIterator::OrderState::Unknown,
CSSOrderAwareFrameIterator::OrderingProperty::BoxOrdinalGroup);
@ -921,8 +921,7 @@ void nsBoxFrame::BuildDisplayListForChildren(nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists) {
// Iterate over the children in CSS order.
auto iter = CSSOrderAwareFrameIterator(
this, mozilla::layout::kPrincipalList,
CSSOrderAwareFrameIterator::ChildFilter::IncludeAll,
this, kPrincipalList, CSSOrderAwareFrameIterator::ChildFilter::IncludeAll,
CSSOrderAwareFrameIterator::OrderState::Unknown,
CSSOrderAwareFrameIterator::OrderingProperty::BoxOrdinalGroup);
// Put each child's background onto the BlockBorderBackgrounds list

Просмотреть файл

@ -567,7 +567,7 @@ nsresult nsSplitterFrameInner::MouseDown(Event* aMouseEvent) {
bool foundOuter = false;
CSSOrderAwareFrameIterator iter(
mParentBox, layout::kPrincipalList,
mParentBox, kPrincipalList,
CSSOrderAwareFrameIterator::ChildFilter::IncludeAll,
CSSOrderAwareFrameIterator::OrderState::Unknown,
CSSOrderAwareFrameIterator::OrderingProperty::BoxOrdinalGroup);

Просмотреть файл

@ -31,7 +31,7 @@ nsBoxLayout* nsSprocketLayout::gInstance = nullptr;
static Maybe<CSSOrderAwareFrameIterator> IterFor(nsIFrame* aBoxFrame) {
Maybe<CSSOrderAwareFrameIterator> ret;
if (aBoxFrame->IsXULBoxFrame()) {
ret.emplace(aBoxFrame, mozilla::layout::kPrincipalList,
ret.emplace(aBoxFrame, kPrincipalList,
CSSOrderAwareFrameIterator::ChildFilter::IncludeAll,
CSSOrderAwareFrameIterator::OrderState::Unknown,
CSSOrderAwareFrameIterator::OrderingProperty::BoxOrdinalGroup);

Просмотреть файл

@ -439,7 +439,7 @@ void nsTreeColumns::EnsureColumns() {
// Enumerate the columns in visible order
CSSOrderAwareFrameIterator iter(
colFrame, mozilla::layout::kPrincipalList,
colFrame, kPrincipalList,
CSSOrderAwareFrameIterator::ChildFilter::IncludeAll,
CSSOrderAwareFrameIterator::OrderState::Unknown,
CSSOrderAwareFrameIterator::OrderingProperty::BoxOrdinalGroup);