Bug 1302758 Part 1 - Minor cosmetic fixes in nsFloatManager. r=dholbert
authorTing-Yu Lin <tlin@mozilla.com>
Thu, 15 Sep 2016 11:29:14 +0800
changeset 357652 98f95cc61ab3cb2db5e03be866c73a77cf5e3f3b
parent 357651 61ee2e5c3a78110e1d762af7df4d0bb0cc737c52
child 357653 3b8d624b89da61815cf87ad738c8a9f1619ba120
push id1324
push usermtabara@mozilla.com
push dateMon, 16 Jan 2017 13:07:44 +0000
treeherdermozilla-release@a01c49833940 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1302758
milestone51.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 1302758 Part 1 - Minor cosmetic fixes in nsFloatManager. r=dholbert These fixes are in the contextual of Part 2. MozReview-Commit-ID: 3AJUozeIi8W
layout/generic/nsFloatManager.cpp
layout/generic/nsFloatManager.h
--- a/layout/generic/nsFloatManager.cpp
+++ b/layout/generic/nsFloatManager.cpp
@@ -1,22 +1,24 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* class that manages rules for positioning floats */
 
 #include "nsFloatManager.h"
-#include "nsIPresShell.h"
-#include "nsMemory.h"
+
+#include <algorithm>
+
 #include "mozilla/ReflowInput.h"
 #include "nsBlockDebugFlags.h"
 #include "nsError.h"
-#include <algorithm>
+#include "nsIPresShell.h"
+#include "nsMemory.h"
 
 using namespace mozilla;
 
 int32_t nsFloatManager::sCachedFloatManagerCount = 0;
 void* nsFloatManager::sCachedFloatManagers[NS_FLOAT_MANAGER_CACHE_SIZE];
 
 /////////////////////////////////////////////////////////////////////////////
 
@@ -463,17 +465,17 @@ DebugListFloatManager(const nsFloatManag
 nsresult
 nsFloatManager::List(FILE* out) const
 {
   if (!HasAnyFloats())
     return NS_OK;
 
   for (uint32_t i = 0; i < mFloats.Length(); ++i) {
     const FloatInfo &fi = mFloats[i];
-    fprintf_stderr(out, "Float %u: frame=%p rect={%d,%d,%d,%d} ymost={l:%d, r:%d}\n",
+    fprintf_stderr(out, "Float %u: frame=%p rect={%d,%d,%d,%d} BEnd={l:%d, r:%d}\n",
                    i, static_cast<void*>(fi.mFrame),
                    fi.LineLeft(), fi.BStart(), fi.ISize(), fi.BSize(),
                    fi.mLeftBEnd, fi.mRightBEnd);
   }
   return NS_OK;
 }
 #endif
 
@@ -550,49 +552,49 @@ nsFloatManager::FloatInfo::~FloatInfo()
   MOZ_COUNT_DTOR(nsFloatManager::FloatInfo);
 }
 #endif
 
 //----------------------------------------------------------------------
 
 nsAutoFloatManager::~nsAutoFloatManager()
 {
-  // Restore the old float manager in the reflow state if necessary.
+  // Restore the old float manager in the reflow input if necessary.
   if (mNew) {
 #ifdef NOISY_FLOATMANAGER
     printf("restoring old float manager %p\n", mOld);
 #endif
 
     mReflowInput.mFloatManager = mOld;
 
 #ifdef NOISY_FLOATMANAGER
     if (mOld) {
-      static_cast<nsFrame *>(mReflowInput.frame)->ListTag(stdout);
-      printf(": space-manager %p after reflow\n", mOld);
+      mReflowInput.mFrame->ListTag(stdout);
+      printf(": float manager %p after reflow\n", mOld);
       mOld->List(stdout);
     }
 #endif
 
     delete mNew;
   }
 }
 
 nsresult
 nsAutoFloatManager::CreateFloatManager(nsPresContext *aPresContext)
 {
   // Create a new float manager and install it in the reflow
-  // state. `Remember' the old float manager so we can restore it
+  // input. `Remember' the old float manager so we can restore it
   // later.
   mNew = new nsFloatManager(aPresContext->PresShell(),
                             mReflowInput.GetWritingMode());
   if (! mNew)
     return NS_ERROR_OUT_OF_MEMORY;
 
 #ifdef NOISY_FLOATMANAGER
   printf("constructed new float manager %p (replacing %p)\n",
          mNew, mReflowInput.mFloatManager);
 #endif
 
-  // Set the float manager in the existing reflow state
+  // Set the float manager in the existing reflow input.
   mOld = mReflowInput.mFloatManager;
   mReflowInput.mFloatManager = mNew;
   return NS_OK;
 }
--- a/layout/generic/nsFloatManager.h
+++ b/layout/generic/nsFloatManager.h
@@ -365,33 +365,33 @@ private:
 
   nsFloatManager(const nsFloatManager&) = delete;
   void operator=(const nsFloatManager&) = delete;
 };
 
 /**
  * A helper class to manage maintenance of the float manager during
  * nsBlockFrame::Reflow. It automatically restores the old float
- * manager in the reflow state when the object goes out of scope.
+ * manager in the reflow input when the object goes out of scope.
  */
 class nsAutoFloatManager {
   using ReflowInput = mozilla::ReflowInput;
 
 public:
   explicit nsAutoFloatManager(ReflowInput& aReflowInput)
     : mReflowInput(aReflowInput),
       mNew(nullptr),
       mOld(nullptr) {}
 
   ~nsAutoFloatManager();
 
   /**
    * Create a new float manager for the specified frame. This will
    * `remember' the old float manager, and install the new float
-   * manager in the reflow state.
+   * manager in the reflow input.
    */
   nsresult
   CreateFloatManager(nsPresContext *aPresContext);
 
 protected:
   ReflowInput &mReflowInput;
   nsFloatManager *mNew;
   nsFloatManager *mOld;