Bug 1227927 Part 2 - Remove nsIFrame::GetFirstPrincipalChild(). r=mats

--HG--
extra : commitid : 5qtaK1nS8RC
extra : rebase_source : dcc98f423b2446269beb6fa6a9d092ae8213f38e
This commit is contained in:
Ting-Yu Lin 2016-01-29 22:42:14 +08:00
parent 0721bc459e
commit 1889f6bc41
84 changed files with 231 additions and 235 deletions

View File

@ -1466,7 +1466,7 @@ HyperTextAccessible::CaretLineNumber()
break;
// Add lines for the sibling frames before the caret
nsIFrame *sibling = parentFrame->GetFirstPrincipalChild();
nsIFrame *sibling = parentFrame->PrincipalChildList().FirstChild();
while (sibling && sibling != caretFrame) {
nsAutoLineIterator lineIterForSibling = sibling->GetLineIterator();
if (lineIterForSibling) {

View File

@ -6917,7 +6917,7 @@ nsContentUtils::GetAdjustedOffsetInTextControl(nsIFrame* aOffsetFrame,
// has the text frames (containing the content) as its children. This will
// be the case if we click to the right of any of the text frames, or at the
// bottom of the text area.
nsIFrame* firstChild = aOffsetFrame->GetFirstPrincipalChild();
nsIFrame* firstChild = aOffsetFrame->PrincipalChildList().FirstChild();
if (firstChild) {
// In this case, the passed-in offset is incorrect, and we want the length
// of the entire content in the text control frame.
@ -6930,7 +6930,7 @@ nsContentUtils::GetAdjustedOffsetInTextControl(nsIFrame* aOffsetFrame,
// frame. Our offset should therefore be the length of the first child of
// our parent.
int32_t aOutOffset =
aOffsetFrame->GetParent()->GetFirstPrincipalChild()->GetContent()->Length();
aOffsetFrame->GetParent()->PrincipalChildList().FirstChild()->GetContent()->Length();
return aOutOffset;
}

View File

@ -331,7 +331,7 @@ LineHasNonEmptyContentWorker(nsIFrame* aFrame)
// Look for non-empty frames, but ignore inline and br frames.
// For inline frames, descend into the children, if any.
if (aFrame->GetType() == nsGkAtoms::inlineFrame) {
nsIFrame* child = aFrame->GetFirstPrincipalChild();
nsIFrame* child = aFrame->PrincipalChildList().FirstChild();
while (child) {
if (LineHasNonEmptyContentWorker(child)) {
return true;

View File

@ -9885,7 +9885,7 @@ static nsCanvasFrame* FindCanvasFrame(nsIFrame* aFrame)
return canvasFrame;
}
nsIFrame* kid = aFrame->GetFirstPrincipalChild();
nsIFrame* kid = aFrame->PrincipalChildList().FirstChild();
while (kid) {
canvasFrame = FindCanvasFrame(kid);
if (canvasFrame) {

View File

@ -3335,7 +3335,7 @@ IsLastNonemptyRowGroupOfTable(nsIFrame* aFrame)
}
for (nsIFrame* c = aFrame; c; c = c->GetNextContinuation()) {
for (nsIFrame* next = c->GetNextSibling(); next; next = next->GetNextSibling()) {
if (next->GetFirstPrincipalChild()) {
if (next->PrincipalChildList().FirstChild()) {
return false;
}
}

View File

@ -2917,7 +2917,7 @@ HTMLInputElement::Focus(ErrorResult& aError)
// tab to the next one.
nsIFrame* frame = GetPrimaryFrame();
if (frame) {
for (nsIFrame* childFrame = frame->GetFirstPrincipalChild();
for (nsIFrame* childFrame = frame->PrincipalChildList().FirstChild();
childFrame;
childFrame = childFrame->GetNextSibling()) {
// See if the child is a button control.

View File

@ -1111,7 +1111,7 @@ nsGenericHTMLElement::GetFormControlFrame(bool aFlushFrames)
// If we have generated content, the primary frame will be a
// wrapper frame.. out real frame will be in its child list.
for (frame = frame->GetFirstPrincipalChild();
for (frame = frame->PrincipalChildList().FirstChild();
frame;
frame = frame->GetNextSibling()) {
form_frame = do_QueryFrame(frame);

View File

@ -2168,7 +2168,7 @@ nsTextEditorState::InitializeKeyboardEventListeners()
TrustedEventsAtSystemGroupBubble());
}
mSelCon->SetScrollableFrame(do_QueryFrame(mBoundFrame->GetFirstPrincipalChild()));
mSelCon->SetScrollableFrame(do_QueryFrame(mBoundFrame->PrincipalChildList().FirstChild()));
}
void

View File

@ -223,13 +223,13 @@ GetFrameForChildrenOnlyTransformHint(nsIFrame *aFrame)
// This happens if the root-<svg> is fixed positioned, in which case we
// can't use aFrame->GetContent() to find the primary frame, since
// GetContent() returns nullptr for ViewportFrame.
aFrame = aFrame->GetFirstPrincipalChild();
aFrame = aFrame->PrincipalChildList().FirstChild();
}
// For an nsHTMLScrollFrame, this will get the SVG frame that has the
// children-only transforms:
aFrame = aFrame->GetContent()->GetPrimaryFrame();
if (aFrame->GetType() == nsGkAtoms::svgOuterSVGFrame) {
aFrame = aFrame->GetFirstPrincipalChild();
aFrame = aFrame->PrincipalChildList().FirstChild();
MOZ_ASSERT(aFrame->GetType() == nsGkAtoms::svgOuterSVGAnonChildFrame,
"Where is the nsSVGOuterSVGFrame's anon child??");
}
@ -327,7 +327,7 @@ DoApplyRenderingChangeToTree(nsIFrame* aFrame,
if (aChange & nsChangeHint_ChildrenOnlyTransform) {
needInvalidatingPaint = true;
nsIFrame* childFrame =
GetFrameForChildrenOnlyTransformHint(aFrame)->GetFirstPrincipalChild();
GetFrameForChildrenOnlyTransformHint(aFrame)->PrincipalChildList().FirstChild();
for ( ; childFrame; childFrame = childFrame->GetNextSibling()) {
ActiveLayerTracker::NotifyRestyle(childFrame, eCSSProperty_transform);
}
@ -902,7 +902,7 @@ RestyleManager::ProcessRestyledFrames(nsStyleChangeList& aChangeList)
if (hint & nsChangeHint_ChildrenOnlyTransform) {
// The overflow areas of the child frames need to be updated:
nsIFrame* hintFrame = GetFrameForChildrenOnlyTransformHint(frame);
nsIFrame* childFrame = hintFrame->GetFirstPrincipalChild();
nsIFrame* childFrame = hintFrame->PrincipalChildList().FirstChild();
NS_ASSERTION(!nsLayoutUtils::GetNextContinuationOrIBSplitSibling(frame),
"SVG frames should not have continuations "
"or ib-split siblings");

View File

@ -464,7 +464,7 @@ IsBidiSplittable(nsIFrame* aFrame)
static bool
IsBidiLeaf(nsIFrame* aFrame)
{
nsIFrame* kid = aFrame->GetFirstPrincipalChild();
nsIFrame* kid = aFrame->PrincipalChildList().FirstChild();
return !kid || !aFrame->IsFrameOfType(nsIFrame::eBidiInlineContainer);
}
@ -670,7 +670,7 @@ nsBidiPresUtils::Resolve(nsBlockFrame* aBlockFrame)
block->RemoveStateBits(NS_BLOCK_NEEDS_BIDI_RESOLUTION);
nsBlockInFlowLineIterator lineIter(block, block->begin_lines());
bpd.ResetForNewBlock();
TraverseFrames(aBlockFrame, &lineIter, block->GetFirstPrincipalChild(), &bpd);
TraverseFrames(aBlockFrame, &lineIter, block->PrincipalChildList().FirstChild(), &bpd);
// XXX what about overflow lines?
}
@ -1184,7 +1184,7 @@ nsBidiPresUtils::TraverseFrames(nsBlockFrame* aBlockFrame,
}
} else {
// For a non-leaf frame, recurse into TraverseFrames
nsIFrame* kid = frame->GetFirstPrincipalChild();
nsIFrame* kid = frame->PrincipalChildList().FirstChild();
MOZ_ASSERT(!frame->GetChildList(nsIFrame::kOverflowList).FirstChild(),
"should have drained the overflow list above");
if (kid) {
@ -1263,7 +1263,7 @@ nsBidiPresUtils::ReorderFrames(nsIFrame* aFirstFrameOnLine,
// as the container size.
containerSize = aFirstFrameOnLine->GetSize();
aFirstFrameOnLine = aFirstFrameOnLine->GetFirstPrincipalChild();
aFirstFrameOnLine = aFirstFrameOnLine->PrincipalChildList().FirstChild();
if (!aFirstFrameOnLine) {
return 0;
}
@ -1281,7 +1281,7 @@ nsBidiPresUtils::GetFirstLeaf(nsIFrame* aFrame)
{
nsIFrame* firstLeaf = aFrame;
while (!IsBidiLeaf(firstLeaf)) {
nsIFrame* firstChild = firstLeaf->GetFirstPrincipalChild();
nsIFrame* firstChild = firstLeaf->PrincipalChildList().FirstChild();
nsIFrame* realFrame = nsPlaceholderFrame::GetRealFrameFor(firstChild);
firstLeaf = (realFrame->GetType() == nsGkAtoms::letterFrame) ?
realFrame : firstChild;
@ -1307,7 +1307,7 @@ nsBidiPresUtils::GetFrameBaseLevel(nsIFrame* aFrame)
{
nsIFrame* firstLeaf = aFrame;
while (!IsBidiLeaf(firstLeaf)) {
firstLeaf = firstLeaf->GetFirstPrincipalChild();
firstLeaf = firstLeaf->PrincipalChildList().FirstChild();
}
return NS_GET_BASE_LEVEL(firstLeaf);
}
@ -1651,7 +1651,7 @@ nsBidiPresUtils::InitContinuationStates(nsIFrame* aFrame,
if (!IsBidiLeaf(aFrame) || RubyUtils::IsRubyBox(aFrame->GetType())) {
// Continue for child frames
nsIFrame* frame;
for (frame = aFrame->GetFirstPrincipalChild();
for (frame = aFrame->PrincipalChildList().FirstChild();
frame;
frame = frame->GetNextSibling()) {
InitContinuationStates(frame,

View File

@ -361,7 +361,7 @@ static inline nsContainerFrame*
GetFieldSetBlockFrame(nsIFrame* aFieldsetFrame)
{
// Depends on the fieldset child frame order - see ConstructFieldSetFrame() below.
nsIFrame* firstChild = aFieldsetFrame->GetFirstPrincipalChild();
nsIFrame* firstChild = aFieldsetFrame->PrincipalChildList().FirstChild();
nsIFrame* inner = firstChild && firstChild->GetNextSibling() ? firstChild->GetNextSibling() : firstChild;
return inner ? inner->GetContentInsertionFrame() : nullptr;
}
@ -492,7 +492,7 @@ GetLastIBSplitSibling(nsIFrame* aFrame, bool aReturnEmptyTrailingInline)
for (nsIFrame *frame = aFrame, *next; ; frame = next) {
next = GetIBSplitSibling(frame);
if (!next ||
(!aReturnEmptyTrailingInline && !next->GetFirstPrincipalChild() &&
(!aReturnEmptyTrailingInline && !next->PrincipalChildList().FirstChild() &&
!GetIBSplitSibling(next))) {
NS_ASSERTION(!next || !frame->IsInlineOutside(),
"Should have a block here!");
@ -1867,9 +1867,9 @@ IsTablePseudo(nsIFrame* aFrame)
aFrame->GetParent()->StyleContext()->GetPseudo() ==
nsCSSAnonBoxes::tableCell) ||
(pseudoType == nsCSSAnonBoxes::tableOuter &&
(aFrame->GetFirstPrincipalChild()->StyleContext()->GetPseudo() ==
(aFrame->PrincipalChildList().FirstChild()->StyleContext()->GetPseudo() ==
nsCSSAnonBoxes::table ||
aFrame->GetFirstPrincipalChild()->StyleContext()->GetPseudo() ==
aFrame->PrincipalChildList().FirstChild()->StyleContext()->GetPseudo() ==
nsCSSAnonBoxes::inlineTable)));
}
@ -2886,7 +2886,7 @@ nsCSSFrameConstructor::ConstructPageFrame(nsIPresShell* aPresShell,
// containing block for fixed elements which are repeated on every page.
nsIFrame* prevPageContentFrame = nullptr;
if (aPrevPageFrame) {
prevPageContentFrame = aPrevPageFrame->GetFirstPrincipalChild();
prevPageContentFrame = aPrevPageFrame->PrincipalChildList().FirstChild();
NS_ASSERTION(prevPageContentFrame, "missing page content frame");
}
pageContentFrame->Init(nullptr, pageFrame, prevPageContentFrame);
@ -2903,7 +2903,7 @@ nsCSSFrameConstructor::ConstructPageFrame(nsIPresShell* aPresShell,
nsIFrame* prevCanvasFrame = nullptr;
if (prevPageContentFrame) {
prevCanvasFrame = prevPageContentFrame->GetFirstPrincipalChild();
prevCanvasFrame = prevPageContentFrame->PrincipalChildList().FirstChild();
NS_ASSERTION(prevCanvasFrame, "missing canvas frame");
}
aCanvasFrame->Init(nullptr, pageContentFrame, prevCanvasFrame);
@ -6182,7 +6182,7 @@ FindAppendPrevSibling(nsIFrame* aParentFrame, nsIFrame* aAfterFrame)
if (aAfterFrame) {
NS_ASSERTION(aAfterFrame->GetParent() == aParentFrame, "Wrong parent");
NS_ASSERTION(aAfterFrame->GetPrevSibling() ||
aParentFrame->GetFirstPrincipalChild() == aAfterFrame,
aParentFrame->PrincipalChildList().FirstChild() == aAfterFrame,
":after frame must be on the principal child list here");
return aAfterFrame->GetPrevSibling();
}
@ -6203,7 +6203,7 @@ GetInsertNextSibling(nsIFrame* aParentFrame, nsIFrame* aPrevSibling)
return aPrevSibling->GetNextSibling();
}
return aParentFrame->GetFirstPrincipalChild();
return aParentFrame->PrincipalChildList().FirstChild();
}
/**
@ -6220,7 +6220,7 @@ nsCSSFrameConstructor::AppendFramesToParent(nsFrameConstructorState& aStat
{
NS_PRECONDITION(!IsFramePartOfIBSplit(aParentFrame) ||
!GetIBSplitSibling(aParentFrame) ||
!GetIBSplitSibling(aParentFrame)->GetFirstPrincipalChild(),
!GetIBSplitSibling(aParentFrame)->PrincipalChildList().FirstChild(),
"aParentFrame has a ib-split sibling with kids?");
NS_PRECONDITION(!aPrevSibling || aPrevSibling->GetParent() == aParentFrame,
"Parent and prevsibling don't match");
@ -6229,7 +6229,7 @@ nsCSSFrameConstructor::AppendFramesToParent(nsFrameConstructorState& aStat
NS_ASSERTION(nextSibling ||
!aParentFrame->GetNextContinuation() ||
!aParentFrame->GetNextContinuation()->GetFirstPrincipalChild() ||
!aParentFrame->GetNextContinuation()->PrincipalChildList().FirstChild() ||
aIsRecursiveCall,
"aParentFrame has later continuations with kids?");
NS_ASSERTION(nextSibling ||
@ -7720,7 +7720,7 @@ nsCSSFrameConstructor::ContentRangeInserted(nsIContent* aContainer,
if (!prevSibling) {
// We're inserting the new frames as the first child. See if the
// parent has a :before pseudo-element
nsIFrame* firstChild = insertion.mParentFrame->GetFirstPrincipalChild();
nsIFrame* firstChild = insertion.mParentFrame->PrincipalChildList().FirstChild();
if (firstChild &&
nsLayoutUtils::IsGeneratedContentFor(container, firstChild,
@ -8064,7 +8064,7 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
if (!aContainer) {
nsIFrame* viewport = GetRootFrame();
if (viewport) {
nsIFrame* firstChild = viewport->GetFirstPrincipalChild();
nsIFrame* firstChild = viewport->PrincipalChildList().FirstChild();
if (firstChild && firstChild->GetContent() == aChild) {
isRoot = true;
childFrame = firstChild;
@ -8146,7 +8146,7 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
if (grandparentFrame && grandparentFrame->IsBoxFrame() &&
(grandparentFrame->GetStateBits() & NS_STATE_BOX_WRAPS_KIDS_IN_BLOCK) &&
// check if this frame is the only one needing wrapping
aChild == AnyKidsNeedBlockParent(parentFrame->GetFirstPrincipalChild()) &&
aChild == AnyKidsNeedBlockParent(parentFrame->PrincipalChildList().FirstChild()) &&
!AnyKidsNeedBlockParent(childFrame->GetNextSibling())) {
*aDidReconstruct = true;
LAYOUT_PHASE_TEMP_EXIT();
@ -8538,7 +8538,7 @@ nsCSSFrameConstructor::CreateContinuingOuterTableFrame(nsIPresShell* aPresSh
// replicate the caption
nsFrameItems newChildFrames;
nsIFrame* childFrame = aFrame->GetFirstPrincipalChild();
nsIFrame* childFrame = aFrame->PrincipalChildList().FirstChild();
if (childFrame) {
nsIFrame* continuingTableFrame =
CreateContinuingFrame(aPresContext, childFrame, newFrame);
@ -8566,7 +8566,7 @@ nsCSSFrameConstructor::CreateContinuingTableFrame(nsIPresShell* aPresShell,
// Replicate any header/footer frames
nsFrameItems childFrames;
nsIFrame* childFrame = aFrame->GetFirstPrincipalChild();
nsIFrame* childFrame = aFrame->PrincipalChildList().FirstChild();
for ( ; childFrame; childFrame = childFrame->GetNextSibling()) {
// See if it's a header/footer, possibly wrapped in a scroll frame.
nsTableRowGroupFrame* rowGroupFrame =
@ -8689,7 +8689,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
// Create a continuing frame for each table cell frame
nsFrameItems newChildList;
nsIFrame* cellFrame = aFrame->GetFirstPrincipalChild();
nsIFrame* cellFrame = aFrame->PrincipalChildList().FirstChild();
while (cellFrame) {
// See if it's a table cell frame
if (IS_TABLE_CELL(cellFrame->GetType())) {
@ -8718,7 +8718,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
}
// Create a continuing area frame
nsIFrame* blockFrame = aFrame->GetFirstPrincipalChild();
nsIFrame* blockFrame = aFrame->PrincipalChildList().FirstChild();
nsIFrame* continuingBlockFrame =
CreateContinuingFrame(aPresContext, blockFrame,
static_cast<nsContainerFrame*>(cellFrame));
@ -8831,8 +8831,8 @@ nsCSSFrameConstructor::ReplicateFixedFrames(nsPageContentFrame* aParentFrame)
return NS_OK;
}
nsContainerFrame* canvasFrame =
do_QueryFrame(aParentFrame->GetFirstPrincipalChild());
nsIFrame* prevCanvasFrame = prevPageContentFrame->GetFirstPrincipalChild();
do_QueryFrame(aParentFrame->PrincipalChildList().FirstChild());
nsIFrame* prevCanvasFrame = prevPageContentFrame->PrincipalChildList().FirstChild();
if (!canvasFrame || !prevCanvasFrame) {
// document's root element frame missing
return NS_ERROR_UNEXPECTED;
@ -8887,7 +8887,7 @@ nsCSSFrameConstructor::ReplicateFixedFrames(nsPageContentFrame* aParentFrame)
// Add the placeholders to our primary child list.
// XXXbz this is a little screwed up, since the fixed frames will have
// broken auto-positioning. Oh, well.
NS_ASSERTION(!canvasFrame->GetFirstPrincipalChild(),
NS_ASSERTION(!canvasFrame->PrincipalChildList().FirstChild(),
"leaking frames; doc root continuation must be empty");
canvasFrame->SetInitialChildList(kPrincipalList, fixedPlaceholders);
return NS_OK;
@ -9034,7 +9034,7 @@ IsWhitespaceFrame(nsIFrame* aFrame)
static nsIFrame*
FindFirstNonWhitespaceChild(nsIFrame* aParentFrame)
{
nsIFrame* f = aParentFrame->GetFirstPrincipalChild();
nsIFrame* f = aParentFrame->PrincipalChildList().FirstChild();
while (f && IsWhitespaceFrame(f)) {
f = f->GetNextSibling();
}
@ -9253,7 +9253,7 @@ nsCSSFrameConstructor::MaybeRecreateContainerForFrameRemoval(nsIFrame* aFrame,
// If inFlowFrame is not the only in-flow child of |parent|, then removing
// it will change nothing about the {ib} split.
if (inFlowFrame != parent->GetFirstPrincipalChild() ||
if (inFlowFrame != parent->PrincipalChildList().FirstChild() ||
inFlowFrame->LastContinuation()->GetNextSibling()) {
return false;
}
@ -10659,7 +10659,7 @@ nsCSSFrameConstructor::InsertFirstLineFrames(
if (!aPrevSibling) {
// Insertion will become the first frame. Two cases: we either
// already have a first-line frame or we don't.
nsIFrame* firstBlockKid = aBlockFrame->GetFirstPrincipalChild();
nsIFrame* firstBlockKid = aBlockFrame->PrincipalChildList().FirstChild();
if (firstBlockKid->GetType() == nsGkAtoms::lineFrame) {
// We already have a first-line frame
nsIFrame* lineFrame = firstBlockKid;
@ -10759,7 +10759,7 @@ nsCSSFrameConstructor::InsertFirstLineFrames(
if (!nextLineFrame) {
break;
}
nsIFrame* kids = nextLineFrame->GetFirstPrincipalChild();
nsIFrame* kids = nextLineFrame->PrincipalChildList().FirstChild();
}
}
else {
@ -11063,7 +11063,7 @@ nsCSSFrameConstructor::WrapFramesInFirstLetterFrame(
}
}
else if (IsInlineFrame(frame) && frameType != nsGkAtoms::brFrame) {
nsIFrame* kids = frame->GetFirstPrincipalChild();
nsIFrame* kids = frame->PrincipalChildList().FirstChild();
WrapFramesInFirstLetterFrame(aBlockFrame, aBlockContinuation,
static_cast<nsContainerFrame*>(frame),
kids, aModifiedParent, aTextFrame,
@ -11118,7 +11118,7 @@ nsCSSFrameConstructor::RemoveFloatingFirstLetterFrames(
// Take the text frame away from the letter frame (so it isn't
// destroyed when we destroy the letter frame).
nsIFrame* textFrame = floatFrame->GetFirstPrincipalChild();
nsIFrame* textFrame = floatFrame->PrincipalChildList().FirstChild();
if (!textFrame) {
return NS_OK;
}
@ -11197,12 +11197,12 @@ nsCSSFrameConstructor::RemoveFirstLetterFrames(nsIPresShell* aPresShell,
bool* aStopLooking)
{
nsIFrame* prevSibling = nullptr;
nsIFrame* kid = aFrame->GetFirstPrincipalChild();
nsIFrame* kid = aFrame->PrincipalChildList().FirstChild();
while (kid) {
if (nsGkAtoms::letterFrame == kid->GetType()) {
// Bingo. Found it. First steal away the text frame.
nsIFrame* textFrame = kid->GetFirstPrincipalChild();
nsIFrame* textFrame = kid->PrincipalChildList().FirstChild();
if (!textFrame) {
break;
}
@ -11309,7 +11309,7 @@ nsCSSFrameConstructor::RecoverLetterFrames(nsContainerFrame* aBlockFrame)
// XXX shouldn't this bit be set already (bug 408493), assert instead?
continuation->AddStateBits(NS_BLOCK_HAS_FIRST_LETTER_STYLE);
WrapFramesInFirstLetterFrame(aBlockFrame, continuation, continuation,
continuation->GetFirstPrincipalChild(),
continuation->PrincipalChildList().FirstChild(),
&parentFrame, &textFrame, &prevFrame,
letterFrames, &stopLooking);
if (stopLooking) {
@ -12025,7 +12025,7 @@ nsCSSFrameConstructor::WipeContainingBlock(nsFrameConstructorState& aState,
// Try to find one after all
nsIFrame* parentNextCont = aFrame->GetNextContinuation();
while (parentNextCont) {
nextSibling = parentNextCont->GetFirstPrincipalChild();
nextSibling = parentNextCont->PrincipalChildList().FirstChild();
if (nextSibling) {
break;
}

View File

@ -3115,7 +3115,7 @@ nsCSSRendering::ComputeImageLayerPositioningArea(nsPresContext* aPresContext,
}
if (MOZ_UNLIKELY(frameType == nsGkAtoms::canvasFrame)) {
geometryFrame = aForFrame->GetFirstPrincipalChild();
geometryFrame = aForFrame->PrincipalChildList().FirstChild();
// geometryFrame might be null if this canvas is a page created
// as an overflow container (e.g. the in-flow content has already
// finished and this page only displays the continuations of

View File

@ -62,7 +62,7 @@ CheckForTrailingTextFrameRecursive(nsIFrame* aFrame, nsIFrame* aStopAtFrame)
if (!aFrame->IsFrameOfType(nsIFrame::eLineParticipant))
return nullptr;
for (nsIFrame* f = aFrame->GetFirstPrincipalChild(); f; f = f->GetNextSibling())
for (nsIFrame* f = aFrame->PrincipalChildList().FirstChild(); f; f = f->GetNextSibling())
{
nsIFrame* r = CheckForTrailingTextFrameRecursive(f, aStopAtFrame);
if (r)

View File

@ -3795,7 +3795,7 @@ nsDocumentViewer::PrintPreviewNavigate(int16_t aType, int32_t aPageNum)
// Now, locate the current page we are on and
// and the page of the page number
nsIFrame* pageFrame = seqFrame->GetFirstPrincipalChild();
nsIFrame* pageFrame = seqFrame->PrincipalChildList().FirstChild();
while (pageFrame != nullptr) {
nsRect pageRect = pageFrame->GetRect();
if (pageRect.Contains(pageRect.x, pt.y)) {

View File

@ -466,7 +466,7 @@ nsFrameIterator::GetPrevSibling(nsIFrame* aFrame)
nsIFrame*
nsFrameIterator::GetFirstChildInner(nsIFrame* aFrame) {
return aFrame->GetFirstPrincipalChild();
return aFrame->PrincipalChildList().FirstChild();
}
nsIFrame*

View File

@ -1254,7 +1254,7 @@ nsLayoutUtils::LastContinuationWithChild(nsContainerFrame* aFrame)
{
NS_PRECONDITION(aFrame, "NULL frame pointer");
nsIFrame* f = aFrame->LastContinuation();
while (!f->GetFirstPrincipalChild() && f->GetPrevContinuation()) {
while (!f->PrincipalChildList().FirstChild() && f->GetPrevContinuation()) {
f = f->GetPrevContinuation();
}
return static_cast<nsContainerFrame*>(f);
@ -1382,7 +1382,7 @@ nsLayoutUtils::GetBeforeFrameForContent(nsIFrame* aFrame,
// If the first child frame is a pseudo-frame, then try that.
// Note that the frame we create for the generated content is also a
// pseudo-frame and so don't drill down in that case.
nsIFrame* childFrame = genConParentFrame->GetFirstPrincipalChild();
nsIFrame* childFrame = genConParentFrame->PrincipalChildList().FirstChild();
if (childFrame &&
childFrame->IsPseudoFrame(aContent) &&
!childFrame->IsGeneratedContentFrame()) {
@ -1466,7 +1466,7 @@ nsIFrame*
nsLayoutUtils::GetStyleFrame(nsIFrame* aFrame)
{
if (aFrame->GetType() == nsGkAtoms::tableOuterFrame) {
nsIFrame* inner = aFrame->GetFirstPrincipalChild();
nsIFrame* inner = aFrame->PrincipalChildList().FirstChild();
NS_ASSERTION(inner, "Outer table must have an inner");
return inner;
}
@ -3597,7 +3597,7 @@ AddBoxesForFrame(nsIFrame* aFrame,
nsIAtom* pseudoType = aFrame->StyleContext()->GetPseudo();
if (pseudoType == nsCSSAnonBoxes::tableOuter) {
AddBoxesForFrame(aFrame->GetFirstPrincipalChild(), aCallback);
AddBoxesForFrame(aFrame->PrincipalChildList().FirstChild(), aCallback);
nsIFrame* kid = aFrame->GetChildList(nsIFrame::kCaptionList).FirstChild();
if (kid) {
AddBoxesForFrame(kid, aCallback);
@ -3630,7 +3630,7 @@ nsLayoutUtils::GetFirstNonAnonymousFrame(nsIFrame* aFrame)
nsIAtom* pseudoType = aFrame->StyleContext()->GetPseudo();
if (pseudoType == nsCSSAnonBoxes::tableOuter) {
nsIFrame* f = GetFirstNonAnonymousFrame(aFrame->GetFirstPrincipalChild());
nsIFrame* f = GetFirstNonAnonymousFrame(aFrame->PrincipalChildList().FirstChild());
if (f) {
return f;
}
@ -5859,7 +5859,7 @@ nsLayoutUtils::GetFirstLinePosition(WritingMode aWM,
if (fType == nsGkAtoms::fieldSetFrame) {
LinePosition kidPosition;
nsIFrame* kid = aFrame->GetFirstPrincipalChild();
nsIFrame* kid = aFrame->PrincipalChildList().FirstChild();
// kid might be a legend frame here, but that's ok.
if (GetFirstLinePosition(aWM, kid, &kidPosition)) {
*aResult = kidPosition +
@ -6758,7 +6758,7 @@ nsLayoutUtils::GetFrameTransparency(nsIFrame* aBackgroundFrame,
// doing otherwise breaks window display effects on some platforms,
// specifically Vista. (bug 450322)
if (aBackgroundFrame->GetType() == nsGkAtoms::viewportFrame &&
!aBackgroundFrame->GetFirstPrincipalChild()) {
!aBackgroundFrame->PrincipalChildList().FirstChild()) {
return eTransparencyOpaque;
}

View File

@ -2276,7 +2276,7 @@ nsIPresShell::GetRootScrollFrame() const
// Ensure root frame is a viewport frame
if (!rootFrame || nsGkAtoms::viewportFrame != rootFrame->GetType())
return nullptr;
nsIFrame* theFrame = rootFrame->GetFirstPrincipalChild();
nsIFrame* theFrame = rootFrame->PrincipalChildList().FirstChild();
if (!theFrame || nsGkAtoms::scrollFrame != theFrame->GetType())
return nullptr;
return theFrame;
@ -9591,7 +9591,7 @@ FindTopFrame(nsIFrame* aRoot)
}
// Try one of the children
nsIFrame* kid = aRoot->GetFirstPrincipalChild();
nsIFrame* kid = aRoot->PrincipalChildList().FirstChild();
while (nullptr != kid) {
nsIFrame* result = FindTopFrame(kid);
if (nullptr != result) {
@ -10177,7 +10177,7 @@ static void RecurseIndiTotals(nsPresContext* aPresContext,
free(name);
}
nsIFrame* child = aParentFrame->GetFirstPrincipalChild();
nsIFrame* child = aParentFrame->PrincipalChildList().FirstChild();
while (child) {
RecurseIndiTotals(aPresContext, aHT, child, aLevel+1);
child = child->GetNextSibling();

View File

@ -81,7 +81,7 @@ public:
// Inserted child content gets its frames parented by our child block
virtual nsContainerFrame* GetContentInsertionFrame() override {
return GetFirstPrincipalChild()->GetContentInsertionFrame();
return PrincipalChildList().FirstChild()->GetContentInsertionFrame();
}
virtual bool IsFrameOfType(uint32_t aFlags) const override

View File

@ -265,7 +265,7 @@ static nscoord
GetMaxOptionBSize(nsIFrame* aContainer, WritingMode aWM)
{
nscoord result = 0;
for (nsIFrame* option = aContainer->GetFirstPrincipalChild();
for (nsIFrame* option = aContainer->PrincipalChildList().FirstChild();
option; option = option->GetNextSibling()) {
nscoord optionBSize;
if (nsCOMPtr<nsIDOMHTMLOptGroupElement>

View File

@ -210,7 +210,7 @@ nsTextControlFrame::CalcIntrinsicSize(nsRenderingContext* aRenderingContext,
// Add in the size of the scrollbars for textarea
if (IsTextArea()) {
nsIFrame* first = GetFirstPrincipalChild();
nsIFrame* first = PrincipalChildList().FirstChild();
nsIScrollableFrame *scrollableFrame = do_QueryFrame(first);
NS_ASSERTION(scrollableFrame, "Child must be scrollable");
@ -1231,7 +1231,7 @@ nsTextControlFrame::SetInitialChildList(ChildListID aListID,
// Mark the scroll frame as being a reflow root. This will allow
// incremental reflows to be initiated at the scroll frame, rather
// than descending from the root frame of the frame hierarchy.
if (nsIFrame* first = GetFirstPrincipalChild()) {
if (nsIFrame* first = PrincipalChildList().FirstChild()) {
first->AddStateBits(NS_FRAME_REFLOW_ROOT);
nsCOMPtr<nsITextControlElement> txtCtrl = do_QueryInterface(GetContent());

View File

@ -40,7 +40,7 @@ public:
virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
virtual nsIScrollableFrame* GetScrollTargetFrame() override {
return do_QueryFrame(GetFirstPrincipalChild());
return do_QueryFrame(PrincipalChildList().FirstChild());
}
virtual nscoord GetMinISize(nsRenderingContext* aRenderingContext) override;

View File

@ -78,7 +78,7 @@ RubyColumn::Iterator::SkipUntilExistingFrame()
RubySegmentEnumerator::RubySegmentEnumerator(nsRubyFrame* aRubyFrame)
{
nsIFrame* frame = aRubyFrame->GetFirstPrincipalChild();
nsIFrame* frame = aRubyFrame->PrincipalChildList().FirstChild();
MOZ_ASSERT(!frame ||
frame->GetType() == nsGkAtoms::rubyBaseContainerFrame);
mBaseContainer = static_cast<nsRubyBaseContainerFrame*>(frame);
@ -103,7 +103,7 @@ RubyColumnEnumerator::RubyColumnEnumerator(
const uint32_t rtcCount = aTextContainers.Length();
mFrames.SetCapacity(rtcCount + 1);
nsIFrame* rbFrame = aBaseContainer->GetFirstPrincipalChild();
nsIFrame* rbFrame = aBaseContainer->PrincipalChildList().FirstChild();
MOZ_ASSERT(!rbFrame || rbFrame->GetType() == nsGkAtoms::rubyBaseFrame);
mFrames.AppendElement(static_cast<nsRubyContentFrame*>(rbFrame));
for (uint32_t i = 0; i < rtcCount; i++) {
@ -111,7 +111,7 @@ RubyColumnEnumerator::RubyColumnEnumerator(
// If the container is for span, leave a nullptr here.
// Spans do not take part in pairing.
nsIFrame* rtFrame = !container->IsSpanContainer() ?
container->GetFirstPrincipalChild() : nullptr;
container->PrincipalChildList().FirstChild() : nullptr;
MOZ_ASSERT(!rtFrame || rtFrame->GetType() == nsGkAtoms::rubyTextFrame);
mFrames.AppendElement(static_cast<nsRubyContentFrame*>(rtFrame));
}

View File

@ -380,7 +380,7 @@ TextOverflow::ExamineFrameSubtree(nsIFrame* aFrame,
return;
}
nsIFrame* child = aFrame->GetFirstPrincipalChild();
nsIFrame* child = aFrame->PrincipalChildList().FirstChild();
while (child) {
ExamineFrameSubtree(child, aContentArea, aInsideMarkersArea,
aFramesToHide, aAlignmentEdges,

View File

@ -2368,7 +2368,7 @@ nsBlockFrame::ReflowDirtyLines(nsBlockReflowState& aState)
aState.mPresContext->HasPendingInterrupt()) {
// Need to make sure to pull overflows from any prev-in-flows
for (nsIFrame* inlineKid = line->mFirstChild; inlineKid;
inlineKid = inlineKid->GetFirstPrincipalChild()) {
inlineKid = inlineKid->PrincipalChildList().FirstChild()) {
inlineKid->PullOverflowsFromPrevInFlow();
}
}
@ -7200,7 +7200,7 @@ nsBlockFrame::DoCollectFloats(nsIFrame* aFrame, nsFrameList& aList,
// XXXmats nsInlineFrame's lazy reparenting depends on NOT doing that.
}
DoCollectFloats(aFrame->GetFirstPrincipalChild(), aList, true);
DoCollectFloats(aFrame->PrincipalChildList().FirstChild(), aList, true);
DoCollectFloats(aFrame->GetChildList(kOverflowList).FirstChild(), aList, true);
}
if (!aCollectSiblings)

View File

@ -41,7 +41,7 @@ static nsIFrame* DescendIntoBlockLevelFrame(nsIFrame* aFrame)
nsIAtom* type = aFrame->GetType();
if (type == nsGkAtoms::columnSetFrame) {
static_cast<nsColumnSetFrame*>(aFrame)->DrainOverflowColumns();
nsIFrame* child = aFrame->GetFirstPrincipalChild();
nsIFrame* child = aFrame->PrincipalChildList().FirstChild();
if (child) {
return DescendIntoBlockLevelFrame(child);
}

View File

@ -435,7 +435,7 @@ nsCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
}
nsIFrame* kid;
for (kid = GetFirstPrincipalChild(); kid; kid = kid->GetNextSibling()) {
for (kid = PrincipalChildList().FirstChild(); kid; kid = kid->GetNextSibling()) {
// Put our child into its own pseudo-stack.
BuildDisplayListForChild(aBuilder, kid, aDirtyRect, aLists);
}

View File

@ -45,7 +45,7 @@ public:
virtual nscoord GetAvailableContentBSize(const nsHTMLReflowState& aReflowState);
virtual nsContainerFrame* GetContentInsertionFrame() override {
nsIFrame* frame = GetFirstPrincipalChild();
nsIFrame* frame = PrincipalChildList().FirstChild();
// if no children return nullptr
if (!frame)

View File

@ -917,7 +917,7 @@ GetFirstNonAnonBoxDescendant(nsIFrame* aFrame)
}
// USUAL CASE: Descend to the first child in principal list.
aFrame = aFrame->GetFirstPrincipalChild();
aFrame = aFrame->PrincipalChildList().FirstChild();
}
return aFrame;
}
@ -2023,7 +2023,7 @@ nsFlexContainerFrame::SanityCheckAnonymousFlexItems() const
"two anon flex items in a row (shouldn't happen, unless our "
"children have been reordered with the 'order' property)");
nsIFrame* firstWrappedChild = child->GetFirstPrincipalChild();
nsIFrame* firstWrappedChild = child->PrincipalChildList().FirstChild();
MOZ_ASSERT(firstWrappedChild,
"anonymous flex item is empty (shouldn't happen)");
prevChildWasAnonFlexItem = true;

View File

@ -789,7 +789,7 @@ nsFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext)
if (IsSVGText()) {
SVGTextFrame* svgTextFrame = static_cast<SVGTextFrame*>(
nsLayoutUtils::GetClosestFrameOfType(this, nsGkAtoms::svgTextFrame));
nsIFrame* anonBlock = svgTextFrame->GetFirstPrincipalChild();
nsIFrame* anonBlock = svgTextFrame->PrincipalChildList().FirstChild();
// Just as in SVGTextFrame::DidSetStyleContext, we need to ensure that
// any non-display SVGTextFrames get reflowed when a child text frame
// gets new style.
@ -3675,7 +3675,7 @@ static FrameTarget DrillDownToSelectionFrame(nsIFrame* aFrame,
bool aEndFrame, uint32_t aFlags) {
if (SelectionDescendToKids(aFrame)) {
nsIFrame* result = nullptr;
nsIFrame *frame = aFrame->GetFirstPrincipalChild();
nsIFrame *frame = aFrame->PrincipalChildList().FirstChild();
if (!aEndFrame) {
while (frame && (!SelfIsSelectable(frame, aFlags) ||
frame->IsEmpty()))
@ -3858,7 +3858,7 @@ static FrameTarget GetSelectionClosestFrame(nsIFrame* aFrame, nsPoint aPoint,
return target;
}
nsIFrame *kid = aFrame->GetFirstPrincipalChild();
nsIFrame *kid = aFrame->PrincipalChildList().FirstChild();
if (kid) {
// Go through all the child frames to find the closest one
@ -6637,7 +6637,7 @@ FindBlockFrameOrBR(nsIFrame* aFrame, nsDirection aDirection)
child = child->GetPrevSibling();
}
} else { // eDirNext
nsIFrame* child = aFrame->GetFirstPrincipalChild();
nsIFrame* child = aFrame->PrincipalChildList().FirstChild();
while(child && !result.mContent) {
result = FindBlockFrameOrBR(child, aDirection);
child = child->GetNextSibling();
@ -6950,7 +6950,7 @@ nsIFrame::PeekOffset(nsPeekOffsetStruct* aPos)
if (aPos->mResultFrame->GetType() == nsGkAtoms::tableOuterFrame ||
aPos->mResultFrame->GetType() == nsGkAtoms::tableCellFrame)
{
nsIFrame *frame = aPos->mResultFrame->GetFirstPrincipalChild();
nsIFrame *frame = aPos->mResultFrame->PrincipalChildList().FirstChild();
//got the table frame now
while(frame) //ok time to drill down to find iterator
{
@ -6963,7 +6963,7 @@ nsIFrame::PeekOffset(nsPeekOffsetStruct* aPos)
break; //while(frame)
}
result = NS_ERROR_FAILURE;
frame = frame->GetFirstPrincipalChild();
frame = frame->PrincipalChildList().FirstChild();
}
}
@ -7627,7 +7627,7 @@ ComputeAndIncludeOutlineArea(nsIFrame* aFrame, nsOverflowAreas& aOverflowAreas,
pseudoType != nsCSSAnonBoxes::mozAnonymousPositionedBlock)
break;
// If we're done, we really want it and all its later siblings.
frameForArea = frameForArea->GetFirstPrincipalChild();
frameForArea = frameForArea->PrincipalChildList().FirstChild();
NS_ASSERTION(frameForArea, "anonymous block with no children?");
} while (frameForArea);
@ -8065,7 +8065,7 @@ GetCorrectedParent(const nsIFrame* aFrame)
// For a table caption we want the _inner_ table frame (unless it's anonymous)
// as the style parent.
if (aFrame->IsTableCaption()) {
nsIFrame* innerTable = parent->GetFirstPrincipalChild();
nsIFrame* innerTable = parent->PrincipalChildList().FirstChild();
if (!innerTable->StyleContext()->GetPseudo()) {
return innerTable;
}
@ -8076,7 +8076,7 @@ GetCorrectedParent(const nsIFrame* aFrame)
// know its parent. So get the pseudo of the inner in that case.
nsIAtom* pseudo = aFrame->StyleContext()->GetPseudo();
if (pseudo == nsCSSAnonBoxes::tableOuter) {
pseudo = aFrame->GetFirstPrincipalChild()->StyleContext()->GetPseudo();
pseudo = aFrame->PrincipalChildList().FirstChild()->StyleContext()->GetPseudo();
}
return nsFrame::CorrectStyleParentFrame(parent, pseudo);
}
@ -8214,7 +8214,7 @@ nsFrame::GetLastLeaf(nsPresContext* aPresContext, nsIFrame **aFrame)
nsIFrame *child = *aFrame;
//if we are a block frame then go for the last line of 'this'
while (1){
child = child->GetFirstPrincipalChild();
child = child->PrincipalChildList().FirstChild();
if (!child)
return;//nothing to do
nsIFrame* siblingFrame;
@ -8236,7 +8236,7 @@ nsFrame::GetFirstLeaf(nsPresContext* aPresContext, nsIFrame **aFrame)
return;
nsIFrame *child = *aFrame;
while (1){
child = child->GetFirstPrincipalChild();
child = child->PrincipalChildList().FirstChild();
if (!child)
return;//nothing to do
*aFrame = child;

View File

@ -602,7 +602,7 @@ nsHTMLScrollFrame::GuessVScrollbarNeeded(const ScrollReflowState& aState)
return false;
if (mHelper.mIsRoot) {
nsIFrame *f = mHelper.mScrolledFrame->GetFirstPrincipalChild();
nsIFrame *f = mHelper.mScrolledFrame->PrincipalChildList().FirstChild();
if (f && f->GetType() == nsGkAtoms::svgOuterSVGFrame &&
static_cast<nsSVGOuterSVGFrame*>(f)->VerticalScrollbarNotNeeded()) {
// Common SVG case - avoid a bad guess.
@ -3913,7 +3913,7 @@ ScrollFrameHelper::ReloadChildFrames()
mScrollCornerBox = nullptr;
mResizerBox = nullptr;
nsIFrame* frame = mOuter->GetFirstPrincipalChild();
nsIFrame* frame = mOuter->PrincipalChildList().FirstChild();
while (frame) {
nsIContent* content = frame->GetContent();
if (content == mOuter->GetContent()) {
@ -5337,7 +5337,7 @@ ScrollFrameHelper::GetScrolledRectInternal(const nsRect& aScrolledFrameOverflowA
// direction set by the text content overrides the direction of the frame
if (mScrolledFrame->StyleTextReset()->mUnicodeBidi &
NS_STYLE_UNICODE_BIDI_PLAINTEXT) {
nsIFrame* childFrame = mScrolledFrame->GetFirstPrincipalChild();
nsIFrame* childFrame = mScrolledFrame->PrincipalChildList().FirstChild();
if (childFrame) {
frameDir =
(nsBidiPresUtils::ParagraphDirection(childFrame) == NSBIDI_LTR)

View File

@ -3585,7 +3585,7 @@ nsGridContainerFrame::SanityCheckAnonymousGridItems() const
"children have been reordered with the 'order' property)");
*/
MOZ_ASSERT(!prevChildWasAnonGridItem, "two anon grid items in a row");
nsIFrame* firstWrappedChild = child->GetFirstPrincipalChild();
nsIFrame* firstWrappedChild = child->PrincipalChildList().FirstChild();
MOZ_ASSERT(firstWrappedChild,
"anonymous grid item is empty (shouldn't happen)");
prevChildWasAnonGridItem = true;

View File

@ -95,7 +95,7 @@ public:
// Inserted child content gets its frames parented by our child block
virtual nsContainerFrame* GetContentInsertionFrame() override {
return GetFirstPrincipalChild()->GetContentInsertionFrame();
return PrincipalChildList().FirstChild()->GetContentInsertionFrame();
}
protected:

View File

@ -570,7 +570,7 @@ nsHTMLReflowState::InitResizeFlags(nsPresContext* aPresContext, nsIAtom* aFrameT
if (frame->GetType() == nsGkAtoms::svgForeignObjectFrame) {
// Foreign object frames use dirty bits in a special way.
frame->AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
nsIFrame *kid = frame->GetFirstPrincipalChild();
nsIFrame *kid = frame->PrincipalChildList().FirstChild();
if (kid) {
kid->AddStateBits(NS_FRAME_IS_DIRTY);
}

View File

@ -1088,10 +1088,6 @@ public:
*/
void GetCrossDocChildLists(nsTArray<ChildList>* aLists);
nsIFrame* GetFirstPrincipalChild() const {
return GetChildList(kPrincipalList).FirstChild();
}
// The individual concrete child lists.
static const ChildListID kPrincipalList = mozilla::layout::kPrincipalList;
static const ChildListID kAbsoluteList = mozilla::layout::kAbsoluteList;

View File

@ -652,7 +652,7 @@ nsInlineFrame::ReflowFrames(nsPresContext* aPresContext,
// so nsFirstLetterFrame::Reflow can destroy them safely (bug 401042).
nsIFrame* realFrame = nsPlaceholderFrame::GetRealFrameFor(frame);
if (realFrame->GetType() == nsGkAtoms::letterFrame) {
nsIFrame* child = realFrame->GetFirstPrincipalChild();
nsIFrame* child = realFrame->PrincipalChildList().FirstChild();
if (child) {
NS_ASSERTION(child->GetType() == nsGkAtoms::textFrame,
"unexpected frame type");

View File

@ -465,7 +465,7 @@ GetNextPage(nsIFrame* aPageContentFrame)
return nullptr;
NS_ASSERTION(nextPageFrame->GetType() == nsGkAtoms::pageFrame,
"pageFrame's sibling is not a page frame...");
nsIFrame* f = nextPageFrame->GetFirstPrincipalChild();
nsIFrame* f = nextPageFrame->PrincipalChildList().FirstChild();
NS_ASSERTION(f, "pageFrame has no page content frame!");
NS_ASSERTION(f->GetType() == nsGkAtoms::pageContentFrame,
"pageFrame's child is not page content!");

View File

@ -1771,7 +1771,7 @@ nsPluginFrame::SetIsDocumentActive(bool aIsActive)
nsIObjectFrame *
nsPluginFrame::GetNextObjectFrame(nsPresContext* aPresContext, nsIFrame* aRoot)
{
nsIFrame* child = aRoot->GetFirstPrincipalChild();
nsIFrame* child = aRoot->PrincipalChildList().FirstChild();
while (child) {
nsIObjectFrame* outFrame = do_QueryFrame(child);

View File

@ -68,7 +68,7 @@ LineBreakBefore(nsIFrame* aFrame,
const nsLineList::iterator* aLine)
{
for (nsIFrame* child = aFrame; child;
child = child->GetFirstPrincipalChild()) {
child = child->PrincipalChildList().FirstChild()) {
if (!child->CanContinueTextRun()) {
// It is not an inline element. We can break before it.
return gfxBreakPriority::eNormalBreak;
@ -241,7 +241,7 @@ nsRubyBaseContainerFrame::AddInlinePrefISize(
}
for (uint32_t i = 0, iend = textContainers.Length(); i < iend; i++) {
if (textContainers[i]->IsSpanContainer()) {
nsIFrame* frame = textContainers[i]->GetFirstPrincipalChild();
nsIFrame* frame = textContainers[i]->PrincipalChildList().FirstChild();
nsIFrame::InlinePrefISizeData data;
frame->AddInlinePrefISize(aRenderingContext, &data);
MOZ_ASSERT(data.prevLines == 0, "Shouldn't have prev lines");
@ -818,7 +818,7 @@ nsRubyBaseContainerFrame::ReflowSpans(const ReflowState& aReflowState)
continue;
}
nsIFrame* rtFrame = container->GetFirstPrincipalChild();
nsIFrame* rtFrame = container->PrincipalChildList().FirstChild();
nsReflowStatus reflowStatus;
bool pushedFrame;
nsLineLayout* lineLayout = aReflowState.mTextReflowStates[i]->mLineLayout;

View File

@ -520,7 +520,7 @@ GetPrintCanvasElementsInFrame(nsIFrame* aFrame, nsTArray<RefPtr<HTMLCanvasElemen
}
}
if (!child->GetFirstPrincipalChild()) {
if (!child->PrincipalChildList().FirstChild()) {
nsSubDocumentFrame* subdocumentFrame = do_QueryFrame(child);
if (subdocumentFrame) {
// Descend into the subdocument
@ -742,7 +742,7 @@ nsSimplePageSequenceFrame::PrintNextPage()
height -= mMargin.top + mMargin.bottom;
width -= mMargin.left + mMargin.right;
nscoord selectionY = height;
nsIFrame* conFrame = currentPage->GetFirstPrincipalChild();
nsIFrame* conFrame = currentPage->PrincipalChildList().FirstChild();
if (mSelectionHeight >= 0) {
conFrame->SetPosition(conFrame->GetPosition() + nsPoint(0, -mYSelOffset));
nsContainerFrame::PositionChildViews(conFrame);
@ -837,7 +837,7 @@ nsSimplePageSequenceFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
DisplayListClipState::AutoSaveRestore clipState(aBuilder);
clipState.Clear();
nsIFrame* child = GetFirstPrincipalChild();
nsIFrame* child = PrincipalChildList().FirstChild();
nsRect dirty = aDirtyRect;
dirty.ScaleInverseRoundOut(PresContext()->GetPrintPreviewScale());

View File

@ -1270,7 +1270,7 @@ nsSubDocumentFrame::ObtainIntrinsicSizeFrame()
if (scrollable) {
nsIFrame* scrolled = scrollable->GetScrolledFrame();
if (scrolled) {
subDocRoot = scrolled->GetFirstPrincipalChild();
subDocRoot = scrolled->PrincipalChildList().FirstChild();
}
}
}

View File

@ -1145,7 +1145,7 @@ CanTextCrossFrameBoundary(nsIFrame* aFrame, nsIAtom* aType)
}
} else {
if (continuesTextRun) {
result.mFrameToScan = aFrame->GetFirstPrincipalChild();
result.mFrameToScan = aFrame->PrincipalChildList().FirstChild();
result.mOverflowFrameToScan =
aFrame->GetChildList(nsIFrame::kOverflowList).FirstChild();
NS_WARN_IF_FALSE(!result.mOverflowFrameToScan,

View File

@ -218,7 +218,7 @@ nsMathMLContainerFrame::GetPreferredStretchSize(DrawTarget* aDrawTarget
bool firstTime = true;
nsBoundingMetrics bm, bmChild;
nsIFrame* childFrame =
stretchAll ? GetFirstPrincipalChild() : mPresentationData.baseFrame;
stretchAll ? PrincipalChildList().FirstChild() : mPresentationData.baseFrame;
while (childFrame) {
// initializations in case this child happens not to be a MathML frame
nsIMathMLFrame* mathMLFrame = do_QueryFrame(childFrame);
@ -482,7 +482,7 @@ nsMathMLContainerFrame::FinalizeReflow(DrawTarget* aDrawTarget,
// through Stretch() eventually.
if (NS_MATHML_HAS_ERROR(mPresentationData.flags) || NS_FAILED(rv)) {
GatherAndStoreOverflow(&aDesiredSize);
DidReflowChildren(GetFirstPrincipalChild());
DidReflowChildren(PrincipalChildList().FirstChild());
return rv;
}
@ -531,7 +531,7 @@ nsMathMLContainerFrame::FinalizeReflow(DrawTarget* aDrawTarget,
{
// The Place() call above didn't request FinishReflowChild(),
// so let's check that we eventually did through Stretch().
nsIFrame* childFrame = GetFirstPrincipalChild();
nsIFrame* childFrame = PrincipalChildList().FirstChild();
for ( ; childFrame; childFrame = childFrame->GetNextSibling()) {
NS_ASSERTION(!(childFrame->GetStateBits() & NS_FRAME_IN_REFLOW),
"DidReflow() was never called");
@ -587,7 +587,7 @@ nsMathMLContainerFrame::PropagatePresentationDataFor(nsIFrame* aFrame,
}
else {
// propagate down the subtrees
nsIFrame* childFrame = aFrame->GetFirstPrincipalChild();
nsIFrame* childFrame = aFrame->PrincipalChildList().FirstChild();
while (childFrame) {
PropagatePresentationDataFor(childFrame,
aFlagsValues, aFlagsToUpdate);
@ -606,7 +606,7 @@ nsMathMLContainerFrame::PropagatePresentationDataFromChildAt(nsIFrame* aPa
if (!aParentFrame || !aFlagsToUpdate)
return;
int32_t index = 0;
nsIFrame* childFrame = aParentFrame->GetFirstPrincipalChild();
nsIFrame* childFrame = aParentFrame->PrincipalChildList().FirstChild();
while (childFrame) {
if ((index >= aFirstChildIndex) &&
((aLastChildIndex <= 0) || ((aLastChildIndex > 0) &&
@ -666,7 +666,7 @@ nsMathMLContainerFrame::RebuildAutomaticDataForChildren(nsIFrame* aParentFrame)
// the parent
// 2. As we ascend the tree, transmit any specific change that we want
// down the subtrees
nsIFrame* childFrame = aParentFrame->GetFirstPrincipalChild();
nsIFrame* childFrame = aParentFrame->PrincipalChildList().FirstChild();
while (childFrame) {
nsIMathMLFrame* childMathMLFrame = do_QueryFrame(childFrame);
if (childMathMLFrame) {
@ -1375,7 +1375,7 @@ GetInterFrameSpacingFor(int32_t aScriptLevel,
nsIFrame* aParentFrame,
nsIFrame* aChildFrame)
{
nsIFrame* childFrame = aParentFrame->GetFirstPrincipalChild();
nsIFrame* childFrame = aParentFrame->PrincipalChildList().FirstChild();
if (!childFrame || aChildFrame == childFrame)
return 0;
@ -1463,7 +1463,7 @@ nsMathMLContainerFrame::DidReflowChildren(nsIFrame* aFirst, nsIFrame* aStop)
NS_ASSERTION(frame, "aStop isn't a sibling");
if (frame->GetStateBits() & NS_FRAME_IN_REFLOW) {
// finish off principal descendants, too
nsIFrame* grandchild = frame->GetFirstPrincipalChild();
nsIFrame* grandchild = frame->PrincipalChildList().FirstChild();
if (grandchild)
DidReflowChildren(grandchild, nullptr);
@ -1501,7 +1501,7 @@ nsMathMLContainerFrame::TransmitAutomaticDataForMrowLikeElement()
bool embellishedOpFound = false;
nsEmbellishData embellishData;
for (childFrame = GetFirstPrincipalChild();
for (childFrame = PrincipalChildList().FirstChild();
childFrame;
childFrame = childFrame->GetNextSibling()) {
nsIMathMLFrame* mathMLFrame = do_QueryFrame(childFrame);
@ -1555,7 +1555,7 @@ nsMathMLContainerFrame::PropagateFrameFlagFor(nsIFrame* aFrame,
return;
aFrame->AddStateBits(aFlags);
nsIFrame* childFrame = aFrame->GetFirstPrincipalChild();
nsIFrame* childFrame = aFrame->PrincipalChildList().FirstChild();
while (childFrame) {
PropagateFrameFlagFor(childFrame, aFlags);
childFrame = childFrame->GetNextSibling();

View File

@ -64,9 +64,9 @@ nsMathMLTokenFrame::MarkTextFramesAsTokenMathML()
// - to force them to trim their leading and trailing whitespaces.
// - Indicate which frames are suitable for mathvariant
// - flag single character <mi> frames for special italic treatment
for (nsIFrame* childFrame = GetFirstPrincipalChild(); childFrame;
for (nsIFrame* childFrame = PrincipalChildList().FirstChild(); childFrame;
childFrame = childFrame->GetNextSibling()) {
for (nsIFrame* childFrame2 = childFrame->GetFirstPrincipalChild();
for (nsIFrame* childFrame2 = childFrame->PrincipalChildList().FirstChild();
childFrame2; childFrame2 = childFrame2->GetNextSibling()) {
if (childFrame2->GetType() == nsGkAtoms::textFrame) {
childFrame2->AddStateBits(TEXT_IS_IN_TOKEN_MATHML);
@ -132,7 +132,7 @@ nsMathMLTokenFrame::Reflow(nsPresContext* aPresContext,
aDesiredSize.SetBlockStartAscent(0);
aDesiredSize.mBoundingMetrics = nsBoundingMetrics();
nsIFrame* childFrame = GetFirstPrincipalChild();
nsIFrame* childFrame = PrincipalChildList().FirstChild();
while (childFrame) {
// ask our children to compute their bounding metrics
nsHTMLReflowMetrics childDesiredSize(aReflowState.GetWritingMode(),
@ -168,7 +168,7 @@ nsMathMLTokenFrame::Place(DrawTarget* aDrawTarget,
nsHTMLReflowMetrics& aDesiredSize)
{
mBoundingMetrics = nsBoundingMetrics();
for (nsIFrame* childFrame = GetFirstPrincipalChild(); childFrame;
for (nsIFrame* childFrame = PrincipalChildList().FirstChild(); childFrame;
childFrame = childFrame->GetNextSibling()) {
nsHTMLReflowMetrics childSize(aDesiredSize.GetWritingMode());
GetReflowAndBoundingMetricsFor(childFrame, childSize,
@ -192,7 +192,7 @@ nsMathMLTokenFrame::Place(DrawTarget* aDrawTarget,
if (aPlaceOrigin) {
nscoord dy, dx = 0;
for (nsIFrame* childFrame = GetFirstPrincipalChild(); childFrame;
for (nsIFrame* childFrame = PrincipalChildList().FirstChild(); childFrame;
childFrame = childFrame->GetNextSibling()) {
nsHTMLReflowMetrics childSize(aDesiredSize.GetWritingMode());
GetReflowAndBoundingMetricsFor(childFrame, childSize,

View File

@ -327,7 +327,7 @@ nsMathMLmencloseFrame::PlaceInternal(DrawTarget* aDrawTarget,
nsMathMLContainerFrame::Place(aDrawTarget, false, baseSize);
if (NS_MATHML_HAS_ERROR(mPresentationData.flags) || NS_FAILED(rv)) {
DidReflowChildren(GetFirstPrincipalChild());
DidReflowChildren(PrincipalChildList().FirstChild());
return rv;
}

View File

@ -245,7 +245,7 @@ nsMathMLmfencedFrame::Reflow(nsPresContext* aPresContext,
// refactored to use nsMathMLContainerFrame::Reflow() at some stage.
nsReflowStatus childStatus;
nsIFrame* firstChild = GetFirstPrincipalChild();
nsIFrame* firstChild = PrincipalChildList().FirstChild();
nsIFrame* childFrame = firstChild;
nscoord ascent = 0, descent = 0;
if (firstChild || mOpenChar || mCloseChar || mSeparatorsCount > 0) {
@ -626,7 +626,7 @@ nsMathMLmfencedFrame::GetIntrinsicISizeMetrics(nsRenderingContext* aRenderingCon
}
int32_t i = 0;
nsIFrame* childFrame = GetFirstPrincipalChild();
nsIFrame* childFrame = PrincipalChildList().FirstChild();
while (childFrame) {
// XXX This includes margin while Reflow currently doesn't consider
// margin, so we may end up with too much space, but, with stretchy

View File

@ -173,7 +173,7 @@ nsMathMLmmultiscriptsFrame::PlaceMultiScript(nsPresContext* aPresContext,
// depend only on the current font
////////////////////////////////////////
nsIFrame* baseFrame = aFrame->GetFirstPrincipalChild();
nsIFrame* baseFrame = aFrame->PrincipalChildList().FirstChild();
if (!baseFrame) {
if (tag == nsGkAtoms::mmultiscripts_)
@ -330,7 +330,7 @@ nsMathMLmmultiscriptsFrame::PlaceMultiScript(nsPresContext* aPresContext,
// Note that only msup starts with a superscript.
bool isSubScript = (tag != nsGkAtoms::msup_);
nsIFrame* childFrame = aFrame->GetFirstPrincipalChild();
nsIFrame* childFrame = aFrame->PrincipalChildList().FirstChild();
while (childFrame) {
if (childFrame->GetContent()->IsMathMLElement(nsGkAtoms::mprescripts_)) {
if (tag != nsGkAtoms::mmultiscripts_) {

View File

@ -326,7 +326,7 @@ nsMathMLmpaddedFrame::Place(DrawTarget* aDrawTarget,
nsresult rv =
nsMathMLContainerFrame::Place(aDrawTarget, false, aDesiredSize);
if (NS_MATHML_HAS_ERROR(mPresentationData.flags) || NS_FAILED(rv)) {
DidReflowChildren(GetFirstPrincipalChild());
DidReflowChildren(PrincipalChildList().FirstChild());
return rv;
}

View File

@ -43,7 +43,7 @@ nsMathMLmrowFrame::AttributeChanged(int32_t aNameSpaceID,
// notification to the real mtable
if (mContent->IsMathMLElement(nsGkAtoms::mtable_)) {
nsIFrame* frame = mFrames.FirstChild();
for ( ; frame; frame = frame->GetFirstPrincipalChild()) {
for ( ; frame; frame = frame->PrincipalChildList().FirstChild()) {
// drill down to the real mtable
if (frame->GetType() == nsGkAtoms::tableOuterFrame)
return frame->AttributeChanged(aNameSpaceID, aAttribute, aModType);

View File

@ -577,11 +577,11 @@ MapAllAttributesIntoCSS(nsMathMLmtableFrame* aTableFrame)
ParseSpacingAttributes(aTableFrame);
// mtable is simple and only has one (pseudo) row-group
nsIFrame* rgFrame = aTableFrame->GetFirstPrincipalChild();
nsIFrame* rgFrame = aTableFrame->PrincipalChildList().FirstChild();
if (!rgFrame || rgFrame->GetType() != nsGkAtoms::tableRowGroupFrame)
return;
nsIFrame* rowFrame = rgFrame->GetFirstPrincipalChild();
nsIFrame* rowFrame = rgFrame->PrincipalChildList().FirstChild();
for ( ; rowFrame; rowFrame = rowFrame->GetNextSibling()) {
DEBUG_VERIFY_THAT_FRAME_IS(rowFrame, TABLE_ROW);
if (rowFrame->GetType() == nsGkAtoms::tableRowFrame) {
@ -590,7 +590,7 @@ MapAllAttributesIntoCSS(nsMathMLmtableFrame* aTableFrame)
// Map row columnalign.
ParseFrameAttribute(rowFrame, nsGkAtoms::columnalign_, true);
nsIFrame* cellFrame = rowFrame->GetFirstPrincipalChild();
nsIFrame* cellFrame = rowFrame->PrincipalChildList().FirstChild();
for ( ; cellFrame; cellFrame = cellFrame->GetNextSibling()) {
DEBUG_VERIFY_THAT_FRAME_IS(cellFrame, TABLE_CELL);
if (IS_TABLE_CELL(cellFrame->GetType())) {
@ -725,7 +725,7 @@ nsMathMLmtableOuterFrame::AttributeChanged(int32_t aNameSpaceID,
nsIFrame* tableFrame = mFrames.FirstChild();
NS_ASSERTION(tableFrame && tableFrame->GetType() == nsGkAtoms::tableFrame,
"should always have an inner table frame");
nsIFrame* rgFrame = tableFrame->GetFirstPrincipalChild();
nsIFrame* rgFrame = tableFrame->PrincipalChildList().FirstChild();
if (!rgFrame || rgFrame->GetType() != nsGkAtoms::tableRowGroupFrame)
return NS_OK;
@ -798,7 +798,7 @@ nsMathMLmtableOuterFrame::GetRowFrameAt(int32_t aRowIndex)
nsIFrame* tableFrame = mFrames.FirstChild();
NS_ASSERTION(tableFrame && tableFrame->GetType() == nsGkAtoms::tableFrame,
"should always have an inner table frame");
nsIFrame* rgFrame = tableFrame->GetFirstPrincipalChild();
nsIFrame* rgFrame = tableFrame->PrincipalChildList().FirstChild();
if (!rgFrame || rgFrame->GetType() != nsGkAtoms::tableRowGroupFrame)
return nullptr;
for (nsIFrame* rowFrame : rgFrame->PrincipalChildList()) {

View File

@ -2238,7 +2238,7 @@ nsPrintEngine::CalcNumPrintablePages(int32_t& aNumPages)
nsIPageSequenceFrame* pageSequence = po->mPresShell->GetPageSequenceFrame();
nsIFrame * seqFrame = do_QueryFrame(pageSequence);
if (seqFrame) {
nsIFrame* frame = seqFrame->GetFirstPrincipalChild();
nsIFrame* frame = seqFrame->PrincipalChildList().FirstChild();
while (frame) {
aNumPages++;
frame = frame->GetNextSibling();
@ -2867,7 +2867,7 @@ nsPrintEngine::GetPageRangeForSelection(nsIPageSequenceFrame* aPageSeqFrame,
// dump all the pages and their pointers
{
int32_t pageNum = 1;
nsIFrame* child = seqFrame->GetFirstPrincipalChild();
nsIFrame* child = seqFrame->PrincipalChildList().FirstChild();
while (child != nullptr) {
printf("Page: %d - %p\n", pageNum, child);
pageNum++;
@ -2879,7 +2879,7 @@ nsPrintEngine::GetPageRangeForSelection(nsIPageSequenceFrame* aPageSeqFrame,
// Now that we have the page frames
// find out what the page numbers are for each frame
int32_t pageNum = 1;
nsIFrame* page = seqFrame->GetFirstPrincipalChild();
nsIFrame* page = seqFrame->PrincipalChildList().FirstChild();
while (page != nullptr) {
if (page == startPageFrame) {
aStartPageNum = pageNum;
@ -3642,7 +3642,7 @@ static void DumpFrames(FILE* out,
NS_ASSERTION(aRendContext, "Pointer is null!");
NS_ASSERTION(aFrame, "Pointer is null!");
nsIFrame* child = aFrame->GetFirstPrincipalChild();
nsIFrame* child = aFrame->PrincipalChildList().FirstChild();
while (child != nullptr) {
for (int32_t i=0;i<aLevel;i++) {
fprintf(out, " ");
@ -3783,7 +3783,7 @@ static void DumpPrintObjectsList(nsTArray<nsPrintObject*> * aDocList)
if (sqf) {
break;
}
rootFrame = rootFrame->GetFirstPrincipalChild();
rootFrame = rootFrame->PrincipalChildList().FirstChild();
}
}

View File

@ -673,7 +673,7 @@ nsComputedDOMStyle::UpdateCurrentStyleSources(bool aNeedsLayoutFlush)
if (type == nsGkAtoms::tableOuterFrame) {
// If the frame is an outer table frame then we should get the style
// from the inner table frame.
mInnerFrame = mOuterFrame->GetFirstPrincipalChild();
mInnerFrame = mOuterFrame->PrincipalChildList().FirstChild();
NS_ASSERTION(mInnerFrame, "Outer table must have an inner");
NS_ASSERTION(!mInnerFrame->GetNextSibling(),
"Outer table frames should have just one child, "
@ -4891,7 +4891,7 @@ nsComputedDOMStyle::GetAbsoluteOffset(mozilla::css::Side aSide)
// the containing block is the viewport, which _does_ include
// scrollbars. We have to do some extra work.
// the first child in the default frame list is what we want
nsIFrame* scrollingChild = container->GetFirstPrincipalChild();
nsIFrame* scrollingChild = container->PrincipalChildList().FirstChild();
nsIScrollableFrame *scrollFrame = do_QueryFrame(scrollingChild);
if (scrollFrame) {
scrollbarSizes = scrollFrame->GetActualScrollbarSizes();

View File

@ -439,7 +439,7 @@ static SVGTextFrame*
FrameIfAnonymousChildReflowed(SVGTextFrame* aFrame)
{
NS_PRECONDITION(aFrame, "aFrame must not be null");
nsIFrame* kid = aFrame->GetFirstPrincipalChild();
nsIFrame* kid = aFrame->PrincipalChildList().FirstChild();
if (NS_SUBTREE_DIRTY(kid)) {
MOZ_ASSERT(false, "should have already reflowed the anonymous block child");
return nullptr;
@ -1477,7 +1477,7 @@ TextNodeCorrespondenceRecorder::TraverseAndRecord(nsIFrame* aFrame)
// Recursively iterate over the frame tree, for frames that correspond
// to text content elements.
if (IsTextContentElement(aFrame->GetContent())) {
for (nsIFrame* f = aFrame->GetFirstPrincipalChild();
for (nsIFrame* f = aFrame->PrincipalChildList().FirstChild();
f;
f = f->GetNextSibling()) {
TraverseAndRecord(f);
@ -1758,8 +1758,8 @@ private:
uint32_t
TextFrameIterator::UndisplayedCharacters() const
{
MOZ_ASSERT(!(mRootFrame->GetFirstPrincipalChild() &&
NS_SUBTREE_DIRTY(mRootFrame->GetFirstPrincipalChild())),
MOZ_ASSERT(!(mRootFrame->PrincipalChildList().FirstChild() &&
NS_SUBTREE_DIRTY(mRootFrame->PrincipalChildList().FirstChild())),
"should have already reflowed the anonymous block child");
if (!mCurrentFrame) {
@ -1779,7 +1779,7 @@ TextFrameIterator::Next()
if (mCurrentFrame) {
do {
nsIFrame* next = IsTextContentElement(mCurrentFrame->GetContent()) ?
mCurrentFrame->GetFirstPrincipalChild() :
mCurrentFrame->PrincipalChildList().FirstChild() :
nullptr;
if (next) {
// Descend into this frame, and accumulate its position.
@ -3667,7 +3667,7 @@ SVGTextFrame::PaintSVG(gfxContext& aContext,
{
DrawTarget& aDrawTarget = *aContext.GetDrawTarget();
nsIFrame* kid = GetFirstPrincipalChild();
nsIFrame* kid = PrincipalChildList().FirstChild();
if (!kid)
return NS_OK;
@ -3808,7 +3808,7 @@ SVGTextFrame::PaintSVG(gfxContext& aContext,
nsIFrame*
SVGTextFrame::GetFrameForPoint(const gfxPoint& aPoint)
{
NS_ASSERTION(GetFirstPrincipalChild(), "must have a child frame");
NS_ASSERTION(PrincipalChildList().FirstChild(), "must have a child frame");
if (mState & NS_FRAME_IS_NONDISPLAY) {
// Text frames inside <clipPath> will never have had ReflowSVG called on
@ -3977,9 +3977,9 @@ SVGBBox
SVGTextFrame::GetBBoxContribution(const gfx::Matrix &aToBBoxUserspace,
uint32_t aFlags)
{
NS_ASSERTION(GetFirstPrincipalChild(), "must have a child frame");
NS_ASSERTION(PrincipalChildList().FirstChild(), "must have a child frame");
SVGBBox bbox;
nsIFrame* kid = GetFirstPrincipalChild();
nsIFrame* kid = PrincipalChildList().FirstChild();
if (kid && NS_SUBTREE_DIRTY(kid)) {
// Return an empty bbox if our kid's subtree is dirty. This may be called
// in that situation, e.g. when we're building a display list after an
@ -4837,7 +4837,7 @@ ShiftAnchoredChunk(nsTArray<mozilla::CharPosition>& aCharPositions,
void
SVGTextFrame::AdjustChunksForLineBreaks()
{
nsBlockFrame* block = nsLayoutUtils::GetAsBlock(GetFirstPrincipalChild());
nsBlockFrame* block = nsLayoutUtils::GetAsBlock(PrincipalChildList().FirstChild());
NS_ASSERTION(block, "expected block frame");
nsBlockFrame::line_iterator line = block->begin_lines();
@ -5128,7 +5128,7 @@ SVGTextFrame::DoGlyphPositioning()
mPositions.Clear();
RemoveStateBits(NS_STATE_SVG_POSITIONING_DIRTY);
nsIFrame* kid = GetFirstPrincipalChild();
nsIFrame* kid = PrincipalChildList().FirstChild();
if (kid && NS_SUBTREE_DIRTY(kid)) {
MOZ_ASSERT(false, "should have already reflowed the kid");
return;
@ -5197,8 +5197,8 @@ SVGTextFrame::DoGlyphPositioning()
double adjustment = 0.0;
mLengthAdjustScaleFactor = 1.0f;
if (adjustingTextLength) {
nscoord frameLength = vertical ? GetFirstPrincipalChild()->GetRect().height
: GetFirstPrincipalChild()->GetRect().width;
nscoord frameLength = vertical ? PrincipalChildList().FirstChild()->GetRect().height
: PrincipalChildList().FirstChild()->GetRect().width;
float actualTextLength =
static_cast<float>(presContext->AppUnitsToGfxUnits(frameLength) * factor);
@ -5330,7 +5330,7 @@ SVGTextFrame::NotifyGlyphMetricsChange()
void
SVGTextFrame::UpdateGlyphPositioning()
{
nsIFrame* kid = GetFirstPrincipalChild();
nsIFrame* kid = PrincipalChildList().FirstChild();
if (!kid) {
return;
}
@ -5343,7 +5343,7 @@ SVGTextFrame::UpdateGlyphPositioning()
void
SVGTextFrame::MaybeReflowAnonymousBlockChild()
{
nsIFrame* kid = GetFirstPrincipalChild();
nsIFrame* kid = PrincipalChildList().FirstChild();
if (!kid)
return;
@ -5386,7 +5386,7 @@ SVGTextFrame::DoReflow()
}
nsPresContext *presContext = PresContext();
nsIFrame* kid = GetFirstPrincipalChild();
nsIFrame* kid = PrincipalChildList().FirstChild();
if (!kid)
return;

View File

@ -291,7 +291,7 @@ public:
virtual nsContainerFrame* GetContentInsertionFrame() override
{
return GetFirstPrincipalChild()->GetContentInsertionFrame();
return PrincipalChildList().FirstChild()->GetContentInsertionFrame();
}
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,

View File

@ -340,7 +340,7 @@ nsSVGClipPathFrame::IsValid()
nsIAtom *type = kid->GetType();
if (type == nsGkAtoms::svgUseFrame) {
for (nsIFrame* grandKid = kid->GetFirstPrincipalChild(); grandKid;
for (nsIFrame* grandKid = kid->PrincipalChildList().FirstChild(); grandKid;
grandKid = grandKid->GetNextSibling()) {
nsIAtom *type = grandKid->GetType();

View File

@ -112,7 +112,7 @@ nsSVGContainerFrame::ReflowSVGNonDisplayText(nsIFrame* aContainer)
!aContainer->IsFrameOfType(nsIFrame::eSVG),
"it is wasteful to call ReflowSVGNonDisplayText on a container "
"frame that is not NS_FRAME_IS_NONDISPLAY");
for (nsIFrame* kid = aContainer->GetFirstPrincipalChild(); kid;
for (nsIFrame* kid = aContainer->PrincipalChildList().FirstChild(); kid;
kid = kid->GetNextSibling()) {
nsIAtom* type = kid->GetType();
if (type == nsGkAtoms::svgTextFrame) {

View File

@ -211,7 +211,7 @@ nsSVGForeignObjectFrame::PaintSVG(gfxContext& aContext,
if (IsDisabled())
return NS_OK;
nsIFrame* kid = GetFirstPrincipalChild();
nsIFrame* kid = PrincipalChildList().FirstChild();
if (!kid)
return NS_OK;
@ -294,7 +294,7 @@ nsSVGForeignObjectFrame::GetFrameForPoint(const gfxPoint& aPoint)
if (IsDisabled() || (GetStateBits() & NS_FRAME_IS_NONDISPLAY))
return nullptr;
nsIFrame* kid = GetFirstPrincipalChild();
nsIFrame* kid = PrincipalChildList().FirstChild();
if (!kid)
return nullptr;
@ -360,7 +360,7 @@ nsSVGForeignObjectFrame::ReflowSVG()
// Fully mark our kid dirty so that it gets resized if necessary
// (NS_FRAME_HAS_DIRTY_CHILDREN isn't enough in that case):
nsIFrame* kid = GetFirstPrincipalChild();
nsIFrame* kid = PrincipalChildList().FirstChild();
kid->AddStateBits(NS_FRAME_IS_DIRTY);
// Make sure to not allow interrupts if we're not being reflown as a root:
@ -510,7 +510,7 @@ void nsSVGForeignObjectFrame::RequestReflow(nsIPresShell::IntrinsicDirty aType)
// If we haven't had a ReflowSVG() yet, nothing to do.
return;
nsIFrame* kid = GetFirstPrincipalChild();
nsIFrame* kid = PrincipalChildList().FirstChild();
if (!kid)
return;
@ -527,7 +527,7 @@ nsSVGForeignObjectFrame::DoReflow()
return;
nsPresContext *presContext = PresContext();
nsIFrame* kid = GetFirstPrincipalChild();
nsIFrame* kid = PrincipalChildList().FirstChild();
if (!kid)
return;
@ -571,7 +571,7 @@ nsSVGForeignObjectFrame::GetInvalidRegion()
MOZ_ASSERT(!NS_SVGDisplayListPaintingEnabled(),
"Only called by nsDisplayOuterSVG code");
nsIFrame* kid = GetFirstPrincipalChild();
nsIFrame* kid = PrincipalChildList().FirstChild();
if (kid->HasInvalidFrameInSubtree()) {
gfxRect r(mRect.x, mRect.y, mRect.width, mRect.height);
r.Scale(1.0 / nsPresContext::AppUnitsPerCSSPixel());

View File

@ -39,7 +39,7 @@ public:
int32_t aModType) override;
virtual nsContainerFrame* GetContentInsertionFrame() override {
return GetFirstPrincipalChild()->GetContentInsertionFrame();
return PrincipalChildList().FirstChild()->GetContentInsertionFrame();
}
virtual void Reflow(nsPresContext* aPresContext,

View File

@ -95,7 +95,7 @@ nsSVGMarkerFrame::GetCanvasTM()
static nsIFrame*
GetAnonymousChildFrame(nsIFrame* aFrame)
{
nsIFrame* kid = aFrame->GetFirstPrincipalChild();
nsIFrame* kid = aFrame->PrincipalChildList().FirstChild();
MOZ_ASSERT(kid && kid->GetType() == nsGkAtoms::svgMarkerAnonChildFrame,
"expected to find anonymous child of marker frame");
return kid;

View File

@ -76,11 +76,11 @@ public:
virtual nsContainerFrame* GetContentInsertionFrame() override {
// Any children must be added to our single anonymous inner frame kid.
MOZ_ASSERT(GetFirstPrincipalChild() &&
GetFirstPrincipalChild()->GetType() ==
MOZ_ASSERT(PrincipalChildList().FirstChild() &&
PrincipalChildList().FirstChild()->GetType() ==
nsGkAtoms::svgMarkerAnonChildFrame,
"Where is our anonymous child?");
return GetFirstPrincipalChild()->GetContentInsertionFrame();
return PrincipalChildList().FirstChild()->GetContentInsertionFrame();
}
// nsSVGMarkerFrame methods:

View File

@ -384,7 +384,7 @@ nsSVGOuterSVGFrame::Reflow(nsPresContext* aPresContext,
SVGSVGElement *svgElem = static_cast<SVGSVGElement*>(mContent);
nsSVGOuterSVGAnonChildFrame *anonKid =
static_cast<nsSVGOuterSVGAnonChildFrame*>(GetFirstPrincipalChild());
static_cast<nsSVGOuterSVGAnonChildFrame*>(PrincipalChildList().FirstChild());
if (mState & NS_FRAME_FIRST_REFLOW) {
// Initialize
@ -423,9 +423,9 @@ nsSVGOuterSVGFrame::Reflow(nsPresContext* aPresContext,
// handled in SVGSVGElement::FlushImageTransformInvalidation.
//
if (svgElem->HasViewBoxOrSyntheticViewBox()) {
nsIFrame* anonChild = GetFirstPrincipalChild();
nsIFrame* anonChild = PrincipalChildList().FirstChild();
anonChild->AddStateBits(NS_FRAME_IS_DIRTY);
for (nsIFrame* child = anonChild->GetFirstPrincipalChild(); child;
for (nsIFrame* child = anonChild->PrincipalChildList().FirstChild(); child;
child = child->GetNextSibling()) {
child->AddStateBits(NS_FRAME_IS_DIRTY);
}
@ -528,7 +528,7 @@ nsSVGOuterSVGFrame::UpdateOverflow()
nsOverflowAreas overflowAreas(rect, rect);
if (!mIsRootContent) {
nsIFrame *anonKid = GetFirstPrincipalChild();
nsIFrame *anonKid = PrincipalChildList().FirstChild();
overflowAreas.VisualOverflow().UnionRect(
overflowAreas.VisualOverflow(),
anonKid->GetVisualOverflowRect() + anonKid->GetPosition());
@ -589,7 +589,7 @@ nsDisplayOuterSVG::HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect,
nsSVGOuterSVGAnonChildFrame *anonKid =
static_cast<nsSVGOuterSVGAnonChildFrame*>(
outerSVGFrame->GetFirstPrincipalChild());
outerSVGFrame->PrincipalChildList().FirstChild());
nsIFrame* frame =
nsSVGUtils::HitTestChildren(anonKid, svgViewportRelativePoint);
@ -683,7 +683,7 @@ nsSVGOuterSVGFrame::AttributeChanged(int32_t aNameSpaceID,
// make sure our cached transform matrix gets (lazily) updated
mCanvasTM = nullptr;
nsSVGUtils::NotifyChildrenOfSVGChange(GetFirstPrincipalChild(),
nsSVGUtils::NotifyChildrenOfSVGChange(PrincipalChildList().FirstChild(),
aAttribute == nsGkAtoms::viewBox ?
TRANSFORM_CHANGED | COORD_CONTEXT_CHANGED : TRANSFORM_CHANGED);
@ -825,7 +825,7 @@ nsSVGOuterSVGFrame::NotifyViewportOrTransformChanged(uint32_t aFlags)
}
}
nsSVGUtils::NotifyChildrenOfSVGChange(GetFirstPrincipalChild(), aFlags);
nsSVGUtils::NotifyChildrenOfSVGChange(PrincipalChildList().FirstChild(), aFlags);
}
//----------------------------------------------------------------------
@ -836,12 +836,12 @@ nsSVGOuterSVGFrame::PaintSVG(gfxContext& aContext,
const gfxMatrix& aTransform,
const nsIntRect* aDirtyRect)
{
NS_ASSERTION(GetFirstPrincipalChild()->GetType() ==
NS_ASSERTION(PrincipalChildList().FirstChild()->GetType() ==
nsGkAtoms::svgOuterSVGAnonChildFrame &&
!GetFirstPrincipalChild()->GetNextSibling(),
!PrincipalChildList().FirstChild()->GetNextSibling(),
"We should have a single, anonymous, child");
nsSVGOuterSVGAnonChildFrame *anonKid =
static_cast<nsSVGOuterSVGAnonChildFrame*>(GetFirstPrincipalChild());
static_cast<nsSVGOuterSVGAnonChildFrame*>(PrincipalChildList().FirstChild());
return anonKid->PaintSVG(aContext, aTransform, aDirtyRect);
}
@ -849,14 +849,14 @@ SVGBBox
nsSVGOuterSVGFrame::GetBBoxContribution(const gfx::Matrix &aToBBoxUserspace,
uint32_t aFlags)
{
NS_ASSERTION(GetFirstPrincipalChild()->GetType() ==
NS_ASSERTION(PrincipalChildList().FirstChild()->GetType() ==
nsGkAtoms::svgOuterSVGAnonChildFrame &&
!GetFirstPrincipalChild()->GetNextSibling(),
!PrincipalChildList().FirstChild()->GetNextSibling(),
"We should have a single, anonymous, child");
// We must defer to our child so that we don't include our
// content->PrependLocalTransformsTo() transforms.
nsSVGOuterSVGAnonChildFrame *anonKid =
static_cast<nsSVGOuterSVGAnonChildFrame*>(GetFirstPrincipalChild());
static_cast<nsSVGOuterSVGAnonChildFrame*>(PrincipalChildList().FirstChild());
return anonKid->GetBBoxContribution(aToBBoxUserspace, aFlags);
}

View File

@ -96,11 +96,11 @@ public:
virtual nsContainerFrame* GetContentInsertionFrame() override {
// Any children must be added to our single anonymous inner frame kid.
MOZ_ASSERT(GetFirstPrincipalChild() &&
GetFirstPrincipalChild()->GetType() ==
MOZ_ASSERT(PrincipalChildList().FirstChild() &&
PrincipalChildList().FirstChild()->GetType() ==
nsGkAtoms::svgOuterSVGAnonChildFrame,
"Where is our anonymous child?");
return GetFirstPrincipalChild()->GetContentInsertionFrame();
return PrincipalChildList().FirstChild()->GetContentInsertionFrame();
}
virtual bool IsSVGTransformed(Matrix *aOwnTransform,
@ -108,7 +108,7 @@ public:
// Our anonymous wrapper performs the transforms. We simply
// return whether we are transformed here but don't apply the transforms
// themselves.
return GetFirstPrincipalChild()->IsSVGTransformed();
return PrincipalChildList().FirstChild()->IsSVGTransformed();
}
// nsISVGSVGFrame interface:

View File

@ -432,7 +432,7 @@ nsSVGUtils::GetUserToCanvasTM(nsIFrame *aFrame)
void
nsSVGUtils::NotifyChildrenOfSVGChange(nsIFrame *aFrame, uint32_t aFlags)
{
nsIFrame *kid = aFrame->GetFirstPrincipalChild();
nsIFrame *kid = aFrame->PrincipalChildList().FirstChild();
while (kid) {
nsISVGChildFrame* SVGFrame = do_QueryFrame(kid);

View File

@ -1569,7 +1569,7 @@ bool nsCellMap::CellsSpanOut(nsTArray<nsTableRowFrame*>& aRows) const
int32_t numNewRows = aRows.Length();
for (int32_t rowX = 0; rowX < numNewRows; rowX++) {
nsIFrame* rowFrame = (nsIFrame *) aRows.ElementAt(rowX);
nsIFrame* childFrame = rowFrame->GetFirstPrincipalChild();
nsIFrame* childFrame = rowFrame->PrincipalChildList().FirstChild();
while (childFrame) {
nsTableCellFrame *cellFrame = do_QueryFrame(childFrame);
if (cellFrame) {
@ -1741,7 +1741,7 @@ nsCellMap::ExpandWithRows(nsTableCellMap& aMap,
for (int32_t rowX = startRowIndex; rowX <= endRowIndex; rowX++) {
nsTableRowFrame* rFrame = aRowFrames.ElementAt(newRowIndex);
// append cells
nsIFrame* cFrame = rFrame->GetFirstPrincipalChild();
nsIFrame* cFrame = rFrame->PrincipalChildList().FirstChild();
int32_t colIndex = 0;
while (cFrame) {
nsTableCellFrame *cellFrame = do_QueryFrame(cFrame);
@ -2186,7 +2186,7 @@ nsCellMap::RebuildConsideringRows(nsTableCellMap& aMap,
int32_t numNewRows = aRowsToInsert->Length();
for (int32_t newRowX = 0; newRowX < numNewRows; newRowX++) {
nsTableRowFrame* rFrame = aRowsToInsert->ElementAt(newRowX);
nsIFrame* cFrame = rFrame->GetFirstPrincipalChild();
nsIFrame* cFrame = rFrame->PrincipalChildList().FirstChild();
while (cFrame) {
nsTableCellFrame *cellFrame = do_QueryFrame(cFrame);
if (cellFrame) {

View File

@ -699,7 +699,7 @@ nsTableCellFrame::CellHasVisibleContent(nscoord height,
return true;
if (tableFrame->IsBorderCollapse())
return true;
nsIFrame* innerFrame = kidFrame->GetFirstPrincipalChild();
nsIFrame* innerFrame = kidFrame->PrincipalChildList().FirstChild();
while(innerFrame) {
nsIAtom* frameType = innerFrame->GetType();
if (nsGkAtoms::textFrame == frameType) {

View File

@ -94,7 +94,7 @@ public:
#endif
virtual nsContainerFrame* GetContentInsertionFrame() override {
return GetFirstPrincipalChild()->GetContentInsertionFrame();
return PrincipalChildList().FirstChild()->GetContentInsertionFrame();
}
virtual nsMargin GetUsedMargin() const override;

View File

@ -54,7 +54,7 @@ void nsTableColGroupFrame::ResetColIndices(nsIFrame* aFirstColGroup,
}
nsIFrame* colFrame = aStartColFrame;
if (!colFrame || (colIndex != aFirstColIndex)) {
colFrame = colGroupFrame->GetFirstPrincipalChild();
colFrame = colGroupFrame->PrincipalChildList().FirstChild();
}
while (colFrame) {
if (nsGkAtoms::tableColFrame == colFrame->GetType()) {

View File

@ -988,7 +988,7 @@ nsTableFrame::CollectRows(nsIFrame* aFrame,
{
NS_PRECONDITION(aFrame, "null frame");
int32_t numRows = 0;
nsIFrame* childFrame = aFrame->GetFirstPrincipalChild();
nsIFrame* childFrame = aFrame->PrincipalChildList().FirstChild();
while (childFrame) {
aCollection.AppendElement(static_cast<nsTableRowFrame*>(childFrame));
numRows++;
@ -1206,7 +1206,7 @@ nsTableFrame::GenericTraversal(nsDisplayListBuilder* aBuilder, nsFrame* aFrame,
// stacking context, in which case the child won't use its passed-in
// BorderBackground list anyway. It does affect cell borders though; this
// lets us get cell borders into the nsTableFrame's BorderBackground list.
nsIFrame* kid = aFrame->GetFirstPrincipalChild();
nsIFrame* kid = aFrame->PrincipalChildList().FirstChild();
while (kid) {
aFrame->BuildDisplayListForChild(aBuilder, kid, aDirtyRect, aLists);
kid = kid->GetNextSibling();
@ -1504,7 +1504,7 @@ nsTableFrame::ProcessRowInserted(nscoord aNewBSize)
for (uint32_t rgIdx = 0; rgIdx < rowGroups.Length(); rgIdx++) {
nsTableRowGroupFrame* rgFrame = rowGroups[rgIdx];
NS_ASSERTION(rgFrame, "Must have rgFrame here");
nsIFrame* childFrame = rgFrame->GetFirstPrincipalChild();
nsIFrame* childFrame = rgFrame->PrincipalChildList().FirstChild();
// find the row that was inserted first
while (childFrame) {
nsTableRowFrame *rowFrame = do_QueryFrame(childFrame);
@ -2439,7 +2439,7 @@ nsTableFrame::HomogenousInsertFrames(ChildListID aListID,
aPrevFrame = nullptr;
while (pseudoFrame && (parentContent ==
(content = pseudoFrame->GetContent()))) {
pseudoFrame = pseudoFrame->GetFirstPrincipalChild();
pseudoFrame = pseudoFrame->PrincipalChildList().FirstChild();
}
nsCOMPtr<nsIContent> container = content->GetParent();
if (MOZ_LIKELY(container)) { // XXX need this null-check, see bug 411823.
@ -2465,7 +2465,7 @@ nsTableFrame::HomogenousInsertFrames(ChildListID aListID,
pseudoFrame = kidFrame;
while (pseudoFrame && (parentContent ==
(content = pseudoFrame->GetContent()))) {
pseudoFrame = pseudoFrame->GetFirstPrincipalChild();
pseudoFrame = pseudoFrame->PrincipalChildList().FirstChild();
}
int32_t index = container->IndexOf(content);
if (index > lastIndex && index < newIndex) {
@ -3923,7 +3923,7 @@ nsTableFrame::GetFrameAtOrBefore(nsIFrame* aParentFrame,
// aPriorChildFrame is not of type aChildType, so we need start from
// the beginnng and find the closest one
nsIFrame* lastMatchingFrame = nullptr;
nsIFrame* childFrame = aParentFrame->GetFirstPrincipalChild();
nsIFrame* childFrame = aParentFrame->PrincipalChildList().FirstChild();
while (childFrame && (childFrame != aPriorChildFrame)) {
if (aChildType == childFrame->GetType()) {
lastMatchingFrame = childFrame;
@ -3940,13 +3940,13 @@ nsTableFrame::DumpRowGroup(nsIFrame* aKidFrame)
if (!aKidFrame)
return;
nsIFrame* cFrame = aKidFrame->GetFirstPrincipalChild();
nsIFrame* cFrame = aKidFrame->PrincipalChildList().FirstChild();
while (cFrame) {
nsTableRowFrame *rowFrame = do_QueryFrame(cFrame);
if (rowFrame) {
printf("row(%d)=%p ", rowFrame->GetRowIndex(),
static_cast<void*>(rowFrame));
nsIFrame* childFrame = cFrame->GetFirstPrincipalChild();
nsIFrame* childFrame = cFrame->PrincipalChildList().FirstChild();
while (childFrame) {
nsTableCellFrame *cellFrame = do_QueryFrame(childFrame);
if (cellFrame) {

View File

@ -51,7 +51,7 @@ public:
nsIFrame* aOldFrame) override;
virtual nsContainerFrame* GetContentInsertionFrame() override {
return GetFirstPrincipalChild()->GetContentInsertionFrame();
return PrincipalChildList().FirstChild()->GetContentInsertionFrame();
}
#ifdef ACCESSIBILITY

View File

@ -435,7 +435,7 @@ nscoord nsTableRowFrame::GetRowBaseline(WritingMode aWM)
nsSize containerSize = GetSize();
for (nsIFrame* childFrame : mFrames) {
if (IS_TABLE_CELL(childFrame->GetType())) {
nsIFrame* firstKid = childFrame->GetFirstPrincipalChild();
nsIFrame* firstKid = childFrame->PrincipalChildList().FirstChild();
ascent = std::max(ascent,
LogicalRect(aWM, firstKid->GetNormalRect(),
containerSize).BEnd(aWM));
@ -546,7 +546,7 @@ nsTableRowFrame::CalcBSize(const nsHTMLReflowState& aReflowState)
}
// bsize may have changed, adjust descent to absorb any excess difference
nscoord ascent;
if (!kidFrame->GetFirstPrincipalChild()->GetFirstPrincipalChild())
if (!kidFrame->PrincipalChildList().FirstChild()->PrincipalChildList().FirstChild())
ascent = desSize.BSize(wm);
else
ascent = cellFrame->GetCellBaseline();
@ -961,7 +961,7 @@ nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext,
}
// bsize may have changed, adjust descent to absorb any excess difference
nscoord ascent;
if (!kidFrame->GetFirstPrincipalChild()->GetFirstPrincipalChild()) {
if (!kidFrame->PrincipalChildList().FirstChild()->PrincipalChildList().FirstChild()) {
ascent = desiredSize.BSize(wm);
} else {
ascent = ((nsTableCellFrame *)kidFrame)->GetCellBaseline();

View File

@ -197,7 +197,7 @@ DisplayRows(nsDisplayListBuilder* aBuilder, nsFrame* aFrame,
// No cursor. Traverse children the hard way and build a cursor while we're at it
nsTableRowGroupFrame::FrameCursorData* cursor = f->SetupRowCursor();
kid = f->GetFirstPrincipalChild();
kid = f->PrincipalChildList().FirstChild();
while (kid) {
f->BuildDisplayListForChild(aBuilder, kid, aDirtyRect, aLists);
@ -1365,7 +1365,7 @@ nsTableRowGroupFrame::Reflow(nsPresContext* aPresContext,
// XXXmats The following is just bogus. We leave it here for now because
// ReflowChildren should pull up rows from our next-in-flow before returning
// a Complete status, but doesn't (bug 804888).
if (GetNextInFlow() && GetNextInFlow()->GetFirstPrincipalChild()) {
if (GetNextInFlow() && GetNextInFlow()->PrincipalChildList().FirstChild()) {
NS_FRAME_SET_INCOMPLETE(aStatus);
}

View File

@ -382,7 +382,7 @@ BoxObject::GetFirstChild(nsIDOMElement * *aFirstVisibleChild)
*aFirstVisibleChild = nullptr;
nsIFrame* frame = GetFrame(false);
if (!frame) return NS_OK;
nsIFrame* firstFrame = frame->GetFirstPrincipalChild();
nsIFrame* firstFrame = frame->PrincipalChildList().FirstChild();
if (!firstFrame) return NS_OK;
// get the content for the box and query to a dom element
nsCOMPtr<nsIDOMElement> el = do_QueryInterface(firstFrame->GetContent());
@ -429,7 +429,7 @@ BoxObject::GetPreviousSibling(nsIFrame* aParentFrame, nsIFrame* aFrame,
nsIDOMElement** aResult)
{
*aResult = nullptr;
nsIFrame* nextFrame = aParentFrame->GetFirstPrincipalChild();
nsIFrame* nextFrame = aParentFrame->PrincipalChildList().FirstChild();
nsIFrame* prevFrame = nullptr;
while (nextFrame) {
if (nextFrame == aFrame)

View File

@ -926,7 +926,7 @@ nsBox::GetChildBox(const nsIFrame* aFrame)
{
// box layout ends at box-wrapped frames, so don't allow these frames
// to report child boxes.
return aFrame->IsBoxFrame() ? aFrame->GetFirstPrincipalChild() : nullptr;
return aFrame->IsBoxFrame() ? aFrame->PrincipalChildList().FirstChild() : nullptr;
}
/*static*/ nsIFrame*

View File

@ -1107,7 +1107,7 @@ nsBoxFrame::AppendFrames(ChildListID aListID,
nsBoxFrame::GetContentInsertionFrame()
{
if (GetStateBits() & NS_STATE_BOX_WRAPS_KIDS_IN_BLOCK)
return GetFirstPrincipalChild()->GetContentInsertionFrame();
return PrincipalChildList().FirstChild()->GetContentInsertionFrame();
return nsContainerFrame::GetContentInsertionFrame();
}

View File

@ -185,7 +185,7 @@ nsMenuBarFrame::FindMenuWithShortcut(nsIDOMKeyEvent* aKeyEvent)
// Find a most preferred accesskey which should be returned.
nsIFrame* foundMenu = nullptr;
size_t foundIndex = accessKeys.NoIndex;
nsIFrame* currFrame = immediateParent->GetFirstPrincipalChild();
nsIFrame* currFrame = immediateParent->PrincipalChildList().FirstChild();
while (currFrame) {
nsIContent* current = currFrame->GetContent();

View File

@ -1358,7 +1358,7 @@ nsMenuFrame::SizeToPopup(nsBoxLayoutState& aState, nsSize& aSize)
GetBorderAndPadding(borderPadding);
// if there is a scroll frame, add the desired width of the scrollbar as well
nsIScrollableFrame* scrollFrame = do_QueryFrame(popupFrame->GetFirstPrincipalChild());
nsIScrollableFrame* scrollFrame = do_QueryFrame(popupFrame->PrincipalChildList().FirstChild());
nscoord scrollbarWidth = 0;
if (scrollFrame) {
scrollbarWidth =
@ -1441,7 +1441,7 @@ nsIScrollableFrame* nsMenuFrame::GetScrollTargetFrame()
nsMenuPopupFrame* popupFrame = GetPopup();
if (!popupFrame)
return nullptr;
nsIFrame* childFrame = popupFrame->GetFirstPrincipalChild();
nsIFrame* childFrame = popupFrame->PrincipalChildList().FirstChild();
if (childFrame)
return popupFrame->GetScrollFrame(childFrame);
return nullptr;

View File

@ -236,7 +236,7 @@ nsMenuPopupFrame::EnsureWidget()
{
nsView* ourView = GetView();
if (!ourView->HasWidget()) {
NS_ASSERTION(!mGeneratedChildren && !GetFirstPrincipalChild(),
NS_ASSERTION(!mGeneratedChildren && !PrincipalChildList().FirstChild(),
"Creating widget for MenuPopupFrame with children");
CreateWidgetForView(ourView);
}
@ -1684,7 +1684,7 @@ nsIScrollableFrame* nsMenuPopupFrame::GetScrollFrame(nsIFrame* aStart)
// try children
currFrame = aStart;
do {
nsIFrame* childFrame = currFrame->GetFirstPrincipalChild();
nsIFrame* childFrame = currFrame->PrincipalChildList().FirstChild();
nsIScrollableFrame* sf = GetScrollFrame(childFrame);
if (sf)
return sf;

View File

@ -135,7 +135,7 @@ nsProgressMeterFrame::AttributeChanged(int32_t aNameSpaceID,
if (nsGkAtoms::mode == aAttribute ||
(!undetermined &&
(nsGkAtoms::value == aAttribute || nsGkAtoms::max == aAttribute))) {
nsIFrame* barChild = GetFirstPrincipalChild();
nsIFrame* barChild = PrincipalChildList().FirstChild();
if (!barChild) return NS_OK;
nsIFrame* remainderChild = barChild->GetNextSibling();
if (!remainderChild) return NS_OK;

View File

@ -34,7 +34,7 @@ nsIRootBox::GetRootBox(nsIPresShell* aShell)
}
if (rootFrame) {
rootFrame = rootFrame->GetFirstPrincipalChild();
rootFrame = rootFrame->PrincipalChildList().FirstChild();
}
nsIRootBox* rootBox = do_QueryFrame(rootFrame);

View File

@ -233,7 +233,7 @@ nsScrollbarButtonFrame::GetChildWithTag(nsIAtom* atom, nsIFrame* start,
nsIFrame*& result)
{
// recursively search our children
nsIFrame* childFrame = start->GetFirstPrincipalChild();
nsIFrame* childFrame = start->PrincipalChildList().FirstChild();
while (nullptr != childFrame)
{
// get the content node

View File

@ -2333,7 +2333,7 @@ nsXULPopupManager::GetNextMenuItem(nsContainerFrame* aParent,
currFrame = aStart->GetParent()->GetNextSibling();
}
else
currFrame = immediateParent->GetFirstPrincipalChild();
currFrame = immediateParent->PrincipalChildList().FirstChild();
while (currFrame) {
// See if it's a menu item.
@ -2343,7 +2343,7 @@ nsXULPopupManager::GetNextMenuItem(nsContainerFrame* aParent,
}
if (currFrameContent->IsXULElement(nsGkAtoms::menugroup) &&
currFrameContent->GetChildCount() > 0)
currFrame = currFrame->GetFirstPrincipalChild();
currFrame = currFrame->PrincipalChildList().FirstChild();
else if (!currFrame->GetNextSibling() &&
currFrame->GetParent()->GetContent()->IsXULElement(nsGkAtoms::menugroup))
currFrame = currFrame->GetParent()->GetNextSibling();
@ -2351,7 +2351,7 @@ nsXULPopupManager::GetNextMenuItem(nsContainerFrame* aParent,
currFrame = currFrame->GetNextSibling();
}
currFrame = immediateParent->GetFirstPrincipalChild();
currFrame = immediateParent->PrincipalChildList().FirstChild();
// Still don't have anything. Try cycling from the beginning.
while (currFrame && currFrame != aStart) {
@ -2362,7 +2362,7 @@ nsXULPopupManager::GetNextMenuItem(nsContainerFrame* aParent,
}
if (currFrameContent->IsXULElement(nsGkAtoms::menugroup) &&
currFrameContent->GetChildCount() > 0)
currFrame = currFrame->GetFirstPrincipalChild();
currFrame = currFrame->PrincipalChildList().FirstChild();
else if (!currFrame->GetNextSibling() &&
currFrame->GetParent()->GetContent()->IsXULElement(nsGkAtoms::menugroup))
currFrame = currFrame->GetParent()->GetNextSibling();

View File

@ -815,7 +815,7 @@ FindScrollParts(nsIFrame* aCurrFrame, nsTreeBodyFrame::ScrollParts* aResult)
return;
}
nsIFrame* child = aCurrFrame->GetFirstPrincipalChild();
nsIFrame* child = aCurrFrame->PrincipalChildList().FirstChild();
while (child &&
!child->GetContent()->IsRootOfNativeAnonymousSubtree() &&
(!aResult->mVScrollbar || !aResult->mHScrollbar ||

View File

@ -738,7 +738,7 @@ nsTreeColumns::EnsureColumns()
if (!colFrame)
return;
colFrame = colFrame->GetFirstPrincipalChild();
colFrame = colFrame->PrincipalChildList().FirstChild();
if (!colFrame)
return;

View File

@ -2087,7 +2087,7 @@ nsNativeThemeCocoa::GetScrollbarPressStates(nsIFrame* aFrame,
};
// Get the state of any scrollbar buttons in our child frames
for (nsIFrame *childFrame = aFrame->GetFirstPrincipalChild();
for (nsIFrame *childFrame = aFrame->PrincipalChildList().FirstChild();
childFrame;
childFrame = childFrame->GetNextSibling()) {

View File

@ -486,7 +486,7 @@ nsNativeTheme::IsFirstTab(nsIFrame* aFrame)
if (!aFrame)
return false;
nsIFrame* first = aFrame->GetParent()->GetFirstPrincipalChild();
nsIFrame* first = aFrame->GetParent()->PrincipalChildList().FirstChild();
while (first) {
if (first->GetRect().width > 0 &&
first->GetContent()->IsXULElement(nsGkAtoms::tab))
@ -518,7 +518,7 @@ nsNativeTheme::IsNextToSelectedTab(nsIFrame* aFrame, int32_t aOffset)
int32_t thisTabIndex = -1, selectedTabIndex = -1;
nsIFrame* currentTab = aFrame->GetParent()->GetFirstPrincipalChild();
nsIFrame* currentTab = aFrame->GetParent()->PrincipalChildList().FirstChild();
for (int32_t i = 0; currentTab; currentTab = currentTab->GetNextSibling()) {
if (currentTab->GetRect().width == 0)
continue;