diff --git a/accessible/generic/HyperTextAccessible.cpp b/accessible/generic/HyperTextAccessible.cpp index 563ac6fe001..e344599ecde 100644 --- a/accessible/generic/HyperTextAccessible.cpp +++ b/accessible/generic/HyperTextAccessible.cpp @@ -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) { diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index 1e18ac0572b..3c13f6f0fec 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -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; } diff --git a/dom/base/nsDocumentEncoder.cpp b/dom/base/nsDocumentEncoder.cpp index 2e45a3043cc..55c972cc017 100644 --- a/dom/base/nsDocumentEncoder.cpp +++ b/dom/base/nsDocumentEncoder.cpp @@ -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; diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index cad3985d5a3..f4c30e0e87b 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -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) { diff --git a/dom/base/nsRange.cpp b/dom/base/nsRange.cpp index 688f927a9cd..090895092db 100644 --- a/dom/base/nsRange.cpp +++ b/dom/base/nsRange.cpp @@ -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; } } diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp index 0de79536e4d..42f95ff7d9b 100644 --- a/dom/html/HTMLInputElement.cpp +++ b/dom/html/HTMLInputElement.cpp @@ -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. diff --git a/dom/html/nsGenericHTMLElement.cpp b/dom/html/nsGenericHTMLElement.cpp index f3ca091fb0c..dde6b89dc43 100644 --- a/dom/html/nsGenericHTMLElement.cpp +++ b/dom/html/nsGenericHTMLElement.cpp @@ -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); diff --git a/dom/html/nsTextEditorState.cpp b/dom/html/nsTextEditorState.cpp index 06c88fac56a..11077c5149c 100644 --- a/dom/html/nsTextEditorState.cpp +++ b/dom/html/nsTextEditorState.cpp @@ -2168,7 +2168,7 @@ nsTextEditorState::InitializeKeyboardEventListeners() TrustedEventsAtSystemGroupBubble()); } - mSelCon->SetScrollableFrame(do_QueryFrame(mBoundFrame->GetFirstPrincipalChild())); + mSelCon->SetScrollableFrame(do_QueryFrame(mBoundFrame->PrincipalChildList().FirstChild())); } void diff --git a/layout/base/RestyleManager.cpp b/layout/base/RestyleManager.cpp index be559cd075a..947048132da 100644 --- a/layout/base/RestyleManager.cpp +++ b/layout/base/RestyleManager.cpp @@ -223,13 +223,13 @@ GetFrameForChildrenOnlyTransformHint(nsIFrame *aFrame) // This happens if the root- 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"); diff --git a/layout/base/nsBidiPresUtils.cpp b/layout/base/nsBidiPresUtils.cpp index 789844db214..d296389090b 100644 --- a/layout/base/nsBidiPresUtils.cpp +++ b/layout/base/nsBidiPresUtils.cpp @@ -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, diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index d678d6bda97..e4e3333098e 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -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(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(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; } diff --git a/layout/base/nsCSSRendering.cpp b/layout/base/nsCSSRendering.cpp index eb6d1726a16..027c0175e9f 100644 --- a/layout/base/nsCSSRendering.cpp +++ b/layout/base/nsCSSRendering.cpp @@ -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 diff --git a/layout/base/nsCaret.cpp b/layout/base/nsCaret.cpp index 38a0026b1dd..27bf14f9b57 100644 --- a/layout/base/nsCaret.cpp +++ b/layout/base/nsCaret.cpp @@ -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) diff --git a/layout/base/nsDocumentViewer.cpp b/layout/base/nsDocumentViewer.cpp index 030f49b2676..30db3e06476 100644 --- a/layout/base/nsDocumentViewer.cpp +++ b/layout/base/nsDocumentViewer.cpp @@ -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)) { diff --git a/layout/base/nsFrameTraversal.cpp b/layout/base/nsFrameTraversal.cpp index 51a30fdadd5..6ab455395eb 100644 --- a/layout/base/nsFrameTraversal.cpp +++ b/layout/base/nsFrameTraversal.cpp @@ -466,7 +466,7 @@ nsFrameIterator::GetPrevSibling(nsIFrame* aFrame) nsIFrame* nsFrameIterator::GetFirstChildInner(nsIFrame* aFrame) { - return aFrame->GetFirstPrincipalChild(); + return aFrame->PrincipalChildList().FirstChild(); } nsIFrame* diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 1a1bbd5bc16..8bd5278839c 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -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(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; } diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index e46b096740b..223b9fca6a9 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -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(); diff --git a/layout/forms/nsHTMLButtonControlFrame.h b/layout/forms/nsHTMLButtonControlFrame.h index 61bbe5e02eb..e5784202e08 100644 --- a/layout/forms/nsHTMLButtonControlFrame.h +++ b/layout/forms/nsHTMLButtonControlFrame.h @@ -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 diff --git a/layout/forms/nsListControlFrame.cpp b/layout/forms/nsListControlFrame.cpp index fafa31c535c..8d9c6258bab 100644 --- a/layout/forms/nsListControlFrame.cpp +++ b/layout/forms/nsListControlFrame.cpp @@ -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 diff --git a/layout/forms/nsTextControlFrame.cpp b/layout/forms/nsTextControlFrame.cpp index fdbf641bcd3..36e8e66e7a9 100644 --- a/layout/forms/nsTextControlFrame.cpp +++ b/layout/forms/nsTextControlFrame.cpp @@ -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 txtCtrl = do_QueryInterface(GetContent()); diff --git a/layout/forms/nsTextControlFrame.h b/layout/forms/nsTextControlFrame.h index 044fe14d6f2..0157d3b4a78 100644 --- a/layout/forms/nsTextControlFrame.h +++ b/layout/forms/nsTextControlFrame.h @@ -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; diff --git a/layout/generic/RubyUtils.cpp b/layout/generic/RubyUtils.cpp index 3a9cdbc1ad8..f340663bc21 100644 --- a/layout/generic/RubyUtils.cpp +++ b/layout/generic/RubyUtils.cpp @@ -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(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(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(rtFrame)); } diff --git a/layout/generic/TextOverflow.cpp b/layout/generic/TextOverflow.cpp index afcfa915645..bee2350b1ae 100644 --- a/layout/generic/TextOverflow.cpp +++ b/layout/generic/TextOverflow.cpp @@ -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, diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index bfb2a7fcbd0..02626e1d963 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -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) diff --git a/layout/generic/nsBlockReflowContext.cpp b/layout/generic/nsBlockReflowContext.cpp index 44aa2f02d16..6a046f26873 100644 --- a/layout/generic/nsBlockReflowContext.cpp +++ b/layout/generic/nsBlockReflowContext.cpp @@ -41,7 +41,7 @@ static nsIFrame* DescendIntoBlockLevelFrame(nsIFrame* aFrame) nsIAtom* type = aFrame->GetType(); if (type == nsGkAtoms::columnSetFrame) { static_cast(aFrame)->DrainOverflowColumns(); - nsIFrame* child = aFrame->GetFirstPrincipalChild(); + nsIFrame* child = aFrame->PrincipalChildList().FirstChild(); if (child) { return DescendIntoBlockLevelFrame(child); } diff --git a/layout/generic/nsCanvasFrame.cpp b/layout/generic/nsCanvasFrame.cpp index cba64823e16..0989a5bbe5d 100644 --- a/layout/generic/nsCanvasFrame.cpp +++ b/layout/generic/nsCanvasFrame.cpp @@ -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); } diff --git a/layout/generic/nsColumnSetFrame.h b/layout/generic/nsColumnSetFrame.h index 49860624d54..fefb298de56 100644 --- a/layout/generic/nsColumnSetFrame.h +++ b/layout/generic/nsColumnSetFrame.h @@ -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) diff --git a/layout/generic/nsFlexContainerFrame.cpp b/layout/generic/nsFlexContainerFrame.cpp index c956a895671..af5d5b9ee1f 100644 --- a/layout/generic/nsFlexContainerFrame.cpp +++ b/layout/generic/nsFlexContainerFrame.cpp @@ -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; diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index f64db90b82e..7f3bed7cf05 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -789,7 +789,7 @@ nsFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext) if (IsSVGText()) { SVGTextFrame* svgTextFrame = static_cast( 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; diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index e2f8a4e5a61..f96c6a31e96 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -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(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) diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp index b5308b6addf..1c9b3819a5e 100644 --- a/layout/generic/nsGridContainerFrame.cpp +++ b/layout/generic/nsGridContainerFrame.cpp @@ -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; diff --git a/layout/generic/nsHTMLCanvasFrame.h b/layout/generic/nsHTMLCanvasFrame.h index e3bbf731c37..aada81e0410 100644 --- a/layout/generic/nsHTMLCanvasFrame.h +++ b/layout/generic/nsHTMLCanvasFrame.h @@ -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: diff --git a/layout/generic/nsHTMLReflowState.cpp b/layout/generic/nsHTMLReflowState.cpp index 85c430d01bb..d297a41645d 100644 --- a/layout/generic/nsHTMLReflowState.cpp +++ b/layout/generic/nsHTMLReflowState.cpp @@ -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); } diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h index 1f7ba243fc6..c4b5e5fbc1e 100644 --- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -1088,10 +1088,6 @@ public: */ void GetCrossDocChildLists(nsTArray* 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; diff --git a/layout/generic/nsInlineFrame.cpp b/layout/generic/nsInlineFrame.cpp index dbafb16a387..e5925bd3aa3 100644 --- a/layout/generic/nsInlineFrame.cpp +++ b/layout/generic/nsInlineFrame.cpp @@ -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"); diff --git a/layout/generic/nsPageFrame.cpp b/layout/generic/nsPageFrame.cpp index 1a8c5721d3c..cba5dd65562 100644 --- a/layout/generic/nsPageFrame.cpp +++ b/layout/generic/nsPageFrame.cpp @@ -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!"); diff --git a/layout/generic/nsPluginFrame.cpp b/layout/generic/nsPluginFrame.cpp index 89076f2e26d..fa4ddfa2f2d 100644 --- a/layout/generic/nsPluginFrame.cpp +++ b/layout/generic/nsPluginFrame.cpp @@ -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); diff --git a/layout/generic/nsRubyBaseContainerFrame.cpp b/layout/generic/nsRubyBaseContainerFrame.cpp index 047e0cd27ae..364324babed 100644 --- a/layout/generic/nsRubyBaseContainerFrame.cpp +++ b/layout/generic/nsRubyBaseContainerFrame.cpp @@ -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; diff --git a/layout/generic/nsSimplePageSequenceFrame.cpp b/layout/generic/nsSimplePageSequenceFrame.cpp index 103f62de04f..6f3edd2fed1 100644 --- a/layout/generic/nsSimplePageSequenceFrame.cpp +++ b/layout/generic/nsSimplePageSequenceFrame.cpp @@ -520,7 +520,7 @@ GetPrintCanvasElementsInFrame(nsIFrame* aFrame, nsTArrayGetFirstPrincipalChild()) { + 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()); diff --git a/layout/generic/nsSubDocumentFrame.cpp b/layout/generic/nsSubDocumentFrame.cpp index fc6ddf26330..23d49ca59f3 100644 --- a/layout/generic/nsSubDocumentFrame.cpp +++ b/layout/generic/nsSubDocumentFrame.cpp @@ -1270,7 +1270,7 @@ nsSubDocumentFrame::ObtainIntrinsicSizeFrame() if (scrollable) { nsIFrame* scrolled = scrollable->GetScrolledFrame(); if (scrolled) { - subDocRoot = scrolled->GetFirstPrincipalChild(); + subDocRoot = scrolled->PrincipalChildList().FirstChild(); } } } diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp index eda5181f2dc..8010ecac81c 100644 --- a/layout/generic/nsTextFrame.cpp +++ b/layout/generic/nsTextFrame.cpp @@ -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, diff --git a/layout/mathml/nsMathMLContainerFrame.cpp b/layout/mathml/nsMathMLContainerFrame.cpp index a48312efd61..eeaa9cfe7a4 100644 --- a/layout/mathml/nsMathMLContainerFrame.cpp +++ b/layout/mathml/nsMathMLContainerFrame.cpp @@ -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(); diff --git a/layout/mathml/nsMathMLTokenFrame.cpp b/layout/mathml/nsMathMLTokenFrame.cpp index 73d58b28e9e..2c91fd0c065 100644 --- a/layout/mathml/nsMathMLTokenFrame.cpp +++ b/layout/mathml/nsMathMLTokenFrame.cpp @@ -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 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, diff --git a/layout/mathml/nsMathMLmencloseFrame.cpp b/layout/mathml/nsMathMLmencloseFrame.cpp index 149e9b5cfc7..9dc02df765f 100644 --- a/layout/mathml/nsMathMLmencloseFrame.cpp +++ b/layout/mathml/nsMathMLmencloseFrame.cpp @@ -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; } diff --git a/layout/mathml/nsMathMLmfencedFrame.cpp b/layout/mathml/nsMathMLmfencedFrame.cpp index 56d665f0a87..2d39e3f0fe6 100644 --- a/layout/mathml/nsMathMLmfencedFrame.cpp +++ b/layout/mathml/nsMathMLmfencedFrame.cpp @@ -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 diff --git a/layout/mathml/nsMathMLmmultiscriptsFrame.cpp b/layout/mathml/nsMathMLmmultiscriptsFrame.cpp index c1d9957a3c9..126f54ca305 100644 --- a/layout/mathml/nsMathMLmmultiscriptsFrame.cpp +++ b/layout/mathml/nsMathMLmmultiscriptsFrame.cpp @@ -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_) { diff --git a/layout/mathml/nsMathMLmpaddedFrame.cpp b/layout/mathml/nsMathMLmpaddedFrame.cpp index aefdabd8e4a..b24f93e741b 100644 --- a/layout/mathml/nsMathMLmpaddedFrame.cpp +++ b/layout/mathml/nsMathMLmpaddedFrame.cpp @@ -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; } diff --git a/layout/mathml/nsMathMLmrowFrame.cpp b/layout/mathml/nsMathMLmrowFrame.cpp index 5bdcff1706a..65b9e0fd5f0 100644 --- a/layout/mathml/nsMathMLmrowFrame.cpp +++ b/layout/mathml/nsMathMLmrowFrame.cpp @@ -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); diff --git a/layout/mathml/nsMathMLmtableFrame.cpp b/layout/mathml/nsMathMLmtableFrame.cpp index 1df2a7188f9..912d0c9fd8f 100644 --- a/layout/mathml/nsMathMLmtableFrame.cpp +++ b/layout/mathml/nsMathMLmtableFrame.cpp @@ -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()) { diff --git a/layout/printing/nsPrintEngine.cpp b/layout/printing/nsPrintEngine.cpp index bd0d647e33f..76aca13abdd 100644 --- a/layout/printing/nsPrintEngine.cpp +++ b/layout/printing/nsPrintEngine.cpp @@ -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 * aDocList) if (sqf) { break; } - rootFrame = rootFrame->GetFirstPrincipalChild(); + rootFrame = rootFrame->PrincipalChildList().FirstChild(); } } diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp index d4516745024..b9d9dc34c78 100644 --- a/layout/style/nsComputedDOMStyle.cpp +++ b/layout/style/nsComputedDOMStyle.cpp @@ -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(); diff --git a/layout/svg/SVGTextFrame.cpp b/layout/svg/SVGTextFrame.cpp index 8a34c1d5df4..5984c4f86b5 100644 --- a/layout/svg/SVGTextFrame.cpp +++ b/layout/svg/SVGTextFrame.cpp @@ -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 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& 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(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; diff --git a/layout/svg/SVGTextFrame.h b/layout/svg/SVGTextFrame.h index 9b423e9d16f..697ada8aa9d 100644 --- a/layout/svg/SVGTextFrame.h +++ b/layout/svg/SVGTextFrame.h @@ -291,7 +291,7 @@ public: virtual nsContainerFrame* GetContentInsertionFrame() override { - return GetFirstPrincipalChild()->GetContentInsertionFrame(); + return PrincipalChildList().FirstChild()->GetContentInsertionFrame(); } virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder, diff --git a/layout/svg/nsSVGClipPathFrame.cpp b/layout/svg/nsSVGClipPathFrame.cpp index cdf092d199f..820e530dd93 100644 --- a/layout/svg/nsSVGClipPathFrame.cpp +++ b/layout/svg/nsSVGClipPathFrame.cpp @@ -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(); diff --git a/layout/svg/nsSVGContainerFrame.cpp b/layout/svg/nsSVGContainerFrame.cpp index c06ae5bfc74..310b4e6b5d7 100644 --- a/layout/svg/nsSVGContainerFrame.cpp +++ b/layout/svg/nsSVGContainerFrame.cpp @@ -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) { diff --git a/layout/svg/nsSVGForeignObjectFrame.cpp b/layout/svg/nsSVGForeignObjectFrame.cpp index 0e8c3065a3c..7897967e3e6 100644 --- a/layout/svg/nsSVGForeignObjectFrame.cpp +++ b/layout/svg/nsSVGForeignObjectFrame.cpp @@ -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()); diff --git a/layout/svg/nsSVGForeignObjectFrame.h b/layout/svg/nsSVGForeignObjectFrame.h index ef3c9d419e5..3cd3b03bdf8 100644 --- a/layout/svg/nsSVGForeignObjectFrame.h +++ b/layout/svg/nsSVGForeignObjectFrame.h @@ -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, diff --git a/layout/svg/nsSVGMarkerFrame.cpp b/layout/svg/nsSVGMarkerFrame.cpp index e5471c644c9..46a114e137e 100644 --- a/layout/svg/nsSVGMarkerFrame.cpp +++ b/layout/svg/nsSVGMarkerFrame.cpp @@ -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; diff --git a/layout/svg/nsSVGMarkerFrame.h b/layout/svg/nsSVGMarkerFrame.h index d23fb9f7cbb..a40c09c510b 100644 --- a/layout/svg/nsSVGMarkerFrame.h +++ b/layout/svg/nsSVGMarkerFrame.h @@ -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: diff --git a/layout/svg/nsSVGOuterSVGFrame.cpp b/layout/svg/nsSVGOuterSVGFrame.cpp index 0c871b1d848..67432849709 100644 --- a/layout/svg/nsSVGOuterSVGFrame.cpp +++ b/layout/svg/nsSVGOuterSVGFrame.cpp @@ -384,7 +384,7 @@ nsSVGOuterSVGFrame::Reflow(nsPresContext* aPresContext, SVGSVGElement *svgElem = static_cast(mContent); nsSVGOuterSVGAnonChildFrame *anonKid = - static_cast(GetFirstPrincipalChild()); + static_cast(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( - 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(GetFirstPrincipalChild()); + static_cast(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(GetFirstPrincipalChild()); + static_cast(PrincipalChildList().FirstChild()); return anonKid->GetBBoxContribution(aToBBoxUserspace, aFlags); } diff --git a/layout/svg/nsSVGOuterSVGFrame.h b/layout/svg/nsSVGOuterSVGFrame.h index a132885e95c..eadcf3dc3a7 100644 --- a/layout/svg/nsSVGOuterSVGFrame.h +++ b/layout/svg/nsSVGOuterSVGFrame.h @@ -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: diff --git a/layout/svg/nsSVGUtils.cpp b/layout/svg/nsSVGUtils.cpp index c4d6612a9e1..9dafa81fc18 100644 --- a/layout/svg/nsSVGUtils.cpp +++ b/layout/svg/nsSVGUtils.cpp @@ -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); diff --git a/layout/tables/nsCellMap.cpp b/layout/tables/nsCellMap.cpp index 66b0167c57f..ebb4868bf3a 100644 --- a/layout/tables/nsCellMap.cpp +++ b/layout/tables/nsCellMap.cpp @@ -1569,7 +1569,7 @@ bool nsCellMap::CellsSpanOut(nsTArray& 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) { diff --git a/layout/tables/nsTableCellFrame.cpp b/layout/tables/nsTableCellFrame.cpp index 8c4ec50d6f9..f0f2bca90b0 100644 --- a/layout/tables/nsTableCellFrame.cpp +++ b/layout/tables/nsTableCellFrame.cpp @@ -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) { diff --git a/layout/tables/nsTableCellFrame.h b/layout/tables/nsTableCellFrame.h index 0ac28e0cf4c..34e367c109e 100644 --- a/layout/tables/nsTableCellFrame.h +++ b/layout/tables/nsTableCellFrame.h @@ -94,7 +94,7 @@ public: #endif virtual nsContainerFrame* GetContentInsertionFrame() override { - return GetFirstPrincipalChild()->GetContentInsertionFrame(); + return PrincipalChildList().FirstChild()->GetContentInsertionFrame(); } virtual nsMargin GetUsedMargin() const override; diff --git a/layout/tables/nsTableColGroupFrame.cpp b/layout/tables/nsTableColGroupFrame.cpp index f5f1827cac8..4cc4618af32 100644 --- a/layout/tables/nsTableColGroupFrame.cpp +++ b/layout/tables/nsTableColGroupFrame.cpp @@ -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()) { diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp index 6fde5f72d27..69420c3d68e 100644 --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -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(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 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(rowFrame)); - nsIFrame* childFrame = cFrame->GetFirstPrincipalChild(); + nsIFrame* childFrame = cFrame->PrincipalChildList().FirstChild(); while (childFrame) { nsTableCellFrame *cellFrame = do_QueryFrame(childFrame); if (cellFrame) { diff --git a/layout/tables/nsTableOuterFrame.h b/layout/tables/nsTableOuterFrame.h index eb0453592ca..3b678222524 100644 --- a/layout/tables/nsTableOuterFrame.h +++ b/layout/tables/nsTableOuterFrame.h @@ -51,7 +51,7 @@ public: nsIFrame* aOldFrame) override; virtual nsContainerFrame* GetContentInsertionFrame() override { - return GetFirstPrincipalChild()->GetContentInsertionFrame(); + return PrincipalChildList().FirstChild()->GetContentInsertionFrame(); } #ifdef ACCESSIBILITY diff --git a/layout/tables/nsTableRowFrame.cpp b/layout/tables/nsTableRowFrame.cpp index bdf2708abce..c159bc93177 100644 --- a/layout/tables/nsTableRowFrame.cpp +++ b/layout/tables/nsTableRowFrame.cpp @@ -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(); diff --git a/layout/tables/nsTableRowGroupFrame.cpp b/layout/tables/nsTableRowGroupFrame.cpp index 1efbb643a75..cb8e1a8e639 100644 --- a/layout/tables/nsTableRowGroupFrame.cpp +++ b/layout/tables/nsTableRowGroupFrame.cpp @@ -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); } diff --git a/layout/xul/BoxObject.cpp b/layout/xul/BoxObject.cpp index 516397cc69f..50d5e0633e5 100644 --- a/layout/xul/BoxObject.cpp +++ b/layout/xul/BoxObject.cpp @@ -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 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) diff --git a/layout/xul/nsBox.cpp b/layout/xul/nsBox.cpp index 9696a4095ab..4d5bbc78950 100644 --- a/layout/xul/nsBox.cpp +++ b/layout/xul/nsBox.cpp @@ -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* diff --git a/layout/xul/nsBoxFrame.cpp b/layout/xul/nsBoxFrame.cpp index 86b6e01bee7..1c488382454 100644 --- a/layout/xul/nsBoxFrame.cpp +++ b/layout/xul/nsBoxFrame.cpp @@ -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(); } diff --git a/layout/xul/nsMenuBarFrame.cpp b/layout/xul/nsMenuBarFrame.cpp index a11961c7544..427cd488a69 100644 --- a/layout/xul/nsMenuBarFrame.cpp +++ b/layout/xul/nsMenuBarFrame.cpp @@ -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(); diff --git a/layout/xul/nsMenuFrame.cpp b/layout/xul/nsMenuFrame.cpp index 859289752e2..a906cda50a9 100644 --- a/layout/xul/nsMenuFrame.cpp +++ b/layout/xul/nsMenuFrame.cpp @@ -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; diff --git a/layout/xul/nsMenuPopupFrame.cpp b/layout/xul/nsMenuPopupFrame.cpp index 80db680d8d8..51cd481d287 100644 --- a/layout/xul/nsMenuPopupFrame.cpp +++ b/layout/xul/nsMenuPopupFrame.cpp @@ -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; diff --git a/layout/xul/nsProgressMeterFrame.cpp b/layout/xul/nsProgressMeterFrame.cpp index 4b84f83cf95..2d46386f677 100644 --- a/layout/xul/nsProgressMeterFrame.cpp +++ b/layout/xul/nsProgressMeterFrame.cpp @@ -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; diff --git a/layout/xul/nsRootBoxFrame.cpp b/layout/xul/nsRootBoxFrame.cpp index c38cf00f4ff..1c0f8cd4f80 100644 --- a/layout/xul/nsRootBoxFrame.cpp +++ b/layout/xul/nsRootBoxFrame.cpp @@ -34,7 +34,7 @@ nsIRootBox::GetRootBox(nsIPresShell* aShell) } if (rootFrame) { - rootFrame = rootFrame->GetFirstPrincipalChild(); + rootFrame = rootFrame->PrincipalChildList().FirstChild(); } nsIRootBox* rootBox = do_QueryFrame(rootFrame); diff --git a/layout/xul/nsScrollbarButtonFrame.cpp b/layout/xul/nsScrollbarButtonFrame.cpp index 88717448675..bc80e0d119c 100644 --- a/layout/xul/nsScrollbarButtonFrame.cpp +++ b/layout/xul/nsScrollbarButtonFrame.cpp @@ -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 diff --git a/layout/xul/nsXULPopupManager.cpp b/layout/xul/nsXULPopupManager.cpp index 4b1610f4579..3f31aeb4d7e 100644 --- a/layout/xul/nsXULPopupManager.cpp +++ b/layout/xul/nsXULPopupManager.cpp @@ -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(); diff --git a/layout/xul/tree/nsTreeBodyFrame.cpp b/layout/xul/tree/nsTreeBodyFrame.cpp index 698cd1702b5..777f3655af1 100644 --- a/layout/xul/tree/nsTreeBodyFrame.cpp +++ b/layout/xul/tree/nsTreeBodyFrame.cpp @@ -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 || diff --git a/layout/xul/tree/nsTreeColumns.cpp b/layout/xul/tree/nsTreeColumns.cpp index ce6b4315d6b..3dbf6adb980 100644 --- a/layout/xul/tree/nsTreeColumns.cpp +++ b/layout/xul/tree/nsTreeColumns.cpp @@ -738,7 +738,7 @@ nsTreeColumns::EnsureColumns() if (!colFrame) return; - colFrame = colFrame->GetFirstPrincipalChild(); + colFrame = colFrame->PrincipalChildList().FirstChild(); if (!colFrame) return; diff --git a/widget/cocoa/nsNativeThemeCocoa.mm b/widget/cocoa/nsNativeThemeCocoa.mm index b2fce8af343..6cc044cb61c 100644 --- a/widget/cocoa/nsNativeThemeCocoa.mm +++ b/widget/cocoa/nsNativeThemeCocoa.mm @@ -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()) { diff --git a/widget/nsNativeTheme.cpp b/widget/nsNativeTheme.cpp index e8502e4c1ea..7eed9d29549 100644 --- a/widget/nsNativeTheme.cpp +++ b/widget/nsNativeTheme.cpp @@ -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;