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

Changeset 267633 in webkit


Ignore:
Timestamp:
Sep 26, 2020, 2:08:45 PM (6 years ago)
Author:
Alan Coon
Message:

Cherry-pick r266923. rdar://problem/69586712

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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266923 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-610-branch
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-610-branch/LayoutTests/ChangeLog

    r267631 r267633  
     12020-09-25  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r266923. rdar://problem/69586712
     4
     5    REGRESSION (Async overflow scroll): Mouse wheel scrolling over an "always-on" overflow scrollbar doesn't work
     6    https://bugs.webkit.org/show_bug.cgi?id=216381
     7    <rdar://problem/68593743>
     8   
     9    Reviewed by Antti Koivisto.
     10   
     11    Source/WebCore:
     12   
     13    The scrollbar and scroll corner layers need event regions and scrollingNodeIDs so that
     14    we hit-test them via CA layers and find the right scrolling node.
     15   
     16    Test: fast/scrolling/mac/mousewheel-over-scrollbar.html
     17   
     18    * rendering/RenderLayerBacking.cpp:
     19    (WebCore::RenderLayerBacking::updateAfterDescendants):
     20    (WebCore::RenderLayerBacking::updateEventRegion):
     21    (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
     22    (WebCore::RenderLayerBacking::setScrollingNodeIDForRole):
     23   
     24    LayoutTests:
     25   
     26    * fast/scrolling/mac/border-radius-event-region-expected.txt:
     27    * fast/scrolling/mac/event-region-scrolled-contents-layer-expected.txt:
     28    * fast/scrolling/mac/event-region-subscroller-overflow-expected.txt:
     29    * fast/scrolling/mac/event-region-visibility-hidden-expected.txt:
     30    * fast/scrolling/mac/mousewheel-over-scrollbar-expected.txt: Added.
     31    * fast/scrolling/mac/mousewheel-over-scrollbar.html: Added.
     32    * fast/scrolling/mac/negative-z-index-overflow-scroll-expected.txt:
     33   
     34   
     35    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266923 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     36
     37    2020-09-11  Simon Fraser  <simon.fraser@apple.com>
     38
     39            REGRESSION (Async overflow scroll): Mouse wheel scrolling over an "always-on" overflow scrollbar doesn't work
     40            https://bugs.webkit.org/show_bug.cgi?id=216381
     41            <rdar://problem/68593743>
     42
     43            Reviewed by Antti Koivisto.
     44
     45            * fast/scrolling/mac/border-radius-event-region-expected.txt:
     46            * fast/scrolling/mac/event-region-scrolled-contents-layer-expected.txt:
     47            * fast/scrolling/mac/event-region-subscroller-overflow-expected.txt:
     48            * fast/scrolling/mac/event-region-visibility-hidden-expected.txt:
     49            * fast/scrolling/mac/mousewheel-over-scrollbar-expected.txt: Added.
     50            * fast/scrolling/mac/mousewheel-over-scrollbar.html: Added.
     51            * fast/scrolling/mac/negative-z-index-overflow-scroll-expected.txt:
     52
    1532020-09-25  Alan Coon  <alancoon@apple.com>
    254
  • branches/safari-610-branch/LayoutTests/fast/scrolling/mac/border-radius-event-region-expected.txt

    r267271 r267633  
    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              )
  • branches/safari-610-branch/LayoutTests/fast/scrolling/mac/event-region-scrolled-contents-layer-expected.txt

    r260305 r267633  
    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              )
  • branches/safari-610-branch/LayoutTests/fast/scrolling/mac/event-region-subscroller-overflow-expected.txt

    r267271 r267633  
    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              )
  • branches/safari-610-branch/LayoutTests/fast/scrolling/mac/event-region-visibility-hidden-expected.txt

    r267271 r267633  
    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              )
  • branches/safari-610-branch/LayoutTests/fast/scrolling/mac/negative-z-index-overflow-scroll-expected.txt

    r266853 r267633  
    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                      )
  • branches/safari-610-branch/Source/WebCore/ChangeLog

    r267632 r267633  
     12020-09-25  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r266923. rdar://problem/69586712
     4
     5    REGRESSION (Async overflow scroll): Mouse wheel scrolling over an "always-on" overflow scrollbar doesn't work
     6    https://bugs.webkit.org/show_bug.cgi?id=216381
     7    <rdar://problem/68593743>
     8   
     9    Reviewed by Antti Koivisto.
     10   
     11    Source/WebCore:
     12   
     13    The scrollbar and scroll corner layers need event regions and scrollingNodeIDs so that
     14    we hit-test them via CA layers and find the right scrolling node.
     15   
     16    Test: fast/scrolling/mac/mousewheel-over-scrollbar.html
     17   
     18    * rendering/RenderLayerBacking.cpp:
     19    (WebCore::RenderLayerBacking::updateAfterDescendants):
     20    (WebCore::RenderLayerBacking::updateEventRegion):
     21    (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
     22    (WebCore::RenderLayerBacking::setScrollingNodeIDForRole):
     23   
     24    LayoutTests:
     25   
     26    * fast/scrolling/mac/border-radius-event-region-expected.txt:
     27    * fast/scrolling/mac/event-region-scrolled-contents-layer-expected.txt:
     28    * fast/scrolling/mac/event-region-subscroller-overflow-expected.txt:
     29    * fast/scrolling/mac/event-region-visibility-hidden-expected.txt:
     30    * fast/scrolling/mac/mousewheel-over-scrollbar-expected.txt: Added.
     31    * fast/scrolling/mac/mousewheel-over-scrollbar.html: Added.
     32    * fast/scrolling/mac/negative-z-index-overflow-scroll-expected.txt:
     33   
     34   
     35    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266923 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     36
     37    2020-09-11  Simon Fraser  <simon.fraser@apple.com>
     38
     39            REGRESSION (Async overflow scroll): Mouse wheel scrolling over an "always-on" overflow scrollbar doesn't work
     40            https://bugs.webkit.org/show_bug.cgi?id=216381
     41            <rdar://problem/68593743>
     42
     43            Reviewed by Antti Koivisto.
     44
     45            The scrollbar and scroll corner layers need event regions and scrollingNodeIDs so that
     46            we hit-test them via CA layers and find the right scrolling node.
     47
     48            Test: fast/scrolling/mac/mousewheel-over-scrollbar.html
     49
     50            * rendering/RenderLayerBacking.cpp:
     51            (WebCore::RenderLayerBacking::updateAfterDescendants):
     52            (WebCore::RenderLayerBacking::updateEventRegion):
     53            (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
     54            (WebCore::RenderLayerBacking::setScrollingNodeIDForRole):
     55
    1562020-09-25  Alan Coon  <alancoon@apple.com>
    257
  • branches/safari-610-branch/Source/WebCore/rendering/RenderLayerBacking.cpp

    r267629 r267633  
    15361536    if (m_scrollContainerLayer) {
    15371537        m_scrollContainerLayer->setContentsVisible(renderer().style().visibility() == Visibility::Visible);
    1538         m_scrollContainerLayer->setUserInteractionEnabled(renderer().style().pointerEvents() != PointerEvents::None);
     1538
     1539        bool userInteractive = renderer().style().pointerEvents() != PointerEvents::None;
     1540        m_scrollContainerLayer->setUserInteractionEnabled(userInteractive);
     1541        if (m_layerForHorizontalScrollbar)
     1542            m_layerForHorizontalScrollbar->setUserInteractionEnabled(userInteractive);
     1543        if (m_layerForVerticalScrollbar)
     1544            m_layerForVerticalScrollbar->setUserInteractionEnabled(userInteractive);
     1545        if (m_layerForScrollCorner)
     1546            m_layerForScrollCorner->setUserInteractionEnabled(userInteractive);
    15391547    }
    15401548
     
    17441752    TraceScope scope(ComputeEventRegionsStart, ComputeEventRegionsEnd);
    17451753
     1754    auto visibleToHitTesting = renderer().visibleToHitTesting();
     1755
     1756    auto setEventRegionToLayerBounds = [&](GraphicsLayer* graphicsLayer) {
     1757        if (!graphicsLayer)
     1758            return;
     1759
     1760        EventRegion eventRegion;
     1761        auto eventRegionContext = eventRegion.makeContext();
     1762        if (visibleToHitTesting)
     1763            eventRegionContext.unite(enclosingIntRect(FloatRect({ }, graphicsLayer->size())), renderer().style());
     1764
     1765        graphicsLayer->setEventRegion(WTFMove(eventRegion));
     1766    };
     1767
    17461768    auto updateEventRegionForLayer = [&](GraphicsLayer& graphicsLayer) {
    17471769        GraphicsContext nullContext(nullptr);
     
    17541776        auto layerOffset = graphicsLayer.scrollOffset() - roundedIntSize(graphicsLayer.offsetFromRenderer());
    17551777
    1756         if (renderer().visibleToHitTesting()) {
    1757             if (&graphicsLayer == m_scrollContainerLayer) {
    1758                 eventRegionContext.unite(enclosingIntRect(FloatRect({ }, graphicsLayer.size())), renderer().style());
    1759                 graphicsLayer.setEventRegion(WTFMove(eventRegion));
    1760                 return;
    1761             }
    1762 
     1778        if (visibleToHitTesting) {
    17631779            if (&graphicsLayer == m_scrolledContentsLayer) {
    17641780                // Initialize scrolled contents layer with layer-sized event region as it can all used for scrolling.
     
    17781794    updateEventRegionForLayer(*m_graphicsLayer);
    17791795
    1780     if (m_scrollContainerLayer)
    1781         updateEventRegionForLayer(*m_scrollContainerLayer);
     1796    setEventRegionToLayerBounds(m_scrollContainerLayer.get());
     1797    setEventRegionToLayerBounds(m_layerForHorizontalScrollbar.get());
     1798    setEventRegionToLayerBounds(m_layerForVerticalScrollbar.get());
     1799    setEventRegionToLayerBounds(m_layerForScrollCorner.get());
    17821800
    17831801    if (m_scrolledContentsLayer)
     
    22782296        if (m_scrollContainerLayer)
    22792297            m_scrollContainerLayer->setScrollingNodeID(0);
     2298        if (m_layerForHorizontalScrollbar)
     2299            m_layerForHorizontalScrollbar->setScrollingNodeID(0);
     2300        if (m_layerForVerticalScrollbar)
     2301            m_layerForVerticalScrollbar->setScrollingNodeID(0);
     2302        if (m_layerForScrollCorner)
     2303            m_layerForScrollCorner->setScrollingNodeID(0);
    22802304#endif
    22812305    }
     
    23162340        if (m_scrollContainerLayer)
    23172341            m_scrollContainerLayer->setScrollingNodeID(m_scrollingNodeID);
     2342
     2343        if (m_layerForHorizontalScrollbar)
     2344            m_layerForHorizontalScrollbar->setScrollingNodeID(m_scrollingNodeID);
     2345        if (m_layerForVerticalScrollbar)
     2346            m_layerForVerticalScrollbar->setScrollingNodeID(m_scrollingNodeID);
     2347        if (m_layerForScrollCorner)
     2348            m_layerForScrollCorner->setScrollingNodeID(m_scrollingNodeID);
    23182349#endif
    23192350        break;
Note: See TracChangeset for help on using the changeset viewer.