Changeset 247012 in webkit


Ignore:
Timestamp:
Jul 1, 2019 11:09:27 AM (5 years ago)
Author:
Antti Koivisto
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:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r247010 r247012  
     12019-07-01  Antti Koivisto  <antti@apple.com>
     2
     3        REGRESSION(r240047): Overflow scrollers on WK1 fail to update their content size when it changes
     4        https://bugs.webkit.org/show_bug.cgi?id=199360
     5        <rdar://problem/51643386>
     6
     7        Reviewed by Simon Fraser.
     8
     9        r240047 replaced didCommitChangesForLayer() mechanism by a more narrow didChangePlatformLayerForLayer.
     10        Unfortunately on WK1 we relied on scroll layers being invalidated after every size (and scrollbar) change.
     11        Without this invalidation we don't call WebChromeClientIOS::addOrUpdateScrollingLayer and the UIKit delegate
     12        that resizes the UIScrollView content.
     13
     14        Fix by removing the scroll layer invalidation mechanism from LegacyWebKitScrollingLayerCoordinator completely and instead
     15        simply update all scroll layers after commit. The UIKit delegate doesn't do any significant work if nothing changes,
     16        this was not a very meaninful optimization.
     17
     18        * rendering/RenderLayerCompositor.cpp:
     19        (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlush):
     20
     21        Update all scroll layers after flush (similar to viewport constrained layers).
     22
     23        (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
     24        (WebCore::LegacyWebKitScrollingLayerCoordinator::updateScrollingLayer):
     25        (WebCore::LegacyWebKitScrollingLayerCoordinator::addScrollingLayer):
     26        (WebCore::LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer):
     27        (WebCore::LegacyWebKitScrollingLayerCoordinator::registerScrollingLayersNeedingUpdate): Deleted.
     28        (WebCore::LegacyWebKitScrollingLayerCoordinator::didChangePlatformLayerForLayer): Deleted.
     29        * rendering/RenderLayerCompositor.h:
     30
    1312019-07-01  Philippe Normand  <pnormand@igalia.com>
    232
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r246869 r247012  
    558558    if (m_legacyScrollingLayerCoordinator) {
    559559        m_legacyScrollingLayerCoordinator->registerAllViewportConstrainedLayers(*this);
    560         m_legacyScrollingLayerCoordinator->registerScrollingLayersNeedingUpdate();
     560        m_legacyScrollingLayerCoordinator->registerAllScrollingLayers();
    561561    }
    562562}
     
    565565void RenderLayerCompositor::didChangePlatformLayerForLayer(RenderLayer& layer, const GraphicsLayer*)
    566566{
    567 #if PLATFORM(IOS_FAMILY)
    568     if (m_legacyScrollingLayerCoordinator)
    569         m_legacyScrollingLayerCoordinator->didChangePlatformLayerForLayer(layer);
    570 #endif
    571 
    572567    auto* scrollingCoordinator = this->scrollingCoordinator();
    573568    if (!scrollingCoordinator)
     
    47784773    bool allowHorizontalScrollbar = !layer.horizontalScrollbarHiddenByStyle();
    47794774    bool allowVerticalScrollbar = !layer.verticalScrollbarHiddenByStyle();
     4775
    47804776    m_chromeClient.addOrUpdateScrollingLayer(layer.renderer().element(), backing->scrollContainerLayer()->platformLayer(), backing->scrolledContentsLayer()->platformLayer(),
    47814777        layer.reachableTotalContentsSize(), allowHorizontalScrollbar, allowVerticalScrollbar);
     
    47864782    for (auto* layer : m_scrollingLayers)
    47874783        updateScrollingLayer(*layer);
    4788 }
    4789 
    4790 void LegacyWebKitScrollingLayerCoordinator::registerScrollingLayersNeedingUpdate()
    4791 {
    4792     for (auto* layer : m_scrollingLayersNeedingUpdate)
    4793         updateScrollingLayer(*layer);
    4794    
    4795     m_scrollingLayersNeedingUpdate.clear();
    47964784}
    47974785
     
    48084796{
    48094797    m_scrollingLayers.add(&layer);
    4810     m_scrollingLayersNeedingUpdate.add(&layer);
    48114798}
    48124799
    48134800void LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer(RenderLayer& layer, RenderLayerBacking& backing)
    48144801{
    4815     m_scrollingLayersNeedingUpdate.remove(&layer);
    48164802    if (m_scrollingLayers.remove(&layer)) {
    48174803        auto* scrollContainerLayer = backing.scrollContainerLayer()->platformLayer();
     
    48394825}
    48404826
    4841 void LegacyWebKitScrollingLayerCoordinator::didChangePlatformLayerForLayer(RenderLayer& layer)
    4842 {
    4843     if (m_scrollingLayers.contains(&layer))
    4844         m_scrollingLayersNeedingUpdate.add(&layer);
    4845 }
    4846 
    48474827#endif
    48484828
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.h

    r246869 r247012  
    119119   
    120120    void registerAllScrollingLayers();
    121     void registerScrollingLayersNeedingUpdate();
    122121    void unregisterAllScrollingLayers();
    123122   
     
    128127    void removeViewportConstrainedLayer(RenderLayer&);
    129128
    130     void didChangePlatformLayerForLayer(RenderLayer&);
    131 
    132129    void removeLayer(RenderLayer&);
    133130
     
    140137    HashSet<RenderLayer*> m_viewportConstrainedLayers;
    141138
    142     HashSet<RenderLayer*> m_scrollingLayersNeedingUpdate;
    143139    const bool m_coordinateViewportConstrainedLayers;
    144140};
Note: See TracChangeset for help on using the changeset viewer.