Bug 1318266 - Part 2. Remove unnecessary nsDisplayScrollInfoLayer. r=mstange
☠☠ backed out by a7b0bf1ba2c1 ☠ ☠
authorcku <cku@mozilla.com>
Thu, 15 Dec 2016 22:20:33 +0800
changeset 450768 00bb4e2f5a3c3879c6a375348cdb6ec7cdf9d7f5
parent 450767 55790893cab48a081059bf0b8748694605562be4
child 450769 efb9edd878f0ff9ce06b8921098d7f284081b485
push id38944
push userbmo:leftysolara@gmail.com
push dateSun, 18 Dec 2016 16:01:15 +0000
reviewersmstange
bugs1318266, 1234485
milestone53.0a1
Bug 1318266 - Part 2. Remove unnecessary nsDisplayScrollInfoLayer. r=mstange After bug 1234485 land, we may create a layer for nsDisplayMask. When we do so, there is no need of nsDisplayScrollInfoLayer. MozReview-Commit-ID: KmFYhGKwq92
layout/painting/FrameLayerBuilder.cpp
--- a/layout/painting/FrameLayerBuilder.cpp
+++ b/layout/painting/FrameLayerBuilder.cpp
@@ -4335,16 +4335,23 @@ ContainerState::ProcessDisplayItems(nsDi
           // (must be done after visible rect is set on layer)
           if (layerClip.GetRoundedRectCount() > 0) {
             SetupMaskLayer(ownLayer, layerClip);
           }
         }
       } else if (item->GetType() == nsDisplayItem::TYPE_MASK) {
         nsDisplayMask* maskItem = static_cast<nsDisplayMask*>(item);
         SetupMaskLayerForCSSMask(ownLayer, maskItem);
+
+        nsDisplayItem* next = aList->GetBottom();
+        if (next && next->GetType() == nsDisplayItem::TYPE_SCROLL_INFO_LAYER) {
+          // Since we do build a layer for mask, there is no need for this
+          // scroll info layer anymore.
+          aList->RemoveBottom();
+        }
       }
 
       // Convert the visible rect to a region and give the item
       // a chance to try restrict it further.
       nsIntRegion itemVisibleRegion = itemVisibleRect;
       nsRegion tightBounds = item->GetTightBounds(mBuilder, &snap);
       if (!tightBounds.IsEmpty()) {
         itemVisibleRegion.AndWith(ScaleToOutsidePixels(tightBounds, snap));