Bug 1509196 - Remove unused variable isFlexOrGridContainer in ProcessChildren(). r=mats
authorTing-Yu Lin <tlin@mozilla.com>
Thu, 22 Nov 2018 00:55:27 +0000
changeset 504092 78b17ef09393ab0be8bd3bc65e06bde7aa29a6e7
parent 504091 9f240dd3f954faf06753b6b6d24ce1a4f684d6ca
child 504093 c00a2da3c2af666bb5c49d16ee81c0b258ed30f9
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs1509196
milestone65.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 1509196 - Remove unused variable isFlexOrGridContainer in ProcessChildren(). r=mats The other uses of isFlexOrGridContainer were removed in https://hg.mozilla.org/mozilla-central/rev/fa81899efb5e We can rely on ShouldSuppressFloatingOfDescendants() to look IsFlexOrGridContainer() up. Also, move ::IsFlexOrGridContainer() to be the first condition to check in ShouldSuppressFloatingOfDescendants() since it should be a more common use case than the others. Differential Revision: https://phabricator.services.mozilla.com/D12609
layout/base/nsCSSFrameConstructor.cpp
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -443,19 +443,19 @@ IsFrameForSVG(const nsIFrame* aFrame)
  * Returns true iff aFrame explicitly prevents its descendants from floating
  * (at least, down to the level of descendants which themselves are
  * float-containing blocks -- those will manage the floating status of any
  * lower-level descendents inside them, of course).
  */
 static bool
 ShouldSuppressFloatingOfDescendants(nsIFrame* aFrame)
 {
-  return aFrame->IsFrameOfType(nsIFrame::eMathML) ||
+  return ::IsFlexOrGridContainer(aFrame) ||
     aFrame->IsXULBoxFrame() ||
-    ::IsFlexOrGridContainer(aFrame);
+    aFrame->IsFrameOfType(nsIFrame::eMathML);
 }
 
 /**
  * If any children require a block parent, return the first such child.
  * Otherwise return null.
  */
 static nsIContent*
 AnyKidsNeedBlockParent(nsIFrame *aFrameList)
@@ -10115,23 +10115,19 @@ nsCSSFrameConstructor::ProcessChildren(n
   const bool allowFirstPseudos = aAllowBlockStyles &&
                                  nsLayoutUtils::GetAsBlock(aFrame);
   bool haveFirstLetterStyle = false, haveFirstLineStyle = false;
   if (allowFirstPseudos) {
     ShouldHaveSpecialBlockStyle(aContent, aComputedStyle, &haveFirstLetterStyle,
                                 &haveFirstLineStyle);
   }
 
-  const bool isFlexOrGridContainer = ::IsFlexOrGridContainer(aFrame);
   // The logic here needs to match the logic in GetFloatContainingBlock()
-  // (Since we already have isFlexOrGridContainer, we check that eagerly instead
-  // of letting ShouldSuppressFloatingOfDescendants look it up redundantly.)
   nsFrameConstructorSaveState floatSaveState;
-  if (isFlexOrGridContainer ||
-      ShouldSuppressFloatingOfDescendants(aFrame)) {
+  if (ShouldSuppressFloatingOfDescendants(aFrame)) {
     aState.PushFloatContainingBlock(nullptr, floatSaveState);
   } else if (aFrame->IsFloatContainingBlock()) {
     aState.PushFloatContainingBlock(aFrame, floatSaveState);
   }
 
   nsFrameConstructorState::PendingBindingAutoPusher pusher(aState,
                                                            aPendingBinding);