⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 266923 in webkit


Ignore:
Timestamp:
Sep 11, 2020, 8:39:02 AM (6 years ago)
Author:
Simon Fraser
Message:

REGRESSION (Async overflow scroll): Mouse wheel scrolling over an "always-on" overflow scrollbar doesn't work
https://bugs.webkit.org/show_bug.cgi?id=216381
<rdar://problem/68593743>

Reviewed by Antti Koivisto.

Source/WebCore:

The scrollbar and scroll corner layers need event regions and scrollingNodeIDs so that
we hit-test them via CA layers and find the right scrolling node.

Test: fast/scrolling/mac/mousewheel-over-scrollbar.html

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::updateAfterDescendants):
(WebCore::RenderLayerBacking::updateEventRegion):
(WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
(WebCore::RenderLayerBacking::setScrollingNodeIDForRole):

LayoutTests:

  • fast/scrolling/mac/border-radius-event-region-expected.txt:
  • fast/scrolling/mac/event-region-scrolled-contents-layer-expected.txt:
  • fast/scrolling/mac/event-region-subscroller-overflow-expected.txt:
  • fast/scrolling/mac/event-region-visibility-hidden-expected.txt:
  • fast/scrolling/mac/mousewheel-over-scrollbar-expected.txt: Added.
  • fast/scrolling/mac/mousewheel-over-scrollbar.html: Added.
  • fast/scrolling/mac/negative-z-index-overflow-scroll-expected.txt:
Location:
trunk
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r266913 r266923  
     12020-09-11  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (Async overflow scroll): Mouse wheel scrolling over an "always-on" overflow scrollbar doesn't work
     4        https://bugs.webkit.org/show_bug.cgi?id=216381
     5        <rdar://problem/68593743>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        * fast/scrolling/mac/border-radius-event-region-expected.txt:
     10        * fast/scrolling/mac/event-region-scrolled-contents-layer-expected.txt:
     11        * fast/scrolling/mac/event-region-subscroller-overflow-expected.txt:
     12        * fast/scrolling/mac/event-region-visibility-hidden-expected.txt:
     13        * fast/scrolling/mac/mousewheel-over-scrollbar-expected.txt: Added.
     14        * fast/scrolling/mac/mousewheel-over-scrollbar.html: Added.
     15        * fast/scrolling/mac/negative-z-index-overflow-scroll-expected.txt:
     16
    1172020-09-10  Fujii Hironori  <Hironori.Fujii@sony.com>
    218
  • trunk/LayoutTests/fast/scrolling/mac/border-radius-event-region-expected.txt

    r266846 r266923  
    3636                  (bounds 35.00 15.00)
    3737                  (drawsContent 1)
     38                  (event region
     39                    (rect (0,0) width=35 height=15)
     40                  )
    3841                )
    3942                (GraphicsLayer
     
    4144                  (bounds 15.00 35.00)
    4245                  (drawsContent 1)
     46                  (event region
     47                    (rect (0,0) width=15 height=35)
     48                  )
    4349                )
    4450                (GraphicsLayer
     
    4652                  (bounds 15.00 15.00)
    4753                  (drawsContent 1)
     54                  (event region
     55                    (rect (0,0) width=15 height=15)
     56                  )
    4857                )
    4958              )
  • trunk/LayoutTests/fast/scrolling/mac/event-region-scrolled-contents-layer-expected.txt

    r260305 r266923  
    3737                  (bounds 285.00 15.00)
    3838                  (drawsContent 1)
     39                  (event region
     40                    (rect (0,0) width=285 height=15)
     41                  )
    3942                )
    4043                (GraphicsLayer
     
    4245                  (bounds 15.00 285.00)
    4346                  (drawsContent 1)
     47                  (event region
     48                    (rect (0,0) width=15 height=285)
     49                  )
    4450                )
    4551                (GraphicsLayer
     
    4753                  (bounds 15.00 15.00)
    4854                  (drawsContent 1)
     55                  (event region
     56                    (rect (0,0) width=15 height=15)
     57                  )
    4958                )
    5059              )
  • trunk/LayoutTests/fast/scrolling/mac/event-region-subscroller-overflow-expected.txt

    r266846 r266923  
    5858                  (bounds 35.00 15.00)
    5959                  (drawsContent 1)
     60                  (event region
     61                    (rect (0,0) width=35 height=15)
     62                  )
    6063                )
    6164                (GraphicsLayer
     
    6366                  (bounds 15.00 35.00)
    6467                  (drawsContent 1)
     68                  (event region
     69                    (rect (0,0) width=15 height=35)
     70                  )
    6571                )
    6672                (GraphicsLayer
     
    6874                  (bounds 15.00 15.00)
    6975                  (drawsContent 1)
     76                  (event region
     77                    (rect (0,0) width=15 height=15)
     78                  )
    7079                )
    7180              )
  • trunk/LayoutTests/fast/scrolling/mac/event-region-visibility-hidden-expected.txt

    r266846 r266923  
    3838                  (bounds 35.00 15.00)
    3939                  (drawsContent 1)
     40                  (event region
     41                    (rect (0,0) width=35 height=15)
     42                  )
    4043                )
    4144                (GraphicsLayer
     
    4346                  (bounds 15.00 35.00)
    4447                  (drawsContent 1)
     48                  (event region
     49                    (rect (0,0) width=15 height=35)
     50                  )
    4551                )
    4652                (GraphicsLayer
     
    4854                  (bounds 15.00 15.00)
    4955                  (drawsContent 1)
     56                  (event region
     57                    (rect (0,0) width=15 height=15)
     58                  )
    5059                )
    5160              )
  • trunk/LayoutTests/fast/scrolling/mac/negative-z-index-overflow-scroll-expected.txt

    r266403 r266923  
    5656                          (bounds 425.00 15.00)
    5757                          (drawsContent 1)
     58                          (event region
     59                            (rect (0,0) width=425 height=15)
     60                          )
    5861                        )
    5962                        (GraphicsLayer
     
    6164                          (bounds 15.00 625.00)
    6265                          (drawsContent 1)
     66                          (event region
     67                            (rect (0,0) width=15 height=625)
     68                          )
    6369                        )
    6470                        (GraphicsLayer
     
    6672                          (bounds 15.00 15.00)
    6773                          (drawsContent 1)
     74                          (event region
     75                            (rect (0,0) width=15 height=15)
     76                          )
    6877                        )
    6978                      )
  • trunk/Source/WebCore/ChangeLog

    r266922 r266923  
     12020-09-11  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (Async overflow scroll): Mouse wheel scrolling over an "always-on" overflow scrollbar doesn't work
     4        https://bugs.webkit.org/show_bug.cgi?id=216381
     5        <rdar://problem/68593743>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        The scrollbar and scroll corner layers need event regions and scrollingNodeIDs so that
     10        we hit-test them via CA layers and find the right scrolling node.
     11
     12        Test: fast/scrolling/mac/mousewheel-over-scrollbar.html
     13
     14        * rendering/RenderLayerBacking.cpp:
     15        (WebCore::RenderLayerBacking::updateAfterDescendants):
     16        (WebCore::RenderLayerBacking::updateEventRegion):
     17        (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
     18        (WebCore::RenderLayerBacking::setScrollingNodeIDForRole):
     19
    1202020-09-11  Chris Dumez  <cdumez@apple.com>
    221
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r266846 r266923  
    15281528    if (m_scrollContainerLayer) {
    15291529        m_scrollContainerLayer->setContentsVisible(renderer().style().visibility() == Visibility::Visible);
    1530         m_scrollContainerLayer->setUserInteractionEnabled(renderer().style().pointerEvents() != PointerEvents::None);
     1530
     1531        bool userInteractive = renderer().style().pointerEvents() != PointerEvents::None;
     1532        m_scrollContainerLayer->setUserInteractionEnabled(userInteractive);
     1533        if (m_layerForHorizontalScrollbar)
     1534            m_layerForHorizontalScrollbar->setUserInteractionEnabled(userInteractive);
     1535        if (m_layerForVerticalScrollbar)
     1536            m_layerForVerticalScrollbar->setUserInteractionEnabled(userInteractive);
     1537        if (m_layerForScrollCorner)
     1538            m_layerForScrollCorner->setUserInteractionEnabled(userInteractive);
    15311539    }
    15321540
     
    17361744    TraceScope scope(ComputeEventRegionsStart, ComputeEventRegionsEnd);
    17371745
     1746    auto visibleToHitTesting = renderer().visibleToHitTesting();
     1747
     1748    auto setEventRegionToLayerBounds = [&](GraphicsLayer* graphicsLayer) {
     1749        if (!graphicsLayer)
     1750            return;
     1751
     1752        EventRegion eventRegion;
     1753        auto eventRegionContext = eventRegion.makeContext();
     1754        if (visibleToHitTesting)
     1755            eventRegionContext.unite(enclosingIntRect(FloatRect({ }, graphicsLayer->size())), renderer().style());
     1756
     1757        graphicsLayer->setEventRegion(WTFMove(eventRegion));
     1758    };
     1759
    17381760    auto updateEventRegionForLayer = [&](GraphicsLayer& graphicsLayer) {
    17391761        GraphicsContext nullContext(nullptr);
     
    17461768        auto layerOffset = graphicsLayer.scrollOffset() - roundedIntSize(graphicsLayer.offsetFromRenderer());
    17471769
    1748         if (renderer().visibleToHitTesting()) {
    1749             if (&graphicsLayer == m_scrollContainerLayer) {
    1750                 eventRegionContext.unite(enclosingIntRect(FloatRect({ }, graphicsLayer.size())), renderer().style());
    1751                 graphicsLayer.setEventRegion(WTFMove(eventRegion));
    1752                 return;
    1753             }
    1754 
     1770        if (visibleToHitTesting) {
    17551771            if (&graphicsLayer == m_scrolledContentsLayer) {
    17561772                // Initialize scrolled contents layer with layer-sized event region as it can all used for scrolling.
     
    17701786    updateEventRegionForLayer(*m_graphicsLayer);
    17711787
    1772     if (m_scrollContainerLayer)
    1773         updateEventRegionForLayer(*m_scrollContainerLayer);
     1788    setEventRegionToLayerBounds(m_scrollContainerLayer.get());
     1789    setEventRegionToLayerBounds(m_layerForHorizontalScrollbar.get());
     1790    setEventRegionToLayerBounds(m_layerForVerticalScrollbar.get());
     1791    setEventRegionToLayerBounds(m_layerForScrollCorner.get());
    17741792
    17751793    if (m_scrolledContentsLayer)
     
    22702288        if (m_scrollContainerLayer)
    22712289            m_scrollContainerLayer->setScrollingNodeID(0);
     2290        if (m_layerForHorizontalScrollbar)
     2291            m_layerForHorizontalScrollbar->setScrollingNodeID(0);
     2292        if (m_layerForVerticalScrollbar)
     2293            m_layerForVerticalScrollbar->setScrollingNodeID(0);
     2294        if (m_layerForScrollCorner)
     2295            m_layerForScrollCorner->setScrollingNodeID(0);
    22722296#endif
    22732297    }
     
    23082332        if (m_scrollContainerLayer)
    23092333            m_scrollContainerLayer->setScrollingNodeID(m_scrollingNodeID);
     2334
     2335        if (m_layerForHorizontalScrollbar)
     2336            m_layerForHorizontalScrollbar->setScrollingNodeID(m_scrollingNodeID);
     2337        if (m_layerForVerticalScrollbar)
     2338            m_layerForVerticalScrollbar->setScrollingNodeID(m_scrollingNodeID);
     2339        if (m_layerForScrollCorner)
     2340            m_layerForScrollCorner->setScrollingNodeID(m_scrollingNodeID);
    23102341#endif
    23112342        break;
Note: See TracChangeset for help on using the changeset viewer.