Bug 1286468 - Rename line related functions in nsBlockFrame. draft
authorJeremy Chen <jeremychen@mozilla.com>
Sat, 22 Oct 2016 19:41:05 +0800
changeset 428301 ce71c4c69112c8f228e9cf1d5fbfe8d0fa57522c
parent 428300 1ffe282dbc243234c5e0fdf31ee313ee728689b3
child 428302 9986eff3fd82a771d5c487c8ba9d79da6ce93046
push id33281
push userjichen@mozilla.com
push dateSat, 22 Oct 2016 11:42:29 +0000
bugs1286468
milestone52.0a1
Bug 1286468 - Rename line related functions in nsBlockFrame. 1. Rename these functions to agree with Mozilla coding style. 2. Use singular naming instead of plural naming since each of these functions returns an iterator pointing to a singular line. 3. Rename line() and rline() to BeginLineFrom() and RBeginLineFrom(), which shall improve the readability. MozReview-Commit-ID: txZjVnv9Yb
layout/base/nsBidiPresUtils.cpp
layout/base/nsLayoutUtils.cpp
layout/generic/BlockReflowInput.cpp
layout/generic/nsBlockFrame.cpp
layout/generic/nsBlockFrame.h
layout/generic/nsBlockReflowContext.cpp
layout/generic/nsFrame.cpp
layout/generic/nsTextFrame.cpp
layout/svg/SVGTextFrame.cpp
--- a/layout/base/nsBidiPresUtils.cpp
+++ b/layout/base/nsBidiPresUtils.cpp
@@ -687,17 +687,17 @@ nsBidiPresUtils::Resolve(nsBlockFrame* a
   // via using nsIFrame::GetWritingMode(nsIFrame*).
   char16_t ch = GetBidiOverride(aBlockFrame->StyleContext());
   if (ch != 0) {
     bpd.PushBidiControl(ch);
   }
   for (nsBlockFrame* block = aBlockFrame; block;
        block = static_cast<nsBlockFrame*>(block->GetNextContinuation())) {
     block->RemoveStateBits(NS_BLOCK_NEEDS_BIDI_RESOLUTION);
-    nsBlockInFlowLineIterator lineIter(block, block->begin_lines());
+    nsBlockInFlowLineIterator lineIter(block, block->BeginLine());
     bpd.mPrevFrame = nullptr;
     TraverseFrames(aBlockFrame, &lineIter, block->PrincipalChildList().FirstChild(), &bpd);
     // XXX what about overflow lines?
   }
 
   if (ch != 0) {
     bpd.PopBidiControl(ch);
   }
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -6212,18 +6212,18 @@ nsLayoutUtils::GetFirstLinePosition(Writ
       }
       return false;
     }
 
     // No baseline.
     return false;
   }
 
-  for (nsBlockFrame::ConstLineIterator line = block->begin_lines(),
-                                       line_end = block->end_lines();
+  for (nsBlockFrame::ConstLineIterator line = block->BeginLine(),
+                                       line_end = block->EndLine();
        line != line_end; ++line) {
     if (line->IsBlock()) {
       nsIFrame *kid = line->mFirstChild;
       LinePosition kidPosition;
       if (GetFirstLinePosition(aWM, kid, &kidPosition)) {
         //XXX Not sure if this is the correct value to use for container
         //    width here. It will only be used in vertical-rl layout,
         //    which we don't have full support and testing for yet.
@@ -6251,18 +6251,18 @@ nsLayoutUtils::GetFirstLinePosition(Writ
 nsLayoutUtils::GetLastLineBaseline(WritingMode aWM,
                                    const nsIFrame* aFrame, nscoord* aResult)
 {
   const nsBlockFrame* block = nsLayoutUtils::GetAsBlock(const_cast<nsIFrame*>(aFrame));
   if (!block)
     // No baseline.  (We intentionally don't descend into scroll frames.)
     return false;
 
-  for (nsBlockFrame::ConstReverseLineIterator line = block->rbegin_lines(),
-                                              line_end = block->rend_lines();
+  for (nsBlockFrame::ConstReverseLineIterator line = block->RBeginLine(),
+                                              line_end = block->REndLine();
        line != line_end; ++line) {
     if (line->IsBlock()) {
       nsIFrame *kid = line->mFirstChild;
       nscoord kidBaseline;
       const nsSize& containerSize = line->mContainerSize;
       if (GetLastLineBaseline(aWM, kid, &kidBaseline)) {
         // Ignore relative positioning for baseline calculations
         *aResult = kidBaseline +
@@ -6289,18 +6289,18 @@ nsLayoutUtils::GetLastLineBaseline(Writi
 
 static nscoord
 CalculateBlockContentBEnd(WritingMode aWM, nsBlockFrame* aFrame)
 {
   NS_PRECONDITION(aFrame, "null ptr");
 
   nscoord contentBEnd = 0;
 
-  for (nsBlockFrame::LineIterator line = aFrame->begin_lines(),
-                                  line_end = aFrame->end_lines();
+  for (nsBlockFrame::LineIterator line = aFrame->BeginLine(),
+                                  line_end = aFrame->EndLine();
        line != line_end; ++line) {
     if (line->IsBlock()) {
       nsIFrame* child = line->mFirstChild;
       const nsSize& containerSize = line->mContainerSize;
       nscoord offset =
         child->GetLogicalNormalPosition(aWM, containerSize).B(aWM);
       contentBEnd =
         std::max(contentBEnd,
--- a/layout/generic/BlockReflowInput.cpp
+++ b/layout/generic/BlockReflowInput.cpp
@@ -135,17 +135,17 @@ BlockReflowInput::BlockReflowInput(const
     // a constrained height.
     mFlags.mHasUnconstrainedBSize = true;
     mContentArea.BSize(wm) = mBEndEdge = NS_UNCONSTRAINEDSIZE;
   }
   mContentArea.IStart(wm) = mBorderPadding.IStart(wm);
   mBCoord = mContentArea.BStart(wm) = mBorderPadding.BStart(wm);
 
   mPrevChild = nullptr;
-  mCurrentLine = aFrame->end_lines();
+  mCurrentLine = aFrame->EndLine();
 
   mMinLineHeight = aReflowInput.CalcLineHeight();
 }
 
 nscoord
 BlockReflowInput::GetConsumedBSize()
 {
   if (mConsumedBSize == NS_INTRINSICSIZE) {
@@ -411,17 +411,17 @@ BlockReflowInput::GetFloatAvailableSpace
  * margins of blocks collapse).
  */
 void
 BlockReflowInput::ReconstructMarginBefore(nsLineList::iterator aLine)
 {
   mPrevBEndMargin.Zero();
   nsBlockFrame *block = mBlock;
 
-  nsLineList::iterator firstLine = block->begin_lines();
+  nsLineList::iterator firstLine = block->BeginLine();
   for (;;) {
     --aLine;
     if (aLine->IsBlock()) {
       mPrevBEndMargin = aLine->GetCarriedOutBEndMargin();
       break;
     }
     if (!aLine->IsEmpty()) {
       break;
@@ -564,17 +564,17 @@ BlockReflowInput::RecoverStateFrom(nsLin
 // float as well unless it won't fit next to what we already have.
 // But nobody else implements it that way...
 bool
 BlockReflowInput::AddFloat(nsLineLayout*       aLineLayout,
                              nsIFrame*           aFloat,
                              nscoord             aAvailableISize)
 {
   NS_PRECONDITION(aLineLayout, "must have line layout");
-  NS_PRECONDITION(mBlock->end_lines() != mCurrentLine, "null ptr");
+  NS_PRECONDITION(mBlock->EndLine() != mCurrentLine, "null ptr");
   NS_PRECONDITION(aFloat->GetStateBits() & NS_FRAME_OUT_OF_FLOW,
                   "aFloat must be an out-of-flow frame");
 
   MOZ_ASSERT(aFloat->GetParent(), "float must have parent");
   MOZ_ASSERT(aFloat->GetParent()->IsFrameOfType(nsIFrame::eBlockFrame),
              "float's parent must be block");
   MOZ_ASSERT(aFloat->GetParent() == mBlock ||
              (aFloat->GetStateBits() & NS_FRAME_IS_PUSHED_FLOAT),
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -68,18 +68,18 @@ static const char16_t kDiscCharacter = 0
 using namespace mozilla;
 using namespace mozilla::css;
 using namespace mozilla::dom;
 using namespace mozilla::layout;
 typedef nsAbsoluteContainingBlock::AbsPosReflowFlags AbsPosReflowFlags;
 
 static void MarkAllDescendantLinesDirty(nsBlockFrame* aBlock)
 {
-  nsLineList::iterator line = aBlock->begin_lines();
-  nsLineList::iterator endLine = aBlock->end_lines();
+  nsLineList::iterator line = aBlock->BeginLine();
+  nsLineList::iterator endLine = aBlock->EndLine();
   while (line != endLine) {
     if (line->IsBlock()) {
       nsIFrame* f = line->mFirstChild;
       nsBlockFrame* bf = nsLayoutUtils::GetAsBlock(f);
       if (bf) {
         MarkAllDescendantLinesDirty(bf);
       }
     }
@@ -112,18 +112,18 @@ static void MarkSameFloatManagerLinesDir
 static bool BlockHasAnyFloats(nsIFrame* aFrame)
 {
   nsBlockFrame* block = nsLayoutUtils::GetAsBlock(aFrame);
   if (!block)
     return false;
   if (block->GetChildList(nsIFrame::kFloatList).FirstChild())
     return true;
     
-  nsLineList::iterator line = block->begin_lines();
-  nsLineList::iterator endLine = block->end_lines();
+  nsLineList::iterator line = block->BeginLine();
+  nsLineList::iterator endLine = block->EndLine();
   while (line != endLine) {
     if (line->IsBlock() && BlockHasAnyFloats(line->mFirstChild))
       return true;
     ++line;
   }
   return false;
 }
 
@@ -392,17 +392,17 @@ nsBlockFrame::List(FILE* out, const char
 
   fprintf_stderr(out, "%s<\n", str.get());
 
   nsCString pfx(aPrefix);
   pfx += "  ";
 
   // Output the lines
   if (!mLines.empty()) {
-    ConstLineIterator line = begin_lines(), line_end = end_lines();
+    ConstLineIterator line = BeginLine(), line_end = EndLine();
     for ( ; line != line_end; ++line) {
       line->List(out, pfx.get(), aFlags);
     }
   }
 
   // Output the overflow lines.
   const FrameLines* overflowLines = GetOverflowLines();
   if (overflowLines && !overflowLines->mLines.empty()) {
@@ -499,17 +499,17 @@ nsBlockFrame::GetLogicalBaseline(Writing
 
 nscoord
 nsBlockFrame::GetCaretBaseline() const
 {
   nsRect contentRect = GetContentRect();
   nsMargin bp = GetUsedBorderAndPadding();
 
   if (!mLines.empty()) {
-    ConstLineIterator line = begin_lines();
+    ConstLineIterator line = BeginLine();
     const nsLineBox* firstLine = line;
     if (firstLine->GetChildCount()) {
       return bp.top + firstLine->mFirstChild->GetCaretBaseline();
     }
   }
   float inflation = nsLayoutUtils::FontSizeInflationFor(this);
   RefPtr<nsFontMetrics> fm =
     nsLayoutUtils::GetFontMetricsForFrame(this, inflation);
@@ -699,17 +699,17 @@ nsBlockFrame::GetMinISize(nsRenderingCon
   if (RenumberList()) {
     AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
   }
   if (GetStateBits() & NS_BLOCK_NEEDS_BIDI_RESOLUTION)
     ResolveBidi();
   InlineMinISizeData data;
   for (nsBlockFrame* curFrame = this; curFrame;
        curFrame = static_cast<nsBlockFrame*>(curFrame->GetNextContinuation())) {
-    for (LineIterator line = curFrame->begin_lines(), line_end = curFrame->end_lines();
+    for (LineIterator line = curFrame->BeginLine(), line_end = curFrame->EndLine();
       line != line_end; ++line)
     {
 #ifdef DEBUG
       if (gNoisyIntrinsic) {
         IndentBy(stdout, gNoiseIndent);
         printf("line (%s%s)\n",
                line->IsBlock() ? "block" : "inline",
                line->IsEmpty() ? ", empty" : "");
@@ -718,17 +718,17 @@ nsBlockFrame::GetMinISize(nsRenderingCon
 #endif
       if (line->IsBlock()) {
         data.ForceBreak();
         data.mCurrentLine = nsLayoutUtils::IntrinsicForContainer(aRenderingContext,
                         line->mFirstChild, nsLayoutUtils::MIN_ISIZE);
         data.ForceBreak();
       } else {
         if (!curFrame->GetPrevContinuation() &&
-            line == curFrame->begin_lines()) {
+            line == curFrame->BeginLine()) {
           // Only add text-indent if it has no percentages; using a
           // percentage basis of 0 unconditionally would give strange
           // behavior for calc(10%-3px).
           const nsStyleCoord &indent = StyleText()->mTextIndent;
           if (indent.ConvertsToLength())
             data.mCurrentLine += nsRuleNode::ComputeCoordPercentCalc(indent, 0);
         }
         // XXX Bug NNNNNN Should probably handle percentage text-indent.
@@ -787,17 +787,17 @@ nsBlockFrame::GetPrefISize(nsRenderingCo
   if (RenumberList()) {
     AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
   }
   if (GetStateBits() & NS_BLOCK_NEEDS_BIDI_RESOLUTION)
     ResolveBidi();
   InlinePrefISizeData data;
   for (nsBlockFrame* curFrame = this; curFrame;
        curFrame = static_cast<nsBlockFrame*>(curFrame->GetNextContinuation())) {
-    for (LineIterator line = curFrame->begin_lines(), line_end = curFrame->end_lines();
+    for (LineIterator line = curFrame->BeginLine(), line_end = curFrame->EndLine();
          line != line_end; ++line)
     {
 #ifdef DEBUG
       if (gNoisyIntrinsic) {
         IndentBy(stdout, gNoiseIndent);
         printf("line (%s%s)\n",
                line->IsBlock() ? "block" : "inline",
                line->IsEmpty() ? ", empty" : "");
@@ -808,17 +808,17 @@ nsBlockFrame::GetPrefISize(nsRenderingCo
         if (!data.mLineIsEmpty || BlockCanIntersectFloats(line->mFirstChild)) {
           data.ForceBreak();
         }
         data.mCurrentLine = nsLayoutUtils::IntrinsicForContainer(aRenderingContext,
                         line->mFirstChild, nsLayoutUtils::PREF_ISIZE);
         data.ForceBreak();
       } else {
         if (!curFrame->GetPrevContinuation() &&
-            line == curFrame->begin_lines()) {
+            line == curFrame->BeginLine()) {
           // Only add text-indent if it has no percentages; using a
           // percentage basis of 0 unconditionally would give strange
           // behavior for calc(10%-3px).
           const nsStyleCoord &indent = StyleText()->mTextIndent;
           if (indent.ConvertsToLength()) {
             nscoord length = indent.ToLength();
             if (length != 0) {
               data.mCurrentLine += length;
@@ -873,30 +873,30 @@ nsBlockFrame::GetPrefWidthTightBounds(ns
 
   *aX = 0;
   *aXMost = 0;
 
   nsresult rv;
   InlinePrefISizeData data;
   for (nsBlockFrame* curFrame = this; curFrame;
        curFrame = static_cast<nsBlockFrame*>(curFrame->GetNextContinuation())) {
-    for (LineIterator line = curFrame->begin_lines(), line_end = curFrame->end_lines();
+    for (LineIterator line = curFrame->BeginLine(), line_end = curFrame->EndLine();
          line != line_end; ++line)
     {
       nscoord childX, childXMost;
       if (line->IsBlock()) {
         data.ForceBreak();
         rv = line->mFirstChild->GetPrefWidthTightBounds(aRenderingContext,
                                                         &childX, &childXMost);
         NS_ENSURE_SUCCESS(rv, rv);
         *aX = std::min(*aX, childX);
         *aXMost = std::max(*aXMost, childXMost);
       } else {
         if (!curFrame->GetPrevContinuation() &&
-            line == curFrame->begin_lines()) {
+            line == curFrame->BeginLine()) {
           // Only add text-indent if it has no percentages; using a
           // percentage basis of 0 unconditionally would give strange
           // behavior for calc(10%-3px).
           const nsStyleCoord &indent = StyleText()->mTextIndent;
           if (indent.ConvertsToLength()) {
             data.mCurrentLine += nsRuleNode::ComputeCoordPercentCalc(indent, 0);
           }
         }
@@ -1308,17 +1308,17 @@ nsBlockFrame::Reflow(nsPresContext*     
   // logical direction progresses in a negative physical direction, and
   // therefore block-dir coordinate conversion depends on knowing the width
   // of the coordinate space in order to translate between the logical and
   // physical origins.
   if (wm.IsVerticalRL()) {
     nsSize containerSize = aMetrics.PhysicalSize();
     nscoord deltaX = containerSize.width - state.ContainerSize().width;
     if (deltaX != 0) {
-      for (LineIterator line = begin_lines(), end = end_lines();
+      for (LineIterator line = BeginLine(), end = EndLine();
            line != end; line++) {
         UpdateLineContainerSize(line, containerSize);
       }
       for (nsIFrame* f : mFloats) {
         nsPoint physicalDelta(deltaX, 0);
         f->MovePositionBy(physicalDelta);
       }
       nsFrameList* bulletList = GetOutsideBulletList();
@@ -1479,18 +1479,18 @@ nsBlockFrame::Reflow(nsPresContext*     
 #endif
 
   NS_FRAME_SET_TRUNCATION(aStatus, (*reflowInput), aMetrics);
 }
 
 bool
 nsBlockFrame::CheckForCollapsedBEndMarginFromClearanceLine()
 {
-  LineIterator begin = begin_lines();
-  LineIterator line = end_lines();
+  LineIterator begin = BeginLine();
+  LineIterator line = EndLine();
 
   while (true) {
     if (begin == line) {
       return false;
     }
     --line;
     if (line->BSize() != 0 || !line->CachedIsEmpty()) {
       return false;
@@ -1714,17 +1714,17 @@ nsBlockFrame::ComputeOverflowAreas(const
                                    nscoord               aBEndEdgeOfChildren,
                                    nsOverflowAreas&      aOverflowAreas)
 {
   // Compute the overflow areas of our children
   // XXX_perf: This can be done incrementally.  It is currently one of
   // the things that makes incremental reflow O(N^2).
   nsOverflowAreas areas(aBounds, aBounds);
   if (!ShouldApplyOverflowClipping(this, aDisplay)) {
-    for (LineIterator line = begin_lines(), line_end = end_lines();
+    for (LineIterator line = BeginLine(), line_end = EndLine();
          line != line_end;
          ++line) {
       areas.UnionWith(line->GetOverflowAreas());
     }
 
     // Factor an outside bullet in; normally the bullet will be factored into
     // the line-box's overflow areas. However, if the line is a block
     // line then it won't; if there are no lines, it won't. So just
@@ -1752,17 +1752,17 @@ nsBlockFrame::ComputeOverflowAreas(const
 
 void
 nsBlockFrame::UnionChildOverflow(nsOverflowAreas& aOverflowAreas)
 {
   // We need to update the overflow areas of lines manually, as they
   // get cached and re-used otherwise. Lines aren't exposed as normal
   // frame children, so calling UnionChildOverflow alone will end up
   // using the old cached values.
-  for (LineIterator line = begin_lines(), line_end = end_lines();
+  for (LineIterator line = BeginLine(), line_end = EndLine();
        line != line_end;
        ++line) {
     nsRect bounds = line->GetPhysicalBounds();
     nsOverflowAreas lineAreas(bounds, bounds);
 
     int32_t n = line->GetChildCount();
     for (nsIFrame* lineFrame = line->mFirstChild;
          n > 0; lineFrame = lineFrame->GetNextSibling(), --n) {
@@ -1802,17 +1802,17 @@ nsBlockFrame::ComputeCustomOverflow(nsOv
   ClearLineCursor();
   return nsContainerFrame::ComputeCustomOverflow(aOverflowAreas);
 }
 
 void
 nsBlockFrame::LazyMarkLinesDirty()
 {
   if (GetStateBits() & NS_BLOCK_LOOK_FOR_DIRTY_FRAMES) {
-    for (LineIterator line = begin_lines(), line_end = end_lines();
+    for (LineIterator line = BeginLine(), line_end = EndLine();
          line != line_end; ++line) {
       int32_t n = line->GetChildCount();
       for (nsIFrame* lineFrame = line->mFirstChild;
            n > 0; lineFrame = lineFrame->GetNextSibling(), --n) {
         if (NS_SUBTREE_DIRTY(lineFrame)) {
           // NOTE:  MarkLineDirty does more than just marking the line dirty.
           MarkLineDirty(line, &mLines);
           break;
@@ -1909,17 +1909,17 @@ nsBlockFrame::PrepareResizeReflow(BlockR
 #ifdef DEBUG
     if (gNoisyReflow) {
       IndentBy(stdout, gNoiseIndent);
       ListTag(stdout);
       printf(": trying to avoid marking all lines dirty\n");
     }
 #endif
 
-    for (LineIterator line = begin_lines(), line_end = end_lines();
+    for (LineIterator line = BeginLine(), line_end = EndLine();
          line != line_end;
          ++line)
     {
       // We let child blocks make their own decisions the same
       // way we are here.
       bool isLastLine = line == mLines.back() && !GetNextInFlow();
       if (line->IsBlock() ||
           line->HasFloats() ||
@@ -1937,31 +1937,31 @@ nsBlockFrame::PrepareResizeReflow(BlockR
                line.get(), line->IsImpactedByFloat() ? "" : "not ");
       }
 #endif
 #ifdef DEBUG
       if (gNoisyReflow && !line->IsDirty()) {
         IndentBy(stdout, gNoiseIndent + 1);
         printf("skipped: line=%p next=%p %s %s%s%s breakTypeBefore/After=%s/%s xmost=%d\n",
            static_cast<void*>(line.get()),
-           static_cast<void*>((line.next() != end_lines() ? line.next().get() : nullptr)),
+           static_cast<void*>((line.next() != EndLine() ? line.next().get() : nullptr)),
            line->IsBlock() ? "block" : "inline",
            line->HasBreakAfter() ? "has-break-after " : "",
            line->HasFloats() ? "has-floats " : "",
            line->IsImpactedByFloat() ? "impacted " : "",
            line->BreakTypeToString(line->GetBreakTypeBefore()),
            line->BreakTypeToString(line->GetBreakTypeAfter()),
            line->IEnd());
       }
 #endif
     }
   }
   else {
     // Mark everything dirty
-    for (LineIterator line = begin_lines(), line_end = end_lines();
+    for (LineIterator line = BeginLine(), line_end = EndLine();
          line != line_end;
          ++line)
     {
       line->MarkDirty();
     }
   }
 }
 
@@ -2119,18 +2119,18 @@ nsBlockFrame::ReflowDirtyLines(BlockRefl
                      (aState.mReflowInput.IsBResize() &&
                       (GetStateBits() & NS_FRAME_CONTAINS_RELATIVE_BSIZE));
 
   // Reflow our last line if our availableBSize has increased
   // so that we (and our last child) pull up content as necessary
   if (aState.mReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE
       && GetNextInFlow() && aState.mReflowInput.AvailableBSize() >
         GetLogicalSize().BSize(aState.mReflowInput.GetWritingMode())) {
-    LineIterator lastLine = end_lines();
-    if (lastLine != begin_lines()) {
+    LineIterator lastLine = EndLine();
+    if (lastLine != BeginLine()) {
       --lastLine;
       lastLine->MarkDirty();
     }
   }
     // the amount by which we will slide the current line if it is not
     // dirty
   nscoord deltaBCoord = 0;
 
@@ -2140,17 +2140,17 @@ nsBlockFrame::ReflowDirtyLines(BlockRefl
   bool needToRecoverState = false;
     // Float continuations were reflowed in ReflowPushedFloats
   bool reflowedFloat = mFloats.NotEmpty() &&
     (mFloats.FirstChild()->GetStateBits() & NS_FRAME_IS_PUSHED_FLOAT);
   bool lastLineMovedUp = false;
   // We save up information about BR-clearance here
   StyleClear inlineFloatBreakType = aState.mFloatBreakType;
 
-  LineIterator line = begin_lines(), line_end = end_lines();
+  LineIterator line = BeginLine(), line_end = EndLine();
 
   // Reflow the lines that are already ours
   for ( ; line != line_end; ++line, aState.AdvanceToNextLine()) {
     DumpLine(aState, line, deltaBCoord, 0);
 #ifdef DEBUG
     AutoNoisyIndenter indent2(gNoisyReflow);
 #endif
 
@@ -2358,17 +2358,17 @@ nsBlockFrame::ReflowDirtyLines(BlockRefl
       // block was and is adjacent to the block-start and empty).
       //
       // If the line is empty now, we can't reliably tell if the line was empty
       // before, so we just assume it was and do nextLine->MarkPreviousMarginDirty.
       // This means the checks in 4) are redundant; if the line is empty now
       // we don't need to check 4), but if the line is not empty now and we're sure
       // it wasn't empty before, any adjacency and clearance changes are irrelevant
       // to the result of nextLine->ShouldApplyBStartMargin.
-      if (line.next() != end_lines()) {
+      if (line.next() != EndLine()) {
         bool maybeWasEmpty = oldB == line.next()->BStart();
         bool isEmpty = line->CachedIsEmpty();
         if (maybeReflowingForFirstTime /*1*/ ||
             (isEmpty || maybeWasEmpty) /*2/3/4*/) {
           line.next()->MarkPreviousMarginDirty();
           // since it's marked dirty, nobody will care about |deltaBCoord|
         }
       }
@@ -2504,18 +2504,18 @@ nsBlockFrame::ReflowDirtyLines(BlockRefl
        !lastLineMovedUp && 
        !(GetStateBits() & NS_FRAME_IS_DIRTY) &&
        !reflowedFloat)) {
     // We'll place lineIter at the last line of this block, so that 
     // nsBlockInFlowLineIterator::Next() will take us to the first
     // line of my next-in-flow-chain.  (But first, check that I 
     // have any lines -- if I don't, just bail out of this
     // optimization.) 
-    LineIterator lineIter = this->end_lines();
-    if (lineIter != this->begin_lines()) {
+    LineIterator lineIter = this->EndLine();
+    if (lineIter != this->BeginLine()) {
       lineIter--; // I have lines; step back from dummy iterator to last line.
       nsBlockInFlowLineIterator bifLineIter(this, lineIter);
 
       // Check for next-in-flow-chain's first line.
       // (First, see if there is such a line, and second, see if it's clean)
       if (!bifLineIter.Next() ||                
           !bifLineIter.GetLine()->IsDirty()) {
         skipPull=true;
@@ -2576,17 +2576,17 @@ nsBlockFrame::ReflowDirtyLines(BlockRefl
       NS_ASSERTION(aState.mPrevChild || mLines.empty(), "should have a prevchild here");
       NS_ASSERTION(aState.mPrevChild == mFrames.LastChild(),
                    "Incorrect aState.mPrevChild before inserting line at end");
 
       // Shift pulledLine's frames into our mFrames list.
       mFrames.AppendFrames(nullptr, pulledFrames);
 
       // Add line to our line list, and set its last child as our new prev-child
-      line = mLines.before_insert(end_lines(), pulledLine);
+      line = mLines.before_insert(EndLine(), pulledLine);
       aState.mPrevChild = mFrames.LastChild();
 
       // Reparent floats whose placeholders are in the line.
       ReparentFloats(pulledLine->mFirstChild, nextInFlow, true);
 
       DumpLine(aState, pulledLine, deltaBCoord, 0);
 #ifdef DEBUG
       AutoNoisyIndenter indent2(gNoisyReflow);
@@ -2594,17 +2594,17 @@ nsBlockFrame::ReflowDirtyLines(BlockRefl
 
       if (aState.mPresContext->HasPendingInterrupt()) {
         MarkLineDirtyForInterrupt(line);
       } else {
         // Now reflow it and any lines that it makes during it's reflow
         // (we have to loop here because reflowing the line may cause a new
         // line to be created; see SplitLine's callers for examples of
         // when this happens).
-        while (line != end_lines()) {
+        while (line != EndLine()) {
           ReflowLine(aState, line, &keepGoing);
 
           if (aState.mReflowInput.WillReflowAgainForClearance()) {
             line->MarkDirty();
             keepGoing = false;
             NS_FRAME_SET_INCOMPLETE(aState.mReflowStatus);
             break;
           }
@@ -2783,17 +2783,17 @@ nsBlockFrame::ReflowLine(BlockReflowInpu
   }
 }
 
 nsIFrame*
 nsBlockFrame::PullFrame(BlockReflowInput& aState,
                         LineIterator       aLine)
 {
   // First check our remaining lines.
-  if (end_lines() != aLine.next()) {
+  if (EndLine() != aLine.next()) {
     return PullFrameFrom(aLine, this, aLine.next());
   }
 
   NS_ASSERTION(!GetOverflowLines(),
     "Our overflow lines should have been removed at the start of reflow");
 
   // Try each next-in-flow.
   nsBlockFrame* nextInFlow = aState.mNextInFlow;
@@ -3053,17 +3053,17 @@ nsBlockFrame::IsSelfEmpty()
 
 bool
 nsBlockFrame::CachedIsEmpty()
 {
   if (!IsSelfEmpty()) {
     return false;
   }
 
-  for (LineIterator line = begin_lines(), line_end = end_lines();
+  for (LineIterator line = BeginLine(), line_end = EndLine();
        line != line_end;
        ++line)
   {
     if (!line->CachedIsEmpty())
       return false;
   }
 
   return true;
@@ -3071,17 +3071,17 @@ nsBlockFrame::CachedIsEmpty()
 
 bool
 nsBlockFrame::IsEmpty()
 {
   if (!IsSelfEmpty()) {
     return false;
   }
 
-  for (LineIterator line = begin_lines(), line_end = end_lines();
+  for (LineIterator line = BeginLine(), line_end = EndLine();
        line != line_end;
        ++line)
   {
     if (!line->IsEmpty())
       return false;
   }
 
   return true;
@@ -3103,17 +3103,17 @@ nsBlockFrame::ShouldApplyBStartMargin(Bl
     // If we aren't at the start block-coordinate then something of non-zero
     // height must have been placed. Therefore the childs block-start margin
     // applies.
     aState.mFlags.mShouldApplyBStartMargin = true;
     return true;
   }
 
   // Determine if this line is "essentially" the first line
-  LineIterator line = begin_lines();
+  LineIterator line = BeginLine();
   if (aState.mFlags.mHasLineAdjacentToTop) {
     line = aState.mLineAdjacentToTop;
   }
   while (line != aLine) {
     if (!line->CachedIsEmpty() || line->HasClearance()) {
       // A line which precedes aLine is non-empty, or has clearance,
       // so therefore the block-start margin applies.
       aState.mFlags.mShouldApplyBStartMargin = true;
@@ -3556,17 +3556,17 @@ nsBlockFrame::ReflowBlockFrame(BlockRefl
       if (!NS_FRAME_IS_FULLY_COMPLETE(frameReflowStatus) &&
           ShouldAvoidBreakInside(aState.mReflowInput)) {
         *aKeepReflowGoing = false;
       }
 
       if (aLine->SetCarriedOutBEndMargin(collapsedBEndMargin)) {
         LineIterator nextLine = aLine;
         ++nextLine;
-        if (nextLine != end_lines()) {
+        if (nextLine != EndLine()) {
           nextLine->MarkPreviousMarginDirty();
         }
       }
 
       aLine->SetOverflowAreas(overflowAreas);
       if (*aKeepReflowGoing) {
         // Some of the child block fit
         
@@ -3622,18 +3622,18 @@ nsBlockFrame::ReflowBlockFrame(BlockRefl
               // else one of our own overflow lines. In the latter case
               // the line is already marked dirty, so just handle the
               // first case.
               if (!madeContinuation) {
                 nsBlockFrame* nifBlock =
                   nsLayoutUtils::GetAsBlock(nextFrame->GetParent());
                 NS_ASSERTION(nifBlock,
                              "A block's child's next in flow's parent must be a block!");
-                for (LineIterator line = nifBlock->begin_lines(),
-                     line_end = nifBlock->end_lines(); line != line_end; ++line) {
+                for (LineIterator line = nifBlock->BeginLine(),
+                     line_end = nifBlock->EndLine(); line != line_end; ++line) {
                   if (line->Contains(nextFrame)) {
                     line->MarkDirty();
                     break;
                   }
                 }
               }
             }
             *aKeepReflowGoing = false;
@@ -3898,17 +3898,17 @@ nsBlockFrame::DoReflowInlineFrames(Block
   for (i = 0; LineReflowStatus::OK == lineReflowStatus && i < aLine->GetChildCount();
        i++, frame = frame->GetNextSibling()) {
     ReflowInlineFrame(aState, aLineLayout, aLine, frame, &lineReflowStatus);
     if (LineReflowStatus::OK != lineReflowStatus) {
       // It is possible that one or more of next lines are empty
       // (because of DeleteNextInFlowChild). If so, delete them now
       // in case we are finished.
       ++aLine;
-      while ((aLine != end_lines()) && (0 == aLine->GetChildCount())) {
+      while ((aLine != EndLine()) && (0 == aLine->GetChildCount())) {
         // XXX Is this still necessary now that DeleteNextInFlowChild
         // uses DoRemoveFrame?
         nsLineBox *toremove = aLine;
         aLine = mLines.erase(aLine);
         NS_ASSERTION(nullptr == toremove->mFirstChild, "bad empty line");
         FreeLineBox(toremove);
       }
       --aLine;
@@ -4378,32 +4378,32 @@ nsBlockFrame::SplitLine(BlockReflowInput
 #endif
   }
 }
 
 bool
 nsBlockFrame::IsLastLine(BlockReflowInput& aState,
                          LineIterator aLine)
 {
-  while (++aLine != end_lines()) {
+  while (++aLine != EndLine()) {
     // There is another line
     if (0 != aLine->GetChildCount()) {
       // If the next line is a block line then this line is the last in a
       // group of inline lines.
       return aLine->IsBlock();
     }
     // The next line is empty, try the next one
   }
 
   // XXX Not sure about this part
   // Try our next-in-flows lines to answer the question
   nsBlockFrame* nextInFlow = (nsBlockFrame*) GetNextInFlow();
   while (nullptr != nextInFlow) {
-    for (LineIterator line = nextInFlow->begin_lines(),
-                   line_end = nextInFlow->end_lines();
+    for (LineIterator line = nextInFlow->BeginLine(),
+                   line_end = nextInFlow->EndLine();
          line != line_end;
          ++line)
     {
       if (0 != line->GetChildCount())
         return line->IsBlock();
     }
     nextInFlow = (nsBlockFrame*) nextInFlow->GetNextInFlow();
   }
@@ -4630,19 +4630,19 @@ nsBlockFrame::PushLines(BlockReflowInput
 {
   // NOTE: aLineBefore is always a normal line, not an overflow line.
   // The following expression will assert otherwise.
   DebugOnly<bool> check = aLineBefore == mLines.begin();
 
   nsLineList::iterator overBegin(aLineBefore.next());
 
   // PushTruncatedPlaceholderLine sometimes pushes the first line.  Ugh.
-  bool firstLine = overBegin == begin_lines();
-
-  if (overBegin != end_lines()) {
+  bool firstLine = overBegin == BeginLine();
+
+  if (overBegin != EndLine()) {
     // Remove floats in the lines from mFloats
     nsFrameList floats;
     CollectFloats(overBegin->mFirstChild, floats, true);
 
     if (floats.NotEmpty()) {
 #ifdef DEBUG
       for (nsIFrame* f : floats) {
         MOZ_ASSERT(!(f->GetStateBits() & NS_FRAME_IS_PUSHED_FLOAT),
@@ -4673,17 +4673,17 @@ nsBlockFrame::PushLines(BlockReflowInput
         lineBeforeLastFrame = f ? f->GetPrevSibling() : mFrames.LastChild();
         NS_ASSERTION(!f || lineBeforeLastFrame == aLineBefore->LastChild(),
                      "unexpected line frames");
       }
       nsFrameList pushedFrames = mFrames.RemoveFramesAfter(lineBeforeLastFrame);
       overflowLines->mFrames.InsertFrames(nullptr, nullptr, pushedFrames);
 
       overflowLines->mLines.splice(overflowLines->mLines.begin(), mLines,
-                                    overBegin, end_lines());
+                                    overBegin, EndLine());
       NS_ASSERTION(!overflowLines->mLines.empty(), "should not be empty");
       // this takes ownership but it won't delete it immediately so we
       // can keep using it.
       SetOverflowLines(overflowLines);
   
       // Mark all the overflow lines dirty so that they get reflowed when
       // they are pulled up by our next-in-flow.
 
@@ -5347,17 +5347,17 @@ nsBlockFrame::AddFrames(nsFrameList& aFr
 #endif
 }
 
 void
 nsBlockFrame::RemoveFloatFromFloatCache(nsIFrame* aFloat)
 {
   // Find which line contains the float, so we can update
   // the float cache.
-  LineIterator line = begin_lines(), line_end = end_lines();
+  LineIterator line = BeginLine(), line_end = EndLine();
   for ( ; line != line_end; ++line) {
     if (line->IsInline() && line->RemoveFloat(aFloat)) {
       break;
     }
   }
 }
 
 void
@@ -5450,32 +5450,32 @@ nsBlockFrame::TryAllLines(nsLineList::it
   }
 }
 
 nsBlockInFlowLineIterator::nsBlockInFlowLineIterator(nsBlockFrame* aFrame,
     LineIterator aLine)
   : mFrame(aFrame), mLine(aLine), mLineList(&aFrame->mLines)
 {
   // This will assert if aLine isn't in mLines of aFrame:
-  DebugOnly<bool> check = aLine == mFrame->begin_lines();
+  DebugOnly<bool> check = aLine == mFrame->BeginLine();
 }
 
 nsBlockInFlowLineIterator::nsBlockInFlowLineIterator(nsBlockFrame* aFrame,
     LineIterator aLine, bool aInOverflow)
   : mFrame(aFrame), mLine(aLine),
     mLineList(aInOverflow ? &aFrame->GetOverflowLines()->mLines
                           : &aFrame->mLines)
 {
 }
 
 nsBlockInFlowLineIterator::nsBlockInFlowLineIterator(nsBlockFrame* aFrame,
     bool* aFoundValidLine)
   : mFrame(aFrame), mLineList(&aFrame->mLines)
 {
-  mLine = aFrame->begin_lines();
+  mLine = aFrame->BeginLine();
   *aFoundValidLine = FindValidLine();
 }
 
 static nsIFrame*
 FindChildContaining(nsBlockFrame* aFrame, nsIFrame* aFindFrame)
 {
   NS_ASSERTION(aFrame, "must have frame");
   nsIFrame* child;
@@ -5502,25 +5502,25 @@ nsBlockInFlowLineIterator::nsBlockInFlow
   : mFrame(aFrame), mLineList(&aFrame->mLines)
 {
   *aFoundValidLine = false;
 
   nsIFrame* child = FindChildContaining(aFrame, aFindFrame);
   if (!child)
     return;
 
-  LineIterator line_end = aFrame->end_lines();
+  LineIterator line_end = aFrame->EndLine();
   // Try to use the cursor if it exists, otherwise fall back to the first line
   if (nsLineBox* const cursor = aFrame->GetLineCursor()) {
     mLine = line_end;
     // Perform a simultaneous forward and reverse search starting from the
     // line cursor.
-    nsBlockFrame::LineIterator line = aFrame->line(cursor);
-    nsBlockFrame::ReverseLineIterator rline = aFrame->rline(cursor);
-    nsBlockFrame::ReverseLineIterator rline_end = aFrame->rend_lines();
+    nsBlockFrame::LineIterator line = aFrame->BeginLineFrom(cursor);
+    nsBlockFrame::ReverseLineIterator rline = aFrame->RBeginLineFrom(cursor);
+    nsBlockFrame::ReverseLineIterator rline_end = aFrame->REndLine();
     // rline is positioned on the line containing 'cursor', so it's not
     // rline_end. So we can safely increment it (i.e. move it to one line
     // earlier) to start searching there.
     ++rline;
     while (line != line_end || rline != rline_end) {
       if (line != line_end) {
         if (line->Contains(child)) {
           mLine = line;
@@ -5539,17 +5539,17 @@ nsBlockInFlowLineIterator::nsBlockInFlow
     if (mLine != line_end) {
       *aFoundValidLine = true;
       if (mLine != cursor) {
         aFrame->Properties().Set(nsBlockFrame::LineCursorProperty(), mLine);
       }
       return;
     }
   } else {
-    for (mLine = aFrame->begin_lines(); mLine != line_end; ++mLine) {
+    for (mLine = aFrame->BeginLine(); mLine != line_end; ++mLine) {
       if (mLine->Contains(child)) {
         *aFoundValidLine = true;
         return;
       }
     }
   }
   // Didn't find the line
   MOZ_ASSERT(mLine == line_end, "mLine should be line_end at this point");
@@ -6241,18 +6241,18 @@ nsBlockFrame::ReflowFloat(BlockReflowInp
 }
 
 StyleClear
 nsBlockFrame::FindTrailingClear()
 {
   // find the break type of the last line
   for (nsIFrame* b = this; b; b = b->GetPrevInFlow()) {
     nsBlockFrame* block = static_cast<nsBlockFrame*>(b);
-    LineIterator endLine = block->end_lines();
-    if (endLine != block->begin_lines()) {
+    LineIterator endLine = block->EndLine();
+    if (endLine != block->BeginLine()) {
       --endLine;
       return endLine->GetBreakTypeAfter();
     }
   }
   return StyleClear::None;
 }
 
 void
@@ -6345,17 +6345,17 @@ nsBlockFrame::RecoverFloats(nsFloatManag
 
   // Recurse into our overflow container children
   for (nsIFrame* oc = GetChildList(kOverflowContainersList).FirstChild();
        oc; oc = oc->GetNextSibling()) {
     RecoverFloatsFor(oc, aFloatManager, aWM, aContainerSize);
   }
 
   // Recurse into our normal children
-  for (nsBlockFrame::LineIterator line = begin_lines(); line != end_lines(); ++line) {
+  for (nsBlockFrame::LineIterator line = BeginLine(); line != EndLine(); ++line) {
     if (line->IsBlock()) {
       RecoverFloatsFor(line->mFirstChild, aFloatManager, aWM, aContainerSize);
     }
   }
 }
 
 void
 nsBlockFrame::RecoverFloatsFor(nsIFrame*       aFrame,
@@ -6555,17 +6555,17 @@ nsBlockFrame::BuildDisplayList(nsDisplay
   // it might skip lines that contain placeholders but don't themselves
   // intersect with the dirty area.
   // In particular, we really want to check ShouldDescendIntoFrame()
   // on all our child frames, but that might be expensive.  So we
   // approximate it by checking it on |this|; if it's true for any
   // frame in our child list, it's also true for |this|.
   nsLineBox* cursor = aBuilder->ShouldDescendIntoFrame(this) ?
     nullptr : GetFirstLineContaining(aDirtyRect.y);
-  LineIterator line_end = end_lines();
+  LineIterator line_end = EndLine();
   
   if (cursor) {
     for (LineIterator line = mLines.begin(cursor);
          line != line_end;
          ++line) {
       nsRect lineArea = line->GetVisualOverflowArea();
       if (!lineArea.IsEmpty()) {
         // Because we have a cursor, the combinedArea.ys are non-decreasing.
@@ -6577,17 +6577,17 @@ nsBlockFrame::BuildDisplayList(nsDisplay
                     linesDisplayListCollection, this, textOverflow.get());
       }
     }
   } else {
     bool nonDecreasingYs = true;
     int32_t lineCount = 0;
     nscoord lastY = INT32_MIN;
     nscoord lastYMost = INT32_MIN;
-    for (LineIterator line = begin_lines();
+    for (LineIterator line = BeginLine();
          line != line_end;
          ++line) {
       nsRect lineArea = line->GetVisualOverflowArea();
       DisplayLine(aBuilder, lineArea, aDirtyRect, line, depth, drawnLines,
                   linesDisplayListCollection, this, textOverflow.get());
       if (!lineArea.IsEmpty()) {
         if (lineArea.y < lastY
             || lineArea.YMost() < lastYMost) {
@@ -6740,23 +6740,23 @@ nsBlockFrame::ChildIsDirty(nsIFrame* aCh
   // See if the child is absolutely positioned
   if (aChild->GetStateBits() & NS_FRAME_OUT_OF_FLOW &&
       aChild->IsAbsolutelyPositioned()) {
     // do nothing
   } else if (aChild == GetOutsideBullet()) {
     // The bullet lives in the first line, unless the first line has
     // height 0 and there is a second line, in which case it lives
     // in the second line.
-    LineIterator bulletLine = begin_lines();
-    if (bulletLine != end_lines() && bulletLine->BSize() == 0 &&
+    LineIterator bulletLine = BeginLine();
+    if (bulletLine != EndLine() && bulletLine->BSize() == 0 &&
         bulletLine != mLines.back()) {
       bulletLine = bulletLine.next();
     }
     
-    if (bulletLine != end_lines()) {
+    if (bulletLine != EndLine()) {
       MarkLineDirty(bulletLine, &mLines);
     }
     // otherwise we have an empty line list, and ReflowDirtyLines
     // will handle reflowing the bullet.
   } else {
     // Note that we should go through our children to mark lines dirty
     // before the next reflow.  Doing it now could make things O(N^2)
     // since finding the right line is O(N).
@@ -7131,17 +7131,17 @@ nsBlockFrame::CheckFloats(BlockReflowInp
 #ifdef DEBUG
   // If any line is still dirty, that must mean we're going to reflow this
   // block again soon (e.g. because we bailed out after noticing that
   // clearance was imposed), so don't worry if the floats are out of sync.
   bool anyLineDirty = false;
 
   // Check that the float list is what we would have built
   AutoTArray<nsIFrame*, 8> lineFloats;
-  for (LineIterator line = begin_lines(), line_end = end_lines();
+  for (LineIterator line = BeginLine(), line_end = EndLine();
        line != line_end; ++line) {
     if (line->HasFloats()) {
       nsFloatCache* fc = line->GetFirstFloat();
       while (fc) {
         lineFloats.AppendElement(fc->mFloat);
         fc = fc->Next();
       }
     }
@@ -7374,17 +7374,17 @@ nsBlockFrame::VerifyLines(bool aFinalChe
   }
 
   nsLineBox* cursor = GetLineCursor();
 
   // Add up the counts on each line. Also validate that IsFirstLine is
   // set properly.
   int32_t count = 0;
   LineIterator line, line_end;
-  for (line = begin_lines(), line_end = end_lines();
+  for (line = BeginLine(), line_end = EndLine();
        line != line_end;
        ++line) {
     if (line == cursor) {
       cursor = nullptr;
     }
     if (aFinalCheckOK) {
       MOZ_ASSERT(line->GetChildCount(), "empty line");
       if (line->IsBlock()) {
@@ -7399,17 +7399,17 @@ nsBlockFrame::VerifyLines(bool aFinalChe
   nsIFrame* frame = mLines.front()->mFirstChild;
   while (frame) {
     frameCount++;
     frame = frame->GetNextSibling();
   }
   NS_ASSERTION(count == frameCount, "bad line list");
 
   // Next: test that each line has right number of frames on it
-  for (line = begin_lines(), line_end = end_lines();
+  for (line = BeginLine(), line_end = EndLine();
        line != line_end;
         ) {
     count = line->GetChildCount();
     frame = line->mFirstChild;
     while (--count >= 0) {
       frame = frame->GetNextSibling();
     }
     ++line;
@@ -7487,18 +7487,18 @@ nsBlockFrame::VerifyOverflowSituation()
       NS_ASSERTION(overflowLines->mLines.front()->mFirstChild,
                    "bad overflow lines");
       NS_ASSERTION(overflowLines->mLines.front()->mFirstChild ==
                    overflowLines->mFrames.FirstChild(),
                    "bad overflow frames / lines");
     }
     nsLineBox* cursor = flow->GetLineCursor();
     if (cursor) {
-      LineIterator line = flow->begin_lines();
-      LineIterator line_end = flow->end_lines();
+      LineIterator line = flow->BeginLine();
+      LineIterator line_end = flow->EndLine();
       for (; line != line_end && line != cursor; ++line)
         ;
       if (line == line_end && overflowLines) {
         line = overflowLines->mLines.begin();
         line_end = overflowLines->mLines.end();
         for (; line != line_end && line != cursor; ++line)
           ;
         }
--- a/layout/generic/nsBlockFrame.h
+++ b/layout/generic/nsBlockFrame.h
@@ -83,26 +83,26 @@ public:
   NS_DECL_QUERYFRAME_TARGET(nsBlockFrame)
   NS_DECL_FRAMEARENA_HELPERS
 
   typedef nsLineList::iterator LineIterator;
   typedef nsLineList::const_iterator ConstLineIterator;
   typedef nsLineList::reverse_iterator ReverseLineIterator;
   typedef nsLineList::const_reverse_iterator ConstReverseLineIterator;
 
-  LineIterator begin_lines() { return mLines.begin(); }
-  LineIterator end_lines() { return mLines.end(); }
-  ConstLineIterator begin_lines() const { return mLines.begin(); }
-  ConstLineIterator end_lines() const { return mLines.end(); }
-  ReverseLineIterator rbegin_lines() { return mLines.rbegin(); }
-  ReverseLineIterator rend_lines() { return mLines.rend(); }
-  ConstReverseLineIterator rbegin_lines() const { return mLines.rbegin(); }
-  ConstReverseLineIterator rend_lines() const { return mLines.rend(); }
-  LineIterator line(nsLineBox* aList) { return mLines.begin(aList); }
-  ReverseLineIterator rline(nsLineBox* aList) { return mLines.rbegin(aList); }
+  LineIterator BeginLine() { return mLines.begin(); }
+  LineIterator EndLine() { return mLines.end(); }
+  ConstLineIterator BeginLine() const { return mLines.begin(); }
+  ConstLineIterator EndLine() const { return mLines.end(); }
+  ReverseLineIterator RBeginLine() { return mLines.rbegin(); }
+  ReverseLineIterator REndLine() { return mLines.rend(); }
+  ConstReverseLineIterator RBeginLine() const { return mLines.rbegin(); }
+  ConstReverseLineIterator REndLine() const { return mLines.rend(); }
+  LineIterator BeginLineFrom(nsLineBox* aList) { return mLines.begin(aList); }
+  ReverseLineIterator RBeginLineFrom(nsLineBox* aList) { return mLines.rbegin(aList); }
 
   friend nsBlockFrame* NS_NewBlockFrame(nsIPresShell* aPresShell,
                                         nsStyleContext* aContext);
 
   // nsQueryFrame
   NS_DECL_QUERYFRAME
 
   // nsIFrame
@@ -793,17 +793,17 @@ protected:
    * @return the pulled frame or nullptr
    */
   nsIFrame* PullFrameFrom(nsLineBox* aLine,
                           nsBlockFrame* aFromContainer,
                           nsLineList::iterator aFromLine);
 
   /**
    * Push the line after aLineBefore to the overflow line list.
-   * @param aLineBefore a line in 'mLines' (or begin_lines() when
+   * @param aLineBefore a line in 'mLines' (or BeginLine() when
    *        pushing the first line)
    */
   void PushLines(BlockReflowInput& aState,
                  nsLineList::iterator aLineBefore);
 
   void PropagateFloatDamage(BlockReflowInput& aState,
                             nsLineBox* aLine,
                             nscoord aDeltaBCoord);
--- a/layout/generic/nsBlockReflowContext.cpp
+++ b/layout/generic/nsBlockReflowContext.cpp
@@ -109,18 +109,18 @@ nsBlockReflowContext::ComputeCollapsedBS
         nsLineList* lines = frames ? &frames->mLines : nullptr;
         if (!lines) {
           anyLines = false;
         } else {
           line = lines->begin();
           line_end = lines->end();
         }
       } else {
-        line = block->begin_lines();
-        line_end = block->end_lines();
+        line = block->BeginLine();
+        line_end = block->EndLine();
       }
       for (; anyLines && line != line_end; ++line) {
         if (!aClearanceFrame && line->HasClearance()) {
           // If we don't have a clearance frame, then we're computing
           // the collapsed margin in the first pass, assuming that all
           // lines have no clearance. So clear their clearance flags.
           line->ClearHasClearance();
           line->MarkDirty();
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -3978,17 +3978,17 @@ static FrameTarget DrillDownToSelectionF
 static FrameTarget GetSelectionClosestFrameForLine(
                       nsBlockFrame* aParent,
                       nsBlockFrame::LineIterator aLine,
                       nsPoint aPoint,
                       uint32_t aFlags)
 {
   nsIFrame *frame = aLine->mFirstChild;
   // Account for end of lines (any iterator from the block is valid)
-  if (aLine == aParent->end_lines())
+  if (aLine == aParent->EndLine())
     return DrillDownToSelectionFrame(aParent, true, aFlags);
   nsIFrame *closestFromIStart = nullptr, *closestFromIEnd = nullptr;
   nscoord closestIStart = aLine->IStart(), closestIEnd = aLine->IEnd();
   WritingMode wm = aLine->mWritingMode;
   LogicalPoint pt(wm, aPoint, aLine->mContainerSize);
   bool canSkipBr = false;
   for (int32_t n = aLine->GetChildCount(); n;
        --n, frame = frame->GetNextSibling()) {
@@ -4039,18 +4039,18 @@ static FrameTarget GetSelectionClosestFr
                                                     nsPoint aPoint,
                                                     uint32_t aFlags)
 {
   nsBlockFrame* bf = nsLayoutUtils::GetAsBlock(aFrame); // used only for QI
   if (!bf)
     return FrameTarget::Null();
 
   // This code searches for the correct line
-  nsBlockFrame::LineIterator firstLine = bf->begin_lines();
-  nsBlockFrame::LineIterator end = bf->end_lines();
+  nsBlockFrame::LineIterator firstLine = bf->BeginLine();
+  nsBlockFrame::LineIterator end = bf->EndLine();
   if (firstLine == end) {
     nsIContent *blockContent = aFrame->GetContent();
     if (blockContent) {
       // Return with empty flag true.
       return FrameTarget(aFrame, false, false, true);
     }
     return FrameTarget::Null();
   }
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -5088,19 +5088,19 @@ PaintSelectionBackground(DrawTarget& aDr
 static nscoord
 LazyGetLineBaselineOffset(nsIFrame* aChildFrame, nsBlockFrame* aBlockFrame)
 {
   bool offsetFound;
   nscoord offset = aChildFrame->Properties().Get(
     nsIFrame::LineBaselineOffset(), &offsetFound);
 
   if (!offsetFound) {
-    for (nsBlockFrame::LineIterator line = aBlockFrame->begin_lines(),
-        line_end = aBlockFrame->end_lines();
-        line != line_end; line++) {
+    for (nsBlockFrame::LineIterator line = aBlockFrame->BeginLine(),
+                                    line_end = aBlockFrame->EndLine();
+         line != line_end; line++) {
       if (line->IsInline()) {
         int32_t n = line->GetChildCount();
         nscoord lineBaseline = line->BStart() + line->GetLogicalAscent();
         for (nsIFrame* lineFrame = line->mFirstChild;
              n > 0; lineFrame = lineFrame->GetNextSibling(), --n) {
           offset = lineBaseline - lineFrame->GetNormalPosition().y;
           lineFrame->Properties().Set(nsIFrame::LineBaselineOffset(), offset);
         }
--- a/layout/svg/SVGTextFrame.cpp
+++ b/layout/svg/SVGTextFrame.cpp
@@ -4735,20 +4735,20 @@ ShiftAnchoredChunk(nsTArray<mozilla::Cha
 }
 
 void
 SVGTextFrame::AdjustChunksForLineBreaks()
 {
   nsBlockFrame* block = nsLayoutUtils::GetAsBlock(PrincipalChildList().FirstChild());
   NS_ASSERTION(block, "expected block frame");
 
-  nsBlockFrame::LineIterator line = block->begin_lines();
+  nsBlockFrame::LineIterator line = block->BeginLine();
 
   CharIterator it(this, CharIterator::eOriginal);
-  while (!it.AtEnd() && line != block->end_lines()) {
+  while (!it.AtEnd() && line != block->EndLine()) {
     if (it.TextFrame() == line->mFirstChild) {
       mPositions[it.TextElementCharIndex()].mStartOfChunk = true;
       line++;
     }
     it.AdvancePastCurrentFrame();
   }
 }