[iOS WK2] Don't create backing store for -webkit-overflow-scrolling:touch that can...
[WebKit-https.git] / Source / WebCore / rendering / RenderLayerBacking.cpp
index b99703c..436b16c 100644 (file)
@@ -406,7 +406,7 @@ static bool layerOrAncestorIsTransformedOrUsingCompositedScrolling(RenderLayer&
     for (RenderLayer* curr = &layer; curr; curr = curr->parent()) {
         if (curr->hasTransform()
 #if PLATFORM(IOS)
-            || curr->hasAcceleratedTouchScrolling()
+            || curr->hasTouchScrollableOverflow()
 #else
             || curr->needsCompositedScrolling()
 #endif
@@ -536,29 +536,31 @@ bool RenderLayerBacking::updateGraphicsLayerConfiguration()
         layerConfigChanged = true;
     
     bool needsDescendentsClippingLayer = compositor().clipsCompositingDescendants(m_owningLayer);
-    bool usesCompositedScrolling;
+
+    if (!renderer().view().needsLayout()) {
+        bool usesCompositedScrolling;
 #if PLATFORM(IOS)
-    usesCompositedScrolling = m_owningLayer.hasAcceleratedTouchScrolling();
+        usesCompositedScrolling = m_owningLayer.hasTouchScrollableOverflow();
 #else
-    usesCompositedScrolling = m_owningLayer.needsCompositedScrolling();
+        usesCompositedScrolling = m_owningLayer.needsCompositedScrolling();
 #endif
+        // Our scrolling layer will clip.
+        if (usesCompositedScrolling)
+            needsDescendentsClippingLayer = false;
 
-    // Our scrolling layer will clip.
-    if (usesCompositedScrolling)
-        needsDescendentsClippingLayer = false;
+        if (updateScrollingLayers(usesCompositedScrolling))
+            layerConfigChanged = true;
 
-    if (updateAncestorClippingLayer(compositor().clippedByAncestor(m_owningLayer)))
-        layerConfigChanged = true;
+        if (updateDescendantClippingLayer(needsDescendentsClippingLayer))
+            layerConfigChanged = true;
+    }
 
-    if (updateDescendantClippingLayer(needsDescendentsClippingLayer))
+    if (updateAncestorClippingLayer(compositor().clippedByAncestor(m_owningLayer)))
         layerConfigChanged = true;
 
     if (updateOverflowControlsLayers(requiresHorizontalScrollbarLayer(), requiresVerticalScrollbarLayer(), requiresScrollCornerLayer()))
         layerConfigChanged = true;
 
-    if (updateScrollingLayers(usesCompositedScrolling))
-        layerConfigChanged = true;
-
     if (layerConfigChanged)
         updateInternalHierarchy();
 
@@ -752,7 +754,7 @@ void RenderLayerBacking::updateGraphicsLayerGeometry()
         graphicsLayerParentLocation = renderer().view().documentRect().location();
 
 #if PLATFORM(IOS)
-    if (compAncestor && compAncestor->hasAcceleratedTouchScrolling()) {
+    if (compAncestor && compAncestor->hasTouchScrollableOverflow()) {
         RenderBox* renderBox = toRenderBox(&compAncestor->renderer());
         LayoutRect paddingBox(renderBox->borderLeft(), renderBox->borderTop(),
             renderBox->width() - renderBox->borderLeft() - renderBox->borderRight(),
@@ -1440,7 +1442,6 @@ bool RenderLayerBacking::updateScrollingLayers(bool needsScrollingLayers)
         m_scrollingContentsLayer = nullptr;
     }
 
-    updateInternalHierarchy();
     m_graphicsLayer->setPaintingPhase(paintingPhaseForPrimaryLayer());
     m_graphicsLayer->setNeedsDisplay(); // Because painting phases changed.