Changeset 245006 in webkit


Ignore:
Timestamp:
May 7, 2019, 5:02:25 AM (6 years ago)
Author:
Antti Koivisto
Message:

<body> with overflow:hidden CSS is scrollable on iOS
https://bugs.webkit.org/show_bug.cgi?id=153852
<rdar://problem/38715356>

Reviewed by Antoine Quint.

Source/WebCore:

Tests: fast/scrolling/ios/body-overflow-hidden-frame.html

fast/scrolling/ios/body-overflow-hidden.html

  • page/scrolling/ScrollingTreeScrollingNode.h:

Source/WebKit:

Disable touch scrolling of the main scroll view when <body> has overflow:hidden.

This already works for subframes where we don't create a scrollview in the first place.
The patch also adds a test for that.

  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _didCommitLayerTree:]):

Update scrollability after scrolling tree commits.

  • UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:

(WebKit::RemoteScrollingCoordinatorProxy::hasScrollableMainFrame const):

Base the decision on root ScrollingTreeScrollingNode::canHaveScrollbars() which is computed from overflow.
This matches Mac where wheel event dispatch is similarly blocked based on this property.

  • UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:

LayoutTests:

  • fast/scrolling/ios/body-overflow-hidden-expected.html: Added.
  • fast/scrolling/ios/body-overflow-hidden-frame-expected.html: Added.
  • fast/scrolling/ios/body-overflow-hidden-frame.html: Added.
  • fast/scrolling/ios/body-overflow-hidden.html: Added.
Location:
trunk
Files:
4 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r245004 r245006  
     12019-05-07  Antti Koivisto  <antti@apple.com>
     2
     3        <body> with overflow:hidden CSS is scrollable on iOS
     4        https://bugs.webkit.org/show_bug.cgi?id=153852
     5        <rdar://problem/38715356>
     6
     7        Reviewed by Antoine Quint.
     8
     9        * fast/scrolling/ios/body-overflow-hidden-expected.html: Added.
     10        * fast/scrolling/ios/body-overflow-hidden-frame-expected.html: Added.
     11        * fast/scrolling/ios/body-overflow-hidden-frame.html: Added.
     12        * fast/scrolling/ios/body-overflow-hidden.html: Added.
     13
    1142019-05-07  Youenn Fablet  <youenn@apple.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r245005 r245006  
     12019-05-07  Antti Koivisto  <antti@apple.com>
     2
     3        <body> with overflow:hidden CSS is scrollable on iOS
     4        https://bugs.webkit.org/show_bug.cgi?id=153852
     5        <rdar://problem/38715356>
     6
     7        Reviewed by Antoine Quint.
     8
     9        Tests: fast/scrolling/ios/body-overflow-hidden-frame.html
     10               fast/scrolling/ios/body-overflow-hidden.html
     11
     12        * page/scrolling/ScrollingTreeScrollingNode.h:
     13
    1142019-05-07  Antoine Quint  <graouts@apple.com>
    215
  • trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h

    r243926 r245006  
    6868    bool horizontalScrollbarHiddenByStyle() const { return m_scrollableAreaParameters.horizontalScrollbarHiddenByStyle; }
    6969    bool verticalScrollbarHiddenByStyle() const { return m_scrollableAreaParameters.verticalScrollbarHiddenByStyle; }
     70    bool canHaveScrollbars() const { return m_scrollableAreaParameters.horizontalScrollbarMode != ScrollbarAlwaysOff || m_scrollableAreaParameters.verticalScrollbarMode != ScrollbarAlwaysOff; }
    7071
    7172#if ENABLE(CSS_SCROLL_SNAP)
     
    125126    bool hasEnabledVerticalScrollbar() const { return m_scrollableAreaParameters.hasEnabledVerticalScrollbar; }
    126127
    127     bool canHaveScrollbars() const { return m_scrollableAreaParameters.horizontalScrollbarMode != ScrollbarAlwaysOff || m_scrollableAreaParameters.verticalScrollbarMode != ScrollbarAlwaysOff; }
    128 
    129128    bool expectsWheelEventTestTrigger() const { return m_expectsWheelEventTestTrigger; }
    130129
  • trunk/Source/WebKit/ChangeLog

    r245000 r245006  
     12019-05-07  Antti Koivisto  <antti@apple.com>
     2
     3        <body> with overflow:hidden CSS is scrollable on iOS
     4        https://bugs.webkit.org/show_bug.cgi?id=153852
     5        <rdar://problem/38715356>
     6
     7        Reviewed by Antoine Quint.
     8
     9        Disable touch scrolling of the main scroll view when <body> has overflow:hidden.
     10
     11        This already works for subframes where we don't create a scrollview in the first place.
     12        The patch also adds a test for that.
     13
     14        * UIProcess/API/Cocoa/WKWebView.mm:
     15        (-[WKWebView _didCommitLayerTree:]):
     16
     17        Update scrollability after scrolling tree commits.
     18
     19        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
     20        (WebKit::RemoteScrollingCoordinatorProxy::hasScrollableMainFrame const):
     21
     22        Base the decision on root ScrollingTreeScrollingNode::canHaveScrollbars() which is computed from overflow.
     23        This matches Mac where wheel event dispatch is similarly blocked based on this property.
     24
     25        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
     26
    1272019-05-06  James Savage  <james.savage@apple.com>
    228
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm

    r244955 r245006  
    19881988    [_scrollView setMaximumZoomScale:layerTreeTransaction.maximumScaleFactor()];
    19891989    [_scrollView setZoomEnabled:layerTreeTransaction.allowsUserScaling()];
     1990#if ENABLE(ASYNC_SCROLLING)
     1991    [_scrollView setScrollEnabled:_page->scrollingCoordinatorProxy()->hasScrollableMainFrame()];
     1992#endif
    19901993    if (!layerTreeTransaction.scaleWasSetByUIProcess() && ![_scrollView isZooming] && ![_scrollView isZoomBouncing] && ![_scrollView _isAnimatingZoom] && [_scrollView zoomScale] != layerTreeTransaction.pageScaleFactor()) {
    19911994        LOG_WITH_STREAM(VisibleRects, stream << " updating scroll view with pageScaleFactor " << layerTreeTransaction.pageScaleFactor());
  • trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp

    r244772 r245006  
    241241}
    242242
     243bool RemoteScrollingCoordinatorProxy::hasScrollableMainFrame() const
     244{
     245    auto* rootNode = m_scrollingTree->rootNode();
     246    return rootNode && rootNode->canHaveScrollbars();
     247}
     248
    243249#if ENABLE(POINTER_EVENTS)
    244250Optional<TouchActionData> RemoteScrollingCoordinatorProxy::touchActionDataAtPoint(const IntPoint p) const
  • trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h

    r243380 r245006  
    8585    bool propagatesMainFrameScrolls() const { return m_propagatesMainFrameScrolls; }
    8686    bool hasFixedOrSticky() const { return m_scrollingTree->hasFixedOrSticky(); }
     87    bool hasScrollableMainFrame() const;
    8788
    8889#if PLATFORM(IOS_FAMILY)
Note: See TracChangeset for help on using the changeset viewer.