Bug 1277129 Part 7a - Rename ReflowState to RubyReflowInput in nsRubyBaseContainerFrame. draft
authorTing-Yu Lin <tlin@mozilla.com>
Thu, 21 Jul 2016 11:50:15 +0800
changeset 390407 51a05bfc93752a555c7f4163f7ec34e522aeb1bf
parent 390406 077bd3f7933f5f778d348080433e50b5a367f5d8
child 390408 a9dd6ef41cfb9aed9538d970fef5dede543c447c
push id23665
push usertlin@mozilla.com
push dateThu, 21 Jul 2016 03:51:24 +0000
bugs1277129
milestone50.0a1
Bug 1277129 Part 7a - Rename ReflowState to RubyReflowInput in nsRubyBaseContainerFrame. This is a prerequisite for the mass rename variables whose name containing ReflowState in the next patch. Otherwise nsRubyBaseContainerFrame::ReflowInput will conflict with mozilla::ReflowInput. MozReview-Commit-ID: KWL3H0AwrAd
layout/generic/nsRubyBaseContainerFrame.cpp
layout/generic/nsRubyBaseContainerFrame.h
--- a/layout/generic/nsRubyBaseContainerFrame.cpp
+++ b/layout/generic/nsRubyBaseContainerFrame.cpp
@@ -283,17 +283,17 @@ nsRubyBaseContainerFrame::ComputeSize(ns
 }
 
 /* virtual */ nscoord
 nsRubyBaseContainerFrame::GetLogicalBaseline(WritingMode aWritingMode) const
 {
   return mBaseline;
 }
 
-struct nsRubyBaseContainerFrame::ReflowState
+struct nsRubyBaseContainerFrame::RubyReflowInput
 {
   bool mAllowInitialLineBreak;
   bool mAllowLineBreak;
   const AutoRubyTextContainerArray& mTextContainers;
   const ReflowInput& mBaseReflowState;
   const nsTArray<UniquePtr<ReflowInput>>& mTextReflowStates;
 };
 
@@ -379,17 +379,17 @@ nsRubyBaseContainerFrame::Reflow(nsPresC
                                       &mBaseline);
 
   bool allowInitialLineBreak, allowLineBreak;
   GetIsLineBreakAllowed(this, aReflowState.mLineLayout->LineIsBreakable(),
                         &allowInitialLineBreak, &allowLineBreak);
 
   nscoord isize = 0;
   // Reflow columns excluding any span
-  ReflowState reflowState = {
+  RubyReflowInput reflowState = {
     allowInitialLineBreak, allowLineBreak && !hasSpan,
     textContainers, aReflowState, reflowStates
   };
   isize = ReflowColumns(reflowState, aStatus);
   DebugOnly<nscoord> lineSpanSize = aReflowState.mLineLayout->EndSpan(this);
   aDesiredSize.ISize(lineWM) = isize;
   // When there are no frames inside the ruby base container, EndSpan
   // will return 0. However, in this case, the actual width of the
@@ -400,17 +400,17 @@ nsRubyBaseContainerFrame::Reflow(nsPresC
 
   // If there exists any span, the columns must either be completely
   // reflowed, or be not reflowed at all.
   MOZ_ASSERT(NS_INLINE_IS_BREAK_BEFORE(aStatus) ||
              NS_FRAME_IS_COMPLETE(aStatus) || !hasSpan);
   if (!NS_INLINE_IS_BREAK_BEFORE(aStatus) &&
       NS_FRAME_IS_COMPLETE(aStatus) && hasSpan) {
     // Reflow spans
-    ReflowState reflowState = {
+    RubyReflowInput reflowState = {
       false, false, textContainers, aReflowState, reflowStates
     };
     nscoord spanISize = ReflowSpans(reflowState);
     isize = std::max(isize, spanISize);
   }
 
   for (uint32_t i = 0; i < rtcCount; i++) {
     // It happens before the ruby text container is reflowed, and that
@@ -454,17 +454,17 @@ struct MOZ_STACK_CLASS nsRubyBaseContain
   AutoTArray<ContinuationTraversingState, RTC_ARRAY_SIZE> mTexts;
   const AutoRubyTextContainerArray& mTextContainers;
 
   PullFrameState(nsRubyBaseContainerFrame* aBaseContainer,
                  const AutoRubyTextContainerArray& aTextContainers);
 };
 
 nscoord
-nsRubyBaseContainerFrame::ReflowColumns(const ReflowState& aReflowState,
+nsRubyBaseContainerFrame::ReflowColumns(const RubyReflowInput& aReflowState,
                                         nsReflowStatus& aStatus)
 {
   nsLineLayout* lineLayout = aReflowState.mBaseReflowState.mLineLayout;
   const uint32_t rtcCount = aReflowState.mTextContainers.Length();
   nscoord icoord = lineLayout->GetCurrentICoord();
   MOZ_ASSERT(icoord == 0, "border/padding of rbc should have been suppressed");
   nsReflowStatus reflowStatus = NS_FRAME_COMPLETE;
   aStatus = NS_FRAME_COMPLETE;
@@ -563,17 +563,17 @@ nsRubyBaseContainerFrame::ReflowColumns(
     MOZ_ASSERT(e.AtEnd());
     aStatus = NS_INLINE_LINE_BREAK_AFTER(aStatus);
   }
 
   return icoord;
 }
 
 nscoord
-nsRubyBaseContainerFrame::ReflowOneColumn(const ReflowState& aReflowState,
+nsRubyBaseContainerFrame::ReflowOneColumn(const RubyReflowInput& aReflowState,
                                           uint32_t aColumnIndex,
                                           const RubyColumn& aColumn,
                                           nsReflowStatus& aStatus)
 {
   const ReflowInput& baseReflowState = aReflowState.mBaseReflowState;
   const auto& textReflowStates = aReflowState.mTextReflowStates;
   nscoord istart = baseReflowState.mLineLayout->GetCurrentICoord();
 
@@ -803,17 +803,17 @@ nsRubyBaseContainerFrame::PullOneColumn(
 
   if (!aIsComplete) {
     // We pulled frames from the next line, hence mark it dirty.
     aLineLayout->SetDirtyNextLine();
   }
 }
 
 nscoord
-nsRubyBaseContainerFrame::ReflowSpans(const ReflowState& aReflowState)
+nsRubyBaseContainerFrame::ReflowSpans(const RubyReflowInput& aReflowState)
 {
   nscoord spanISize = 0;
   for (uint32_t i = 0, iend = aReflowState.mTextContainers.Length();
        i < iend; i++) {
     nsRubyTextContainerFrame* container = aReflowState.mTextContainers[i];
     if (!container->IsSpanContainer()) {
       continue;
     }
--- a/layout/generic/nsRubyBaseContainerFrame.h
+++ b/layout/generic/nsRubyBaseContainerFrame.h
@@ -59,24 +59,24 @@ public:
 #endif
 
 protected:
   friend nsContainerFrame*
     NS_NewRubyBaseContainerFrame(nsIPresShell* aPresShell,
                                  nsStyleContext* aContext);
   explicit nsRubyBaseContainerFrame(nsStyleContext* aContext) : nsContainerFrame(aContext) {}
 
-  struct ReflowState;
-  nscoord ReflowColumns(const ReflowState& aReflowState,
+  struct RubyReflowInput;
+  nscoord ReflowColumns(const RubyReflowInput& aReflowState,
                         nsReflowStatus& aStatus);
-  nscoord ReflowOneColumn(const ReflowState& aReflowState,
+  nscoord ReflowOneColumn(const RubyReflowInput& aReflowState,
                           uint32_t aColumnIndex,
                           const mozilla::RubyColumn& aColumn,
                           nsReflowStatus& aStatus);
-  nscoord ReflowSpans(const ReflowState& aReflowState);
+  nscoord ReflowSpans(const RubyReflowInput& aReflowState);
 
   struct PullFrameState;
 
   // Pull ruby base and corresponding ruby text frames from
   // continuations after them.
   void PullOneColumn(nsLineLayout* aLineLayout,
                      PullFrameState& aPullFrameState,
                      mozilla::RubyColumn& aColumn,