Changeset 290545 in webkit


Ignore:
Timestamp:
Feb 25, 2022 11:58:41 PM (5 months ago)
Author:
Simon Fraser
Message:

Scrollbars disappear when very long or wide
https://bugs.webkit.org/show_bug.cgi?id=237232
Source/WebCore:

<rdar://17540446>

Reviewed by Tim Horton.

Our tiling logic does not play nicely with AppKit's NSScrollerImps, probably because we
inadvertently unparent its layers.

Fix by disallowing GraphicsLayers for scrollbars from going into tiled mode, for
both root and overflow scrollbars.

Test: fast/scrolling/mac/scrollbars/very-wide-overlay-scrollbar.html

  • platform/graphics/GraphicsLayer.cpp:

(WebCore::GraphicsLayer::GraphicsLayer):

  • platform/graphics/GraphicsLayer.h:

(WebCore::GraphicsLayer::setAllowsTiling):
(WebCore::GraphicsLayer::allowsTiling const):

  • platform/graphics/ca/GraphicsLayerCA.cpp:

(WebCore::GraphicsLayerCA::requiresTiledLayer const):

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::updateOverflowControlsLayers):

  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):

LayoutTests:

Reviewed by Tim Horton.

  • fast/scrolling/mac/scrollbars/very-wide-overlay-scrollbar-expected-mismatch.html: Added.
  • fast/scrolling/mac/scrollbars/very-wide-overlay-scrollbar.html: Added.
Location:
trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r290531 r290545  
     12022-02-25  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Scrollbars disappear when very long or wide
     4        https://bugs.webkit.org/show_bug.cgi?id=237232
     5
     6        Reviewed by Tim Horton.
     7
     8        * fast/scrolling/mac/scrollbars/very-wide-overlay-scrollbar-expected-mismatch.html: Added.
     9        * fast/scrolling/mac/scrollbars/very-wide-overlay-scrollbar.html: Added.
     10
    1112022-02-25  Chris Dumez  <cdumez@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r290542 r290545  
     12022-02-25  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Scrollbars disappear when very long or wide
     4        https://bugs.webkit.org/show_bug.cgi?id=237232
     5        <rdar://17540446>
     6
     7        Reviewed by Tim Horton.
     8
     9        Our tiling logic does not play nicely with AppKit's NSScrollerImps, probably because we
     10        inadvertently unparent its layers.
     11
     12        Fix by disallowing GraphicsLayers for scrollbars from going into tiled mode, for
     13        both root and overflow scrollbars.
     14
     15        Test: fast/scrolling/mac/scrollbars/very-wide-overlay-scrollbar.html
     16
     17        * platform/graphics/GraphicsLayer.cpp:
     18        (WebCore::GraphicsLayer::GraphicsLayer):
     19        * platform/graphics/GraphicsLayer.h:
     20        (WebCore::GraphicsLayer::setAllowsTiling):
     21        (WebCore::GraphicsLayer::allowsTiling const):
     22        * platform/graphics/ca/GraphicsLayerCA.cpp:
     23        (WebCore::GraphicsLayerCA::requiresTiledLayer const):
     24        * rendering/RenderLayerBacking.cpp:
     25        (WebCore::RenderLayerBacking::updateOverflowControlsLayers):
     26        * rendering/RenderLayerCompositor.cpp:
     27        (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
     28
    1292022-02-25  Said Abou-Hallawa  <said@apple.com>
    230
  • trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp

    r290329 r290545  
    144144    , m_acceleratesDrawing(false)
    145145    , m_usesDisplayListDrawing(false)
     146    , m_allowsTiling(true)
    146147    , m_appliesPageScale(false)
    147148    , m_showDebugBorder(false)
  • trunk/Source/WebCore/platform/graphics/GraphicsLayer.h

    r289032 r290545  
    590590    virtual bool allowsBackingStoreDetaching() const { return true; }
    591591
     592    virtual void setAllowsTiling(bool allowsTiling) { m_allowsTiling = allowsTiling; }
     593    virtual bool allowsTiling() const { return m_allowsTiling; }
     594
    592595    virtual void deviceOrPageScaleFactorChanged() { }
    593596    WEBCORE_EXPORT void noteDeviceOrPageScaleFactorChangedIncludingDescendants();
     
    744747    bool m_acceleratesDrawing : 1;
    745748    bool m_usesDisplayListDrawing : 1;
     749    bool m_allowsTiling : 1;
    746750    bool m_appliesPageScale : 1; // Set for the layer which has the page scale applied to it.
    747751    bool m_showDebugBorder : 1;
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp

    r289598 r290545  
    43754375bool GraphicsLayerCA::requiresTiledLayer(float pageScaleFactor) const
    43764376{
    4377     if (!m_drawsContent || isPageTiledBackingLayer())
     4377    if (!m_drawsContent || isPageTiledBackingLayer() || !allowsTiling())
    43784378        return false;
    43794379
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r290329 r290545  
    21262126        if (needLayer) {
    21272127            layer = createGraphicsLayer(layerName);
    2128             if (drawsContent)
     2128            if (drawsContent) {
    21292129                layer->setAllowsBackingStoreDetaching(false);
    2130             else {
     2130                layer->setAllowsTiling(false);
     2131            } else {
    21312132                layer->setPaintingPhase({ });
    21322133                layer->setDrawsContent(false);
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r290329 r290545  
    40324032            m_layerForHorizontalScrollbar = GraphicsLayer::create(graphicsLayerFactory(), *this);
    40334033            m_layerForHorizontalScrollbar->setAllowsBackingStoreDetaching(false);
     4034            m_layerForHorizontalScrollbar->setAllowsTiling(false);
    40344035            m_layerForHorizontalScrollbar->setShowDebugBorder(m_showDebugBorders);
    40354036            m_layerForHorizontalScrollbar->setName(MAKE_STATIC_STRING_IMPL("horizontal scrollbar container"));
     
    40534054            m_layerForVerticalScrollbar = GraphicsLayer::create(graphicsLayerFactory(), *this);
    40544055            m_layerForVerticalScrollbar->setAllowsBackingStoreDetaching(false);
     4056            m_layerForVerticalScrollbar->setAllowsTiling(false);
    40554057            m_layerForVerticalScrollbar->setShowDebugBorder(m_showDebugBorders);
    40564058            m_layerForVerticalScrollbar->setName(MAKE_STATIC_STRING_IMPL("vertical scrollbar container"));
Note: See TracChangeset for help on using the changeset viewer.