Bug 1277129 Part 7a - Rename ReflowState to RubyReflowInput in nsRubyBaseContainerFrame. draft
authorTing-Yu Lin <tlin@mozilla.com>
Thu, 21 Jul 2016 18:25:33 +0800
changeset 390575 ab2d998f1020a49c0ad23427d1d117397c9d36a0
parent 390574 eb824bcd3baf142187a842ee59179bdc06c0cd88
child 390576 19b72be77095717c8d163bfd71dc62ab5916e9dd
push id23690
push usertlin@mozilla.com
push dateThu, 21 Jul 2016 10:26:03 +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: KUU51Rjn6z
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,