Title: [247012] trunk/Source/WebCore
Revision
247012
Author
[email protected]
Date
2019-07-01 11:09:27 -0700 (Mon, 01 Jul 2019)

Log Message

REGRESSION(r240047): Overflow scrollers on WK1 fail to update their content size when it changes
https://bugs.webkit.org/show_bug.cgi?id=199360
<rdar://problem/51643386>

Reviewed by Simon Fraser.

r240047 replaced didCommitChangesForLayer() mechanism by a more narrow didChangePlatformLayerForLayer.
Unfortunately on WK1 we relied on scroll layers being invalidated after every size (and scrollbar) change.
Without this invalidation we don't call WebChromeClientIOS::addOrUpdateScrollingLayer and the UIKit delegate
that resizes the UIScrollView content.

Fix by removing the scroll layer invalidation mechanism from LegacyWebKitScrollingLayerCoordinator completely and instead
simply update all scroll layers after commit. The UIKit delegate doesn't do any significant work if nothing changes,
this was not a very meaninful optimization.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlush):

Update all scroll layers after flush (similar to viewport constrained layers).

(WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
(WebCore::LegacyWebKitScrollingLayerCoordinator::updateScrollingLayer):
(WebCore::LegacyWebKitScrollingLayerCoordinator::addScrollingLayer):
(WebCore::LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer):
(WebCore::LegacyWebKitScrollingLayerCoordinator::registerScrollingLayersNeedingUpdate): Deleted.
(WebCore::LegacyWebKitScrollingLayerCoordinator::didChangePlatformLayerForLayer): Deleted.
* rendering/RenderLayerCompositor.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (247011 => 247012)


--- trunk/Source/WebCore/ChangeLog	2019-07-01 16:59:33 UTC (rev 247011)
+++ trunk/Source/WebCore/ChangeLog	2019-07-01 18:09:27 UTC (rev 247012)
@@ -1,3 +1,33 @@
+2019-07-01  Antti Koivisto  <[email protected]>
+
+        REGRESSION(r240047): Overflow scrollers on WK1 fail to update their content size when it changes
+        https://bugs.webkit.org/show_bug.cgi?id=199360
+        <rdar://problem/51643386>
+
+        Reviewed by Simon Fraser.
+
+        r240047 replaced didCommitChangesForLayer() mechanism by a more narrow didChangePlatformLayerForLayer.
+        Unfortunately on WK1 we relied on scroll layers being invalidated after every size (and scrollbar) change.
+        Without this invalidation we don't call WebChromeClientIOS::addOrUpdateScrollingLayer and the UIKit delegate
+        that resizes the UIScrollView content.
+
+        Fix by removing the scroll layer invalidation mechanism from LegacyWebKitScrollingLayerCoordinator completely and instead
+        simply update all scroll layers after commit. The UIKit delegate doesn't do any significant work if nothing changes,
+        this was not a very meaninful optimization.
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlush):
+
+        Update all scroll layers after flush (similar to viewport constrained layers).
+
+        (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
+        (WebCore::LegacyWebKitScrollingLayerCoordinator::updateScrollingLayer):
+        (WebCore::LegacyWebKitScrollingLayerCoordinator::addScrollingLayer):
+        (WebCore::LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer):
+        (WebCore::LegacyWebKitScrollingLayerCoordinator::registerScrollingLayersNeedingUpdate): Deleted.
+        (WebCore::LegacyWebKitScrollingLayerCoordinator::didChangePlatformLayerForLayer): Deleted.
+        * rendering/RenderLayerCompositor.h:
+
 2019-07-01  Philippe Normand  <[email protected]>
 
         [GStreamer] Cannot play Bert's Bytes radio stream from http://radio.dos.nl/

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (247011 => 247012)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2019-07-01 16:59:33 UTC (rev 247011)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2019-07-01 18:09:27 UTC (rev 247012)
@@ -557,7 +557,7 @@
 {
     if (m_legacyScrollingLayerCoordinator) {
         m_legacyScrollingLayerCoordinator->registerAllViewportConstrainedLayers(*this);
-        m_legacyScrollingLayerCoordinator->registerScrollingLayersNeedingUpdate();
+        m_legacyScrollingLayerCoordinator->registerAllScrollingLayers();
     }
 }
 #endif
@@ -564,11 +564,6 @@
 
 void RenderLayerCompositor::didChangePlatformLayerForLayer(RenderLayer& layer, const GraphicsLayer*)
 {
-#if PLATFORM(IOS_FAMILY)
-    if (m_legacyScrollingLayerCoordinator)
-        m_legacyScrollingLayerCoordinator->didChangePlatformLayerForLayer(layer);
-#endif
-
     auto* scrollingCoordinator = this->scrollingCoordinator();
     if (!scrollingCoordinator)
         return;
@@ -4777,6 +4772,7 @@
 
     bool allowHorizontalScrollbar = !layer.horizontalScrollbarHiddenByStyle();
     bool allowVerticalScrollbar = !layer.verticalScrollbarHiddenByStyle();
+
     m_chromeClient.addOrUpdateScrollingLayer(layer.renderer().element(), backing->scrollContainerLayer()->platformLayer(), backing->scrolledContentsLayer()->platformLayer(),
         layer.reachableTotalContentsSize(), allowHorizontalScrollbar, allowVerticalScrollbar);
 }
@@ -4787,14 +4783,6 @@
         updateScrollingLayer(*layer);
 }
 
-void LegacyWebKitScrollingLayerCoordinator::registerScrollingLayersNeedingUpdate()
-{
-    for (auto* layer : m_scrollingLayersNeedingUpdate)
-        updateScrollingLayer(*layer);
-    
-    m_scrollingLayersNeedingUpdate.clear();
-}
-
 void LegacyWebKitScrollingLayerCoordinator::unregisterAllScrollingLayers()
 {
     for (auto* layer : m_scrollingLayers) {
@@ -4807,12 +4795,10 @@
 void LegacyWebKitScrollingLayerCoordinator::addScrollingLayer(RenderLayer& layer)
 {
     m_scrollingLayers.add(&layer);
-    m_scrollingLayersNeedingUpdate.add(&layer);
 }
 
 void LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer(RenderLayer& layer, RenderLayerBacking& backing)
 {
-    m_scrollingLayersNeedingUpdate.remove(&layer);
     if (m_scrollingLayers.remove(&layer)) {
         auto* scrollContainerLayer = backing.scrollContainerLayer()->platformLayer();
         auto* scrolledContentsLayer = backing.scrolledContentsLayer()->platformLayer();
@@ -4838,12 +4824,6 @@
     m_viewportConstrainedLayers.remove(&layer);
 }
 
-void LegacyWebKitScrollingLayerCoordinator::didChangePlatformLayerForLayer(RenderLayer& layer)
-{
-    if (m_scrollingLayers.contains(&layer))
-        m_scrollingLayersNeedingUpdate.add(&layer);
-}
-
 #endif
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.h (247011 => 247012)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.h	2019-07-01 16:59:33 UTC (rev 247011)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.h	2019-07-01 18:09:27 UTC (rev 247012)
@@ -118,7 +118,6 @@
     void unregisterAllViewportConstrainedLayers();
     
     void registerAllScrollingLayers();
-    void registerScrollingLayersNeedingUpdate();
     void unregisterAllScrollingLayers();
     
     void addScrollingLayer(RenderLayer&);
@@ -127,8 +126,6 @@
     void addViewportConstrainedLayer(RenderLayer&);
     void removeViewportConstrainedLayer(RenderLayer&);
 
-    void didChangePlatformLayerForLayer(RenderLayer&);
-
     void removeLayer(RenderLayer&);
 
 private:
@@ -139,7 +136,6 @@
     HashSet<RenderLayer*> m_scrollingLayers;
     HashSet<RenderLayer*> m_viewportConstrainedLayers;
 
-    HashSet<RenderLayer*> m_scrollingLayersNeedingUpdate;
     const bool m_coordinateViewportConstrainedLayers;
 };
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to