Skip to content

Commit

Permalink
Bug 1227927 Part 2 - Remove nsIFrame::GetFirstPrincipalChild(). r=mats
Browse files Browse the repository at this point in the history
  • Loading branch information
aethanyc committed Jan 29, 2016
1 parent 0407882 commit 1738f27
Show file tree
Hide file tree
Showing 84 changed files with 231 additions and 235 deletions.
2 changes: 1 addition & 1 deletion accessible/generic/HyperTextAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions dom/base/nsContentUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion dom/base/nsDocumentEncoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion dom/base/nsGlobalWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion dom/base/nsRange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion dom/html/HTMLInputElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion dom/html/nsGenericHTMLElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion dom/html/nsTextEditorState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2168,7 +2168,7 @@ nsTextEditorState::InitializeKeyboardEventListeners()
TrustedEventsAtSystemGroupBubble());
}

mSelCon->SetScrollableFrame(do_QueryFrame(mBoundFrame->GetFirstPrincipalChild()));
mSelCon->SetScrollableFrame(do_QueryFrame(mBoundFrame->PrincipalChildList().FirstChild()));
}

void
Expand Down
8 changes: 4 additions & 4 deletions layout/base/RestyleManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,13 @@ GetFrameForChildrenOnlyTransformHint(nsIFrame *aFrame)
// This happens if the root-<svg> is fixed positioned, in which case we
// can't use aFrame->GetContent() to find the primary frame, since
// GetContent() returns nullptr for ViewportFrame.
aFrame = aFrame->GetFirstPrincipalChild();
aFrame = aFrame->PrincipalChildList().FirstChild();
}
// For an nsHTMLScrollFrame, this will get the SVG frame that has the
// children-only transforms:
aFrame = aFrame->GetContent()->GetPrimaryFrame();
if (aFrame->GetType() == nsGkAtoms::svgOuterSVGFrame) {
aFrame = aFrame->GetFirstPrincipalChild();
aFrame = aFrame->PrincipalChildList().FirstChild();
MOZ_ASSERT(aFrame->GetType() == nsGkAtoms::svgOuterSVGAnonChildFrame,
"Where is the nsSVGOuterSVGFrame's anon child??");
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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");
Expand Down
14 changes: 7 additions & 7 deletions layout/base/nsBidiPresUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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?
}

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
Expand All @@ -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);
}
Expand Down Expand Up @@ -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,
Expand Down
Loading

0 comments on commit 1738f27

Please sign in to comment.