<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[245134] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/245134">245134</a></dd>
<dt>Author</dt> <dd>graouts@webkit.org</dd>
<dt>Date</dt> <dd>2019-05-09 07:16:44 -0700 (Thu, 09 May 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html is a timeout
https://bugs.webkit.org/show_bug.cgi?id=197738
<rdar://problem/50588613>

Reviewed by Antti Koivisto.

Source/WebKit:

We clear the touch actions for a given touch identifier when the matching touch is released in -[WKContentViewInteraction _handleTouchActionsForTouchEvent:].
This happens before -[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:] is called and thus, which we correctly
respected the touch actions during the panning gesture, we would not be able to respect them during the deceleration animation. This caused the test to fail
because it would check that no scrolling happened after the panning gesture completed, ie. during the deceleration animation.

To work around this, we now store the touch actions for a given UIScrollView interaction in the ScrollingTreeScrollingNodeDelegateIOS object when the interaction
starts.

* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::activeTouchActions const):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::clearActiveTouchActions):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(-[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
(-[WKScrollingNodeScrollViewDelegate _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::computeActiveTouchActionsForGestureRecognizer):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::activeTouchActionsForGestureRecognizer const): Deleted.

LayoutTests:

To pass, this test must also disable the legacy "-webkit-overflow-scrolling: touch" behavior.

* pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestspointereventsiostouchactionnoneinoverflowscrollingtouchhtml">trunk/LayoutTests/pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitUIProcessRemoteLayerTreeiosScrollingTreeScrollingNodeDelegateIOSh">trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessRemoteLayerTreeiosScrollingTreeScrollingNodeDelegateIOSmm">trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (245133 => 245134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2019-05-09 12:15:09 UTC (rev 245133)
+++ trunk/LayoutTests/ChangeLog 2019-05-09 14:16:44 UTC (rev 245134)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2019-05-09  Antoine Quint  <graouts@apple.com>
+
+        pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html is a timeout
+        https://bugs.webkit.org/show_bug.cgi?id=197738
+        <rdar://problem/50588613>
+
+        Reviewed by Antti Koivisto.
+
+        To pass, this test must also disable the legacy "-webkit-overflow-scrolling: touch" behavior.
+
+        * pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html:
+
</ins><span class="cx"> 2019-05-09  Antti Koivisto  <antti@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Elements with "display: inline-block" don't have a touch-action region
</span></span></pre></div>
<a id="trunkLayoutTestspointereventsiostouchactionnoneinoverflowscrollingtouchhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html (245133 => 245134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html   2019-05-09 12:15:09 UTC (rev 245133)
+++ trunk/LayoutTests/pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html      2019-05-09 14:16:44 UTC (rev 245134)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true ] -->
</del><ins>+<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true internal:LegacyOverflowScrollingTouchEnabled=false ] -->
</ins><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <meta name="viewport" content="width=device-width, initial-scale=1">
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (245133 => 245134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2019-05-09 12:15:09 UTC (rev 245133)
+++ trunk/Source/WebKit/ChangeLog       2019-05-09 14:16:44 UTC (rev 245134)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2019-05-09  Antoine Quint  <graouts@apple.com>
+
+        pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html is a timeout
+        https://bugs.webkit.org/show_bug.cgi?id=197738
+        <rdar://problem/50588613>
+
+        Reviewed by Antti Koivisto.
+
+        We clear the touch actions for a given touch identifier when the matching touch is released in -[WKContentViewInteraction _handleTouchActionsForTouchEvent:].
+        This happens before -[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:] is called and thus, which we correctly
+        respected the touch actions during the panning gesture, we would not be able to respect them during the deceleration animation. This caused the test to fail
+        because it would check that no scrolling happened after the panning gesture completed, ie. during the deceleration animation.
+
+        To work around this, we now store the touch actions for a given UIScrollView interaction in the ScrollingTreeScrollingNodeDelegateIOS object when the interaction
+        starts.
+
+        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
+        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::activeTouchActions const):
+        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::clearActiveTouchActions):
+        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
+        (-[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
+        (-[WKScrollingNodeScrollViewDelegate _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]):
+        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::computeActiveTouchActionsForGestureRecognizer):
+        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::activeTouchActionsForGestureRecognizer const): Deleted.
+
</ins><span class="cx"> 2019-05-08  Antoine Quint  <graouts@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [iOS] Correctly handle overlapping regions for elements with a touch-action property
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessRemoteLayerTreeiosScrollingTreeScrollingNodeDelegateIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h (245133 => 245134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h        2019-05-09 12:15:09 UTC (rev 245133)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h   2019-05-09 14:16:44 UTC (rev 245134)
</span><span class="lines">@@ -66,7 +66,9 @@
</span><span class="cx">     void repositionScrollingLayers();
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(POINTER_EVENTS)
</span><del>-    OptionSet<TouchAction> activeTouchActionsForGestureRecognizer(UIGestureRecognizer*) const;
</del><ins>+    OptionSet<TouchAction> activeTouchActions() const { return m_activeTouchActions; }
+    void computeActiveTouchActionsForGestureRecognizer(UIGestureRecognizer*);
+    void clearActiveTouchActions() { m_activeTouchActions = { }; }
</ins><span class="cx">     void cancelPointersForGestureRecognizer(UIGestureRecognizer*);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -74,6 +76,9 @@
</span><span class="cx">     RetainPtr<CALayer> m_scrollLayer;
</span><span class="cx">     RetainPtr<CALayer> m_scrolledContentsLayer;
</span><span class="cx">     RetainPtr<WKScrollingNodeScrollViewDelegate> m_scrollViewDelegate;
</span><ins>+#if ENABLE(POINTER_EVENTS)
+    OptionSet<TouchAction> m_activeTouchActions { };
+#endif
</ins><span class="cx">     bool m_updatingFromStateNode { false };
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessRemoteLayerTreeiosScrollingTreeScrollingNodeDelegateIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm (245133 => 245134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm       2019-05-09 12:15:09 UTC (rev 245133)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm  2019-05-09 14:16:44 UTC (rev 245134)
</span><span class="lines">@@ -79,7 +79,9 @@
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(POINTER_EVENTS)
</span><span class="cx">     if (![scrollView isZooming]) {
</span><del>-        auto touchActions = _scrollingTreeNodeDelegate->activeTouchActionsForGestureRecognizer(scrollView.panGestureRecognizer);
</del><ins>+        auto touchActions = _scrollingTreeNodeDelegate->activeTouchActions();
+        _scrollingTreeNodeDelegate->clearActiveTouchActions();
+        
</ins><span class="cx">         if (touchActions && !touchActions.containsAny({ WebCore::TouchAction::Auto, WebCore::TouchAction::Manipulation })) {
</span><span class="cx">             bool canPanX = true;
</span><span class="cx">             bool canPanY = true;
</span><span class="lines">@@ -147,7 +149,9 @@
</span><span class="cx"> - (CGPoint)_scrollView:(UIScrollView *)scrollView adjustedOffsetForOffset:(CGPoint)offset translation:(CGPoint)translation startPoint:(CGPoint)start locationInView:(CGPoint)locationInView horizontalVelocity:(inout double *)hv verticalVelocity:(inout double *)vv
</span><span class="cx"> {
</span><span class="cx">     auto* panGestureRecognizer = scrollView.panGestureRecognizer;
</span><del>-    auto touchActions = _scrollingTreeNodeDelegate->activeTouchActionsForGestureRecognizer(panGestureRecognizer);
</del><ins>+    _scrollingTreeNodeDelegate->computeActiveTouchActionsForGestureRecognizer(panGestureRecognizer);
+    auto touchActions = _scrollingTreeNodeDelegate->activeTouchActions();
+
</ins><span class="cx">     if (!touchActions) {
</span><span class="cx">         [self cancelPointersForGestureRecognizer:panGestureRecognizer];
</span><span class="cx">         return offset;
</span><span class="lines">@@ -336,12 +340,11 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(POINTER_EVENTS)
</span><del>-OptionSet<TouchAction> ScrollingTreeScrollingNodeDelegateIOS::activeTouchActionsForGestureRecognizer(UIGestureRecognizer* gestureRecognizer) const
</del><ins>+void ScrollingTreeScrollingNodeDelegateIOS::computeActiveTouchActionsForGestureRecognizer(UIGestureRecognizer* gestureRecognizer)
</ins><span class="cx"> {
</span><span class="cx">     auto& scrollingCoordinatorProxy = downcast<RemoteScrollingTree>(scrollingTree()).scrollingCoordinatorProxy();
</span><span class="cx">     if (auto touchIdentifier = scrollingCoordinatorProxy.webPageProxy().pageClient().activeTouchIdentifierForGestureRecognizer(gestureRecognizer))
</span><del>-        return scrollingCoordinatorProxy.activeTouchActionsForTouchIdentifier(*touchIdentifier);
-    return { };
</del><ins>+        m_activeTouchActions = scrollingCoordinatorProxy.activeTouchActionsForTouchIdentifier(*touchIdentifier);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ScrollingTreeScrollingNodeDelegateIOS::cancelPointersForGestureRecognizer(UIGestureRecognizer* gestureRecognizer)
</span></span></pre>
</div>
</div>

</body>
</html>