Backed out 2 changesets (bug 1450520, bug 1450360) for mochitest e-10s failures on layout/forms/test/test_bug1301290.html. CLOSED TREE
authorCosmin Sabou <csabou@mozilla.com>
Mon, 02 Apr 2018 08:56:36 +0300
changeset 411293 1758267802e956446af295b0e6ef0b3bd4104a26
parent 411292 0cb041700c38f2f2a436252de179ac8ed6f299f3
child 411294 909f6cfa056f8cd04bb518452809bd1bc3e44a94
push id101608
push usercsabou@mozilla.com
push dateMon, 02 Apr 2018 05:57:25 +0000
treeherdermozilla-inbound@1758267802e9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1450520, 1450360, 1301290
milestone61.0a1
backs out0cb041700c38f2f2a436252de179ac8ed6f299f3
924e90305946602f0befb853082da372e87f2c3d
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
Backed out 2 changesets (bug 1450520, bug 1450360) for mochitest e-10s failures on layout/forms/test/test_bug1301290.html. CLOSED TREE Backed out changeset 0cb041700c38 (bug 1450520) Backed out changeset 924e90305946 (bug 1450360)
layout/base/nsLayoutUtils.cpp
layout/generic/nsGfxScrollFrame.cpp
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -628,23 +628,16 @@ nsLayoutUtils::IsAnimationLoggingEnabled
   }
 
   return sShouldLog;
 }
 
 bool
 nsLayoutUtils::AreRetainedDisplayListsEnabled()
 {
-  // We don't support retaining with overlay scrollbars, since they require
-  // us to look at the display list and pick the highest z-index, which
-  // we can't do during partial building.
-  if (LookAndFeel::GetInt(LookAndFeel::eIntID_UseOverlayScrollbars)) {
-    return false;
-  }
-
   if (XRE_IsContentProcess()) {
     return gfxPrefs::LayoutRetainDisplayList();
   } else {
     return gfxPrefs::LayoutRetainDisplayListChrome();
   }
 }
 
 bool
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -2993,38 +2993,34 @@ ScrollFrameHelper::ScrollToImpl(nsPoint 
   }
 
   nsCOMPtr<nsIDocShell> docShell = presContext->GetDocShell();
   if (docShell) {
     docShell->NotifyScrollObservers();
   }
 }
 
-static Maybe<int32_t>
+static int32_t
 MaxZIndexInList(nsDisplayList* aList, nsDisplayListBuilder* aBuilder)
 {
-  Maybe<int32_t> maxZIndex = Nothing();
+  int32_t maxZIndex = -1;
   for (nsDisplayItem* item = aList->GetBottom(); item; item = item->GetAbove()) {
-    if (!maxZIndex) {
-      maxZIndex = Some(item->ZIndex());
-    } else {
-      maxZIndex = Some(std::max(maxZIndex.value(), item->ZIndex()));
-    }
+    maxZIndex = std::max(maxZIndex, item->ZIndex());
   }
   return maxZIndex;
 }
 
 template<class T>
 static void
 AppendInternalItemToTop(const nsDisplayListSet& aLists,
                         T* aItem,
-                        const Maybe<int32_t>& aZIndex)
-{
-  if (aZIndex) {
-    aItem->SetOverrideZIndex(aZIndex.value());
+                        int32_t aZIndex)
+{
+  if (aZIndex >= 0) {
+    aItem->SetOverrideZIndex(aZIndex);
     aLists.PositionedDescendants()->AppendToTop(aItem);
   } else {
     aLists.Content()->AppendToTop(aItem);
   }
 }
 
 static const uint32_t APPEND_OWN_LAYER = 0x1;
 static const uint32_t APPEND_POSITIONED = 0x2;
@@ -3059,22 +3055,19 @@ AppendToTop(nsDisplayListBuilder* aBuild
   } else {
     newItem = MakeDisplayItem<nsDisplayWrapList>(aBuilder, aSourceFrame, aSource, asr);
   }
 
   if (aFlags & APPEND_POSITIONED) {
     // We want overlay scrollbars to always be on top of the scrolled content,
     // but we don't want them to unnecessarily cover overlapping elements from
     // outside our scroll frame.
-    Maybe<int32_t> zIndex = Nothing();
+    int32_t zIndex = -1;
     if (aFlags & APPEND_OVERLAY) {
       zIndex = MaxZIndexInList(aLists.PositionedDescendants(), aBuilder);
-    } else if (aSourceFrame->StylePosition()->mZIndex.GetUnit() == eStyleUnit_Integer) {
-      zIndex = Some(aSourceFrame->StylePosition()->mZIndex.GetIntValue());
-
     }
     AppendInternalItemToTop(aLists, newItem, zIndex);
   } else {
     aLists.BorderBackground()->AppendToTop(newItem);
   }
 }
 
 struct HoveredStateComparator
@@ -3330,16 +3323,25 @@ ScrollFrameHelper::BuildDisplayList(nsDi
       if (mScrollPosForLayerPixelAlignment == nsPoint(-1,-1)) {
         mScrollPosForLayerPixelAlignment = mScrollPosAtLastPaint;
       }
     } else {
       mScrollPosForLayerPixelAlignment = nsPoint(-1,-1);
     }
   }
 
+  // Adding overlay scrollbars requires us to look at the display list
+  // for the highest z-index item, which isn't possible during partial
+  // building. Mark the frame modified and do a full rebuild of this
+  // scrollframe.
+  if (LookAndFeel::GetInt(LookAndFeel::eIntID_UseOverlayScrollbars) &&
+      aBuilder->IsRetainingDisplayList()) {
+    aBuilder->MarkCurrentFrameModifiedDuringBuilding();
+  }
+
   // It's safe to get this value before the DecideScrollableLayer call below
   // because that call cannot create a displayport for root scroll frames,
   // and hence it cannot create an ignore scroll frame.
   bool ignoringThisScrollFrame =
     aBuilder->GetIgnoreScrollFrame() == mOuter || IsIgnoringViewportClipping();
 
   // Overflow clipping can never clip frames outside our subtree, so there
   // is no need to worry about whether we are a moving frame that might clip
@@ -3698,23 +3700,23 @@ ScrollFrameHelper::BuildDisplayList(nsDi
         ScrollbarStyles scrollbarStyles = GetScrollbarStylesFromFrame();
         if (scrollbarStyles.mOverscrollBehaviorX != StyleOverscrollBehavior::Auto ||
             scrollbarStyles.mOverscrollBehaviorY != StyleOverscrollBehavior::Auto) {
           info |= CompositorHitTestInfo::eRequiresTargetConfirmation;
         }
         nsDisplayCompositorHitTestInfo* hitInfo =
             MakeDisplayItem<nsDisplayCompositorHitTestInfo>(aBuilder, mScrolledFrame, info, 1,
                 Some(mScrollPort + aBuilder->ToReferenceFrame(mOuter)));
-        AppendInternalItemToTop(scrolledContent, hitInfo, Some(INT32_MAX));
+        AppendInternalItemToTop(scrolledContent, hitInfo, INT32_MAX);
       }
       if (aBuilder->IsBuildingLayerEventRegions()) {
         nsDisplayLayerEventRegions* inactiveRegionItem =
             MakeDisplayItem<nsDisplayLayerEventRegions>(aBuilder, mScrolledFrame, 1);
         inactiveRegionItem->AddInactiveScrollPort(mScrolledFrame, mScrollPort + aBuilder->ToReferenceFrame(mOuter));
-        AppendInternalItemToTop(scrolledContent, inactiveRegionItem, Some(INT32_MAX));
+        AppendInternalItemToTop(scrolledContent, inactiveRegionItem, INT32_MAX);
       }
     }
 
     if (aBuilder->ShouldBuildScrollInfoItemsForHoisting()) {
       aBuilder->AppendNewScrollInfoItemForHoisting(
         MakeDisplayItem<nsDisplayScrollInfoLayer>(aBuilder, mScrolledFrame,
                                                 mOuter));
     }