Bug 1574046 Part 2 - Move calling nsFloatManager::ClearContinues to BlockReflowInput::ClearFloats(). r=dbaron
authorTing-Yu Lin <tlin@mozilla.com>
Wed, 27 May 2020 04:44:42 +0000
changeset 535982 4140c68594e37736cad363e832d76ba22b7db8e9
parent 535981 aa23badb0824457636bde2db432e1637a9d3b382
child 535983 b217eaadc9d95c656d4f7cf53ca92d979765503d
push id37515
push usernerli@mozilla.com
push dateWed, 17 Jun 2020 14:49:45 +0000
treeherdermozilla-central@1e3e996bb9a1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1574046
milestone79.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 1574046 Part 2 - Move calling nsFloatManager::ClearContinues to BlockReflowInput::ClearFloats(). r=dbaron All the callers in nsBlockFrame call BlockReflowInput::ClearFloats(), I don't feel we need to pass the DONT_CLEAR_PUSHED_FLOATS down to nsFloatManager. Besides, I'll remove the flag in a later patch. Differential Revision: https://phabricator.services.mozilla.com/D74537
layout/generic/BlockReflowInput.cpp
layout/generic/nsFloatManager.cpp
layout/generic/nsFloatManager.h
--- a/layout/generic/BlockReflowInput.cpp
+++ b/layout/generic/BlockReflowInput.cpp
@@ -1067,17 +1067,25 @@ nscoord BlockReflowInput::ClearFloats(ns
 
   if (!FloatManager()->HasAnyFloats()) {
     return aBCoord;
   }
 
   nscoord newBCoord = aBCoord;
 
   if (aBreakType != StyleClear::None) {
-    newBCoord = FloatManager()->ClearFloats(newBCoord, aBreakType, aFlags);
+    if (!(aFlags & nsFloatManager::DONT_CLEAR_PUSHED_FLOATS) &&
+        FloatManager()->ClearContinues(aBreakType)) {
+      // FIXME bug 1574046. This makes no sense! we set aState.mBCoord from this
+      // result which will eventually make our parent's size nscoord_MAX!
+      // This is wallpapered over in nsBlockFrame::ComputeFinalSize for now...
+      newBCoord = nscoord_MAX;
+    } else {
+      newBCoord = FloatManager()->ClearFloats(newBCoord, aBreakType);
+    }
   }
 
   if (aReplacedBlock) {
     for (;;) {
       nsFlowAreaRect floatAvailableSpace = GetFloatAvailableSpace(newBCoord);
       if (ReplacedBlockFitsInAvailSpace(aReplacedBlock, floatAvailableSpace)) {
         break;
       }
--- a/layout/generic/nsFloatManager.cpp
+++ b/layout/generic/nsFloatManager.cpp
@@ -448,24 +448,18 @@ nsresult nsFloatManager::List(FILE* 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
 
-nscoord nsFloatManager::ClearFloats(nscoord aBCoord, StyleClear aBreakType,
-                                    uint32_t aFlags) const {
-  if (!(aFlags & DONT_CLEAR_PUSHED_FLOATS) && ClearContinues(aBreakType)) {
-    // FIXME bug 1574046. This makes no sense! we set aState.mBCoord from this
-    // result which will eventually make our parent's size nscoord_MAX!
-    // This is wallpapered over in nsBlockFrame::ComputeFinalSize for now...
-    return nscoord_MAX;
-  }
+nscoord nsFloatManager::ClearFloats(nscoord aBCoord,
+                                    StyleClear aBreakType) const {
   if (!HasAnyFloats()) {
     return aBCoord;
   }
 
   nscoord blockEnd = aBCoord + mBlockStart;
 
   const FloatInfo& tail = mFloats[mFloats.Length() - 1];
   switch (aBreakType) {
--- a/layout/generic/nsFloatManager.h
+++ b/layout/generic/nsFloatManager.h
@@ -311,18 +311,17 @@ class nsFloatManager {
    *
    * Both aBCoord and the result are relative to the current translation.
    */
   enum {
     // Tell ClearFloats not to push to nscoord_MAX when floats have been
     // pushed to the next page/column.
     DONT_CLEAR_PUSHED_FLOATS = (1 << 0)
   };
-  nscoord ClearFloats(nscoord aBCoord, mozilla::StyleClear aBreakType,
-                      uint32_t aFlags = 0) const;
+  nscoord ClearFloats(nscoord aBCoord, mozilla::StyleClear aBreakType) const;
 
   /**
    * Checks if clear would pass into the floats' BFC's next-in-flow,
    * i.e. whether floats affecting this clear have continuations.
    */
   bool ClearContinues(mozilla::StyleClear aBreakType) const;
 
   void AssertStateMatches(SavedState* aState) const {