Bug 1116037 part 4 - Remove useless parameters in ruby reflow methods. r=dbaron
authorXidorn Quan <quanxunzhen@gmail.com>
Mon, 29 Dec 2014 14:46:24 +1100
changeset 247653 5f691b17679e356f928e6cb89564ad1da4920869
parent 247652 422908ee4209f6b6d3d853e095f56d738499adfd
child 247654 8bf00a9544f0303a11d4acaf76e2005448f7d537
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1116037
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1116037 part 4 - Remove useless parameters in ruby reflow methods. r=dbaron
layout/generic/nsRubyBaseContainerFrame.cpp
layout/generic/nsRubyBaseContainerFrame.h
--- a/layout/generic/nsRubyBaseContainerFrame.cpp
+++ b/layout/generic/nsRubyBaseContainerFrame.cpp
@@ -360,29 +360,28 @@ nsRubyBaseContainerFrame::Reflow(nsPresC
         gfxBreakPriority::eNormalBreak)) {
     aStatus = NS_INLINE_LINE_BREAK_BEFORE();
   }
 
   nscoord isize = 0;
   if (aStatus == NS_FRAME_COMPLETE) {
     // Reflow columns excluding any span
     bool allowInternalLineBreak = allowLineBreak && mSpanContainers.IsEmpty();
-    isize = ReflowColumns(aPresContext, allowInternalLineBreak,
+    isize = ReflowColumns(allowInternalLineBreak,
                           aReflowState, rtcReflowStates, aStatus);
   }
 
   // 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) || mSpanContainers.IsEmpty());
   if (!NS_INLINE_IS_BREAK_BEFORE(aStatus) &&
       NS_FRAME_IS_COMPLETE(aStatus) && !mSpanContainers.IsEmpty()) {
     // Reflow spans
-    nscoord spanISize = ReflowSpans(aPresContext, aReflowState,
-                                    spanReflowStates);
+    nscoord spanISize = ReflowSpans(aReflowState, spanReflowStates);
     nscoord deltaISize = spanISize - isize;
     if (deltaISize <= 0) {
       RubyUtils::ClearReservedISize(this);
     } else if (allowLineBreak && ShouldBreakBefore(aReflowState, deltaISize)) {
       aStatus = NS_INLINE_LINE_BREAK_BEFORE();
     } else {
       RubyUtils::SetReservedISize(this, deltaISize);
       aReflowState.mLineLayout->AdvanceICoord(deltaISize);
@@ -444,18 +443,17 @@ struct MOZ_STACK_CLASS nsRubyBaseContain
 {
   ContinuationTraversingState mBase;
   nsAutoTArray<ContinuationTraversingState, RTC_ARRAY_SIZE> mTexts;
 
   explicit PullFrameState(nsRubyBaseContainerFrame* aFrame);
 };
 
 nscoord
-nsRubyBaseContainerFrame::ReflowColumns(nsPresContext* aPresContext,
-                                        bool aAllowLineBreak,
+nsRubyBaseContainerFrame::ReflowColumns(bool aAllowLineBreak,
                                         const nsHTMLReflowState& aReflowState,
                                         nsTArray<nsHTMLReflowState*>& aReflowStates,
                                         nsReflowStatus& aStatus)
 {
   nsLineLayout* lineLayout = aReflowState.mLineLayout;
   const uint32_t rtcCount = mTextContainers.Length();
   nscoord istart = lineLayout->GetCurrentICoord();
   nscoord icoord = istart;
@@ -464,18 +462,17 @@ nsRubyBaseContainerFrame::ReflowColumns(
 
   mColumnCount = 0;
   nsIFrame* baseFrame = nullptr;
   nsAutoTArray<nsIFrame*, RTC_ARRAY_SIZE> textFrames;
   textFrames.SetCapacity(rtcCount);
   RubyColumnEnumerator e(this, mTextContainers);
   for (; !e.AtEnd(); e.Next()) {
     e.GetFrames(baseFrame, textFrames);
-    icoord += ReflowOneColumn(aPresContext, aAllowLineBreak,
-                              aReflowState, aReflowStates,
+    icoord += ReflowOneColumn(aAllowLineBreak, aReflowState, aReflowStates,
                               baseFrame, textFrames, reflowStatus);
     if (NS_INLINE_IS_BREAK(reflowStatus)) {
       break;
     }
     // We are not handling overflow here.
     MOZ_ASSERT(reflowStatus == NS_FRAME_COMPLETE);
   }
 
@@ -488,18 +485,17 @@ nsRubyBaseContainerFrame::ReflowColumns(
     // Try pull some frames from next continuations. This call replaces
     // |baseFrame| and |textFrames| with the frame pulled in each level.
     PullOneColumn(lineLayout, pullFrameState,
                   baseFrame, textFrames, isComplete);
     if (isComplete) {
       // No more frames can be pulled.
       break;
     }
-    icoord += ReflowOneColumn(aPresContext, aAllowLineBreak,
-                              aReflowState, aReflowStates,
+    icoord += ReflowOneColumn(aAllowLineBreak, aReflowState, aReflowStates,
                               baseFrame, textFrames, reflowStatus);
   }
 
   if (!e.AtEnd() && NS_INLINE_IS_BREAK_AFTER(reflowStatus)) {
     // The current column has been successfully placed.
     // Skip to the next column and mark break before.
     e.Next();
     e.GetFrames(baseFrame, textFrames);
@@ -537,18 +533,17 @@ nsRubyBaseContainerFrame::ReflowColumns(
     MOZ_ASSERT(e.AtEnd());
     aStatus = NS_INLINE_LINE_BREAK_AFTER(aStatus);
   }
 
   return icoord - istart;
 }
 
 nscoord
-nsRubyBaseContainerFrame::ReflowOneColumn(nsPresContext* aPresContext,
-                                          bool aAllowLineBreak,
+nsRubyBaseContainerFrame::ReflowOneColumn(bool aAllowLineBreak,
                                           const nsHTMLReflowState& aReflowState,
                                           nsTArray<nsHTMLReflowState*>& aReflowStates,
                                           nsIFrame* aBaseFrame,
                                           const nsTArray<nsIFrame*>& aTextFrames,
                                           nsReflowStatus& aStatus)
 {
   WritingMode lineWM = aReflowState.mLineLayout->GetWritingMode();
   const uint32_t rtcCount = mTextContainers.Length();
@@ -690,18 +685,17 @@ nsRubyBaseContainerFrame::PullOneColumn(
 
   if (!aIsComplete) {
     // We pulled frames from the next line, hence mark it dirty.
     aLineLayout->SetDirtyNextLine();
   }
 }
 
 nscoord
-nsRubyBaseContainerFrame::ReflowSpans(nsPresContext* aPresContext,
-                                      const nsHTMLReflowState& aReflowState,
+nsRubyBaseContainerFrame::ReflowSpans(const nsHTMLReflowState& aReflowState,
                                       nsTArray<nsHTMLReflowState*>& aReflowStates)
 {
   WritingMode lineWM = aReflowState.mLineLayout->GetWritingMode();
   const uint32_t spanCount = mSpanContainers.Length();
   nscoord spanISize = 0;
 
   for (uint32_t i = 0; i < spanCount; i++) {
     nsRubyTextContainerFrame* container = mSpanContainers[i];
--- a/layout/generic/nsRubyBaseContainerFrame.h
+++ b/layout/generic/nsRubyBaseContainerFrame.h
@@ -73,32 +73,29 @@ public:
 protected:
   friend nsContainerFrame*
     NS_NewRubyBaseContainerFrame(nsIPresShell* aPresShell,
                                  nsStyleContext* aContext);
   explicit nsRubyBaseContainerFrame(nsStyleContext* aContext) : nsContainerFrame(aContext) {}
 
   nscoord CalculateMaxSpanISize(nsRenderingContext* aRenderingContext);
 
-  nscoord ReflowColumns(nsPresContext* aPresContext,
-                        bool aAllowLineBreak,
+  nscoord ReflowColumns(bool aAllowLineBreak,
                         const nsHTMLReflowState& aReflowState,
                         nsTArray<nsHTMLReflowState*>& aReflowStates,
                         nsReflowStatus& aStatus);
 
-  nscoord ReflowOneColumn(nsPresContext* aPresContext,
-                          bool aAllowLineBreak,
+  nscoord ReflowOneColumn(bool aAllowLineBreak,
                           const nsHTMLReflowState& aReflowState,
                           nsTArray<nsHTMLReflowState*>& aReflowStates,
                           nsIFrame* aBaseFrame,
                           const nsTArray<nsIFrame*>& aTextFrames,
                           nsReflowStatus& aStatus);
 
-  nscoord ReflowSpans(nsPresContext* aPresContext,
-                      const nsHTMLReflowState& aReflowState,
+  nscoord ReflowSpans(const nsHTMLReflowState& aReflowState,
                       nsTArray<nsHTMLReflowState*>& aReflowStates);
 
   struct PullFrameState;
 
   // Pull ruby base and corresponding ruby text frames from
   // continuations after them.
   void PullOneColumn(nsLineLayout* aLineLayout,
                      PullFrameState& aPullFrameState,