Bug 1799732 Part 3 - Convert FrameChildListID to enum class. r=emilio

This patch is first generated by the following script under gecko root folder.

```
#!/bin/bash

function rename() {
    echo "Renaming $1 to $2"
    rg -l "$1" | xargs sed -i -E -e s/"$1"/"$2"/g
}

rename "kPrincipalList" "FrameChildListID::Principal"
rename "kPopupList" "FrameChildListID::Popup"
rename "kCaptionList" "FrameChildListID::Caption"
rename "kColGroupList" "FrameChildListID::ColGroup"
rename "kAbsoluteList" "FrameChildListID::Absolute"
rename "kFixedList" "FrameChildListID::Fixed"
rename "kOverflowList" "FrameChildListID::Overflow"
rename "kOverflowContainersList" "FrameChildListID::OverflowContainers"
rename "kExcessOverflowContainersList" "FrameChildListID::ExcessOverflowContainers"
rename "kOverflowOutOfFlowList" "FrameChildListID::OverflowOutOfFlow"
rename "kFloatList" "FrameChildListID::Float"
rename "kBulletList" "FrameChildListID::Bullet"
rename "kPushedFloatsList" "FrameChildListID::PushedFloats"
rename "kBackdropList" "FrameChildListID::Backdrop"
rename "kNoReflowPrincipalList" "FrameChildListID::NoReflowPrincipal"
```

And then:
1. Manually fix `FrameChildListID` definition in nsFrameList.h.
2. Apply clang-format.

Differential Revision: https://phabricator.services.mozilla.com/D161864
This commit is contained in:
Ting-Yu Lin
2022-11-11 23:44:17 +00:00
parent da1dd7fade
commit 60a57a352d
49 changed files with 478 additions and 380 deletions

View File

@@ -1176,10 +1176,11 @@ void nsColumnSetFrame::Reflow(nsPresContext* aPresContext,
aReflowInput.ComputedLogicalBorderPadding(aReflowInput.GetWritingMode())
.IsAllZero(),
"Only the column container can have border and padding!");
MOZ_ASSERT(GetChildList(kOverflowContainersList).IsEmpty() &&
GetChildList(kExcessOverflowContainersList).IsEmpty(),
"ColumnSetFrame should store overflow containers in principal "
"child list!");
MOZ_ASSERT(
GetChildList(FrameChildListID::OverflowContainers).IsEmpty() &&
GetChildList(FrameChildListID::ExcessOverflowContainers).IsEmpty(),
"ColumnSetFrame should store overflow containers in principal "
"child list!");
//------------ Handle Incremental Reflow -----------------
@@ -1259,7 +1260,7 @@ void nsColumnSetFrame::AppendDirectlyOwnedAnonBoxes(
#ifdef DEBUG
void nsColumnSetFrame::SetInitialChildList(ChildListID aListID,
nsFrameList&& aChildList) {
MOZ_ASSERT(aListID != kPrincipalList || aChildList.OnlyChild(),
MOZ_ASSERT(aListID != FrameChildListID::Principal || aChildList.OnlyChild(),
"initial principal child list must have exactly one child");
nsContainerFrame::SetInitialChildList(aListID, std::move(aChildList));
}