Bug 864289 - Rename nsLineLayout::GetLineContainer(Frame|RS) to LineContainer\1. r=dholbert
authorCameron McCormack <cam@mcc.id.au>
Tue, 23 Apr 2013 11:45:26 +1000
changeset 129546 32503b49921ea83ea714be7d898126869cc7a5a5
parent 129545 f1f6be722f2a091b6ccd4ae177d5eb7d2d0e139a
child 129547 1d7335eac2a743264cf7472957682ab875b7fa9c
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersdholbert
bugs864289
milestone23.0a1
Bug 864289 - Rename nsLineLayout::GetLineContainer(Frame|RS) to LineContainer\1. r=dholbert
layout/generic/nsFirstLetterFrame.cpp
layout/generic/nsInlineFrame.cpp
layout/generic/nsLineLayout.cpp
layout/generic/nsLineLayout.h
layout/generic/nsTextFrameThebes.cpp
--- a/layout/generic/nsFirstLetterFrame.cpp
+++ b/layout/generic/nsFirstLetterFrame.cpp
@@ -189,17 +189,17 @@ nsFirstLetterFrame::Reflow(nsPresContext
     nsHTMLReflowState rs(aPresContext, aReflowState, kid, availSize);
     nsLineLayout ll(aPresContext, nullptr, &aReflowState, nullptr);
 
     // For unicode-bidi: plaintext, we need to get the direction of the line
     // from the resolved paragraph level of the child, not the block frame,
     // because the block frame could be split by hard line breaks into
     // multiple paragraphs with different base direction
     uint8_t direction;
-    nsIFrame* containerFrame = ll.GetLineContainerFrame();
+    nsIFrame* containerFrame = ll.LineContainerFrame();
     if (containerFrame->StyleTextReset()->mUnicodeBidi &
         NS_STYLE_UNICODE_BIDI_PLAINTEXT) {
       FramePropertyTable *propTable = aPresContext->PropertyTable();
       direction = NS_PTR_TO_INT32(propTable->Get(kid, BaseLevelProperty())) & 1;
     } else {
       direction = containerFrame->StyleVisibility()->mDirection;
     }
     ll.BeginLineReflow(bp.left, bp.top, availSize.width, NS_UNCONSTRAINEDSIZE,
--- a/layout/generic/nsInlineFrame.cpp
+++ b/layout/generic/nsInlineFrame.cpp
@@ -304,17 +304,17 @@ nsInlineFrame::Reflow(nsPresContext*    
     return NS_ERROR_INVALID_ARG;
   }
   if (IsFrameTreeTooDeep(aReflowState, aMetrics, aStatus)) {
     return NS_OK;
   }
 
   bool    lazilySetParentPointer = false;
 
-  nsIFrame* lineContainer = aReflowState.mLineLayout->GetLineContainerFrame();
+  nsIFrame* lineContainer = aReflowState.mLineLayout->LineContainerFrame();
 
    // Check for an overflow list with our prev-in-flow
   nsInlineFrame* prevInFlow = (nsInlineFrame*)GetPrevInFlow();
   if (prevInFlow) {
     AutoFrameListPtr prevOverflowFrames(aPresContext,
                                         prevInFlow->StealOverflowFrames());
     if (prevOverflowFrames) {
       // When pushing and pulling frames we need to check for whether any
@@ -971,17 +971,17 @@ nsFirstLineFrame::Reflow(nsPresContext* 
                          nsHTMLReflowMetrics& aMetrics,
                          const nsHTMLReflowState& aReflowState,
                          nsReflowStatus& aStatus)
 {
   if (nullptr == aReflowState.mLineLayout) {
     return NS_ERROR_INVALID_ARG;
   }
 
-  nsIFrame* lineContainer = aReflowState.mLineLayout->GetLineContainerFrame();
+  nsIFrame* lineContainer = aReflowState.mLineLayout->LineContainerFrame();
 
   // Check for an overflow list with our prev-in-flow
   nsFirstLineFrame* prevInFlow = (nsFirstLineFrame*)GetPrevInFlow();
   if (prevInFlow) {
     AutoFrameListPtr prevOverflowFrames(aPresContext,
                                         prevInFlow->StealOverflowFrames());
     if (prevOverflowFrames) {
       // Assign all floats to our block if necessary
--- a/layout/generic/nsLineLayout.cpp
+++ b/layout/generic/nsLineLayout.cpp
@@ -75,16 +75,17 @@ nsLineLayout::nsLineLayout(nsPresContext
     mNeedBackup(false),
     mInFirstLine(false),
     mGotLineBox(false),
     mInFirstLetter(false),
     mHasBullet(false),
     mDirtyNextLine(false),
     mLineAtStart(false)
 {
+  MOZ_ASSERT(aOuterReflowState, "aOuterReflowState must not be null");
   NS_ASSERTION(aFloatManager || aOuterReflowState->frame->GetType() ==
                                   nsGkAtoms::letterFrame,
                "float manager should be present");
   MOZ_COUNT_CTOR(nsLineLayout);
 
   // Stash away some style data that we need
   mStyleText = aOuterReflowState->frame->StyleText();
   mLineNumber = 0;
@@ -183,34 +184,34 @@ nsLineLayout::BeginLineReflow(nscoord aX
   mCurrentSpan = mRootSpan = psd;
   psd->mReflowState = mBlockReflowState;
   psd->mLeftEdge = aX;
   psd->mX = aX;
   psd->mRightEdge = aX + aWidth;
 
   // If we're in a constrained height frame, then we don't allow a
   // max line box width to take effect.
-  if (!(GetLineContainerFrame()->GetStateBits() &
-      NS_FRAME_IN_CONSTRAINED_HEIGHT)) {
+  if (!(LineContainerFrame()->GetStateBits() &
+        NS_FRAME_IN_CONSTRAINED_HEIGHT)) {
 
     // If the available size is greater than the maximum line box width (if
     // specified), then we need to adjust the line box width to be at the max
     // possible width.
     nscoord maxLineBoxWidth =
-      GetLineContainerFrame()->PresContext()->PresShell()->MaxLineBoxWidth();
+      LineContainerFrame()->PresContext()->PresShell()->MaxLineBoxWidth();
 
     if (maxLineBoxWidth > 0 &&
         psd->mRightEdge - psd->mLeftEdge > maxLineBoxWidth) {
       psd->mRightEdge = psd->mLeftEdge + maxLineBoxWidth;
     }
   }
 
   mTopEdge = aY;
 
-  psd->mNoWrap = !mStyleText->WhiteSpaceCanWrap(GetLineContainerFrame());
+  psd->mNoWrap = !mStyleText->WhiteSpaceCanWrap(LineContainerFrame());
   psd->mDirection = aDirection;
   psd->mChangedFrameDirection = false;
 
   // If this is the first line of a block then see if the text-indent
   // property amounts to anything.
 
   if (0 == mLineNumber && !HasPrevInFlow(mBlockReflowState->frame)) {
     const nsStyleCoord &textIndent = mStyleText->mTextIndent;
--- a/layout/generic/nsLineLayout.h
+++ b/layout/generic/nsLineLayout.h
@@ -287,20 +287,18 @@ public:
     return mForceBreakContent == aContent ? mForceBreakContentOffset : -1;
   }
 
   /**
    * This can't be null. It usually returns a block frame but may return
    * some other kind of frame when inline frames are reflowed in a non-block
    * context (e.g. MathML or floating first-letter).
    */
-  nsIFrame* GetLineContainerFrame() const { return mBlockReflowState->frame; }
-  const nsHTMLReflowState* GetLineContainerRS() const {
-    return mBlockReflowState;
-  }
+  nsIFrame* LineContainerFrame() const { return mBlockReflowState->frame; }
+  const nsHTMLReflowState* LineContainerRS() const { return mBlockReflowState; }
   const nsLineList::iterator* GetLine() const {
     return mGotLineBox ? &mLineBox : nullptr;
   }
   nsLineList::iterator* GetLine() {
     return mGotLineBox ? &mLineBox : nullptr;
   }
   
   /**
--- a/layout/generic/nsTextFrameThebes.cpp
+++ b/layout/generic/nsTextFrameThebes.cpp
@@ -7528,17 +7528,17 @@ nsTextFrame::ReflowText(nsLineLayout& aL
   const nsStyleText* textStyle = StyleText();
 
   bool atStartOfLine = aLineLayout.LineAtStart();
   if (atStartOfLine) {
     AddStateBits(TEXT_START_OF_LINE);
   }
 
   uint32_t flowEndInTextRun;
-  nsIFrame* lineContainer = aLineLayout.GetLineContainerFrame();
+  nsIFrame* lineContainer = aLineLayout.LineContainerFrame();
   gfxContext* ctx = aRenderingContext->ThebesContext();
   const nsTextFragment* frag = mContent->GetText();
 
   // DOM offsets of the text range we need to measure, after trimming
   // whitespace, restricting to first-letter, and restricting preformatted text
   // to nearest newline
   int32_t length = maxContentLength;
   int32_t offset = GetContentOffset();
@@ -7879,17 +7879,17 @@ nsTextFrame::ReflowText(nsLineLayout& aL
   // Handle text that runs outside its normal bounds.
   nsRect boundingBox = RoundOut(textMetrics.mBoundingBox) + nsPoint(0, mAscent);
   aMetrics.SetOverflowAreasToDesiredBounds();
   aMetrics.VisualOverflow().UnionRect(aMetrics.VisualOverflow(), boundingBox);
 
   // When we have text decorations, we don't need to compute their overflow now
   // because we're guaranteed to do it later
   // (see nsLineLayout::RelativePositionFrames)
-  UnionAdditionalOverflow(presContext, *aLineLayout.GetLineContainerRS(),
+  UnionAdditionalOverflow(presContext, *aLineLayout.LineContainerRS(),
                           provider, &aMetrics.VisualOverflow(), false);
 
   /////////////////////////////////////////////////////////////////////
   // Clean up, update state
   /////////////////////////////////////////////////////////////////////
 
   // If all our characters are discarded or collapsed, then trimmable width
   // from the last textframe should be preserved. Otherwise the trimmable width