REGRESSION (touch-action): Can't scroll vertically when touching a horizontally-scrol...
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Jun 2019 13:32:33 +0000 (13:32 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Jun 2019 13:32:33 +0000 (13:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=199268
<rdar://problem/52246473>

Reviewed by Antoine Quint.

Source/WebCore:

Test: pointerevents/ios/touch-action-region-manipulation.html

Having a restrictive touch-action value like 'pan-y' on on element and then having a descendant with
'touch-action: manipulation' computes to 'none'.

* css/StyleResolver.cpp:
(WebCore::computeEffectiveTouchActions):

For value 'manipulation' return the current effective value, similar to the reverse case above.
Set intersection should only be computed out of restrictive values (pan-x/pan-y/pinch-zoom/none).

LayoutTests:

* pointerevents/ios/touch-action-region-manipulation-expected.txt: Added.
* pointerevents/ios/touch-action-region-manipulation.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/pointerevents/ios/touch-action-region-manipulation-expected.txt [new file with mode: 0644]
LayoutTests/pointerevents/ios/touch-action-region-manipulation.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/StyleResolver.cpp

index 4159136..602a12c 100644 (file)
@@ -1,3 +1,14 @@
+2019-06-27  Antti Koivisto  <antti@apple.com>
+
+        REGRESSION (touch-action): Can't scroll vertically when touching a horizontally-scrollable element on instagram.com
+        https://bugs.webkit.org/show_bug.cgi?id=199268
+        <rdar://problem/52246473>
+
+        Reviewed by Antoine Quint.
+
+        * pointerevents/ios/touch-action-region-manipulation-expected.txt: Added.
+        * pointerevents/ios/touch-action-region-manipulation.html: Added.
+
 2019-06-27  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: throw an error if console.count/console.countReset is called with an object that throws an error from toString
diff --git a/LayoutTests/pointerevents/ios/touch-action-region-manipulation-expected.txt b/LayoutTests/pointerevents/ios/touch-action-region-manipulation-expected.txt
new file mode 100644 (file)
index 0000000..f0edd4f
--- /dev/null
@@ -0,0 +1,46 @@
+(GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (contentsOpaque 1)
+      (event region
+        (rect (0,0) width=800 height=600)
+      )
+      (children 2
+        (GraphicsLayer
+          (position 8.00 8.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=200 height=200)
+            (touch-action
+              (pan-x              
+                (rect (0,0) width=200 height=25)
+                (rect (0,25) width=100 height=75)
+              )
+            )
+          )
+        )
+        (GraphicsLayer
+          (position 8.00 208.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=200 height=200)
+            (touch-action
+              (manipulation              
+                (rect (100,0) width=100 height=25)
+              )
+              (pan-x              
+                (rect (0,0) width=100 height=100)
+              )
+            )
+          )
+        )
+      )
+    )
+  )
+)
+
diff --git a/LayoutTests/pointerevents/ios/touch-action-region-manipulation.html b/LayoutTests/pointerevents/ios/touch-action-region-manipulation.html
new file mode 100644 (file)
index 0000000..4abee8f
--- /dev/null
@@ -0,0 +1,49 @@
+<html>
+<style>
+.test {
+    width: 200px;
+    height: 200px;
+    position: relative;
+    will-change: transform;
+}
+.box {
+    width: 100px;
+    height: 100px;
+    background: green;
+    position: absolute;
+}
+.bar {
+    height:25px;
+}
+.pan-x {
+    touch-action:pan-x;
+    background: green;
+}
+
+.manipulation {
+    touch-action:manipulation;
+    background: yellow;
+}
+</style>
+<script>
+window.onload = function () {
+    if (window.testRunner)
+        testRunner.dumpAsText();
+    if (window.internals)
+        results.innerText = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_EVENT_REGION);
+}
+</script>
+<body>
+<div class="test">
+    <div class="pan-x bar">
+        <div class="manipulation box"></div>
+    </div>
+</div>
+<div class="test">
+    <div class="manipulation bar">
+        <div class="pan-x box"></div>
+    </div>
+</div>
+<pre id="results"></pre>
+</body>
+</html>
index cf04002..e715c4e 100644 (file)
@@ -1,3 +1,22 @@
+2019-06-27  Antti Koivisto  <antti@apple.com>
+
+        REGRESSION (touch-action): Can't scroll vertically when touching a horizontally-scrollable element on instagram.com
+        https://bugs.webkit.org/show_bug.cgi?id=199268
+        <rdar://problem/52246473>
+
+        Reviewed by Antoine Quint.
+
+        Test: pointerevents/ios/touch-action-region-manipulation.html
+
+        Having a restrictive touch-action value like 'pan-y' on on element and then having a descendant with
+        'touch-action: manipulation' computes to 'none'.
+
+        * css/StyleResolver.cpp:
+        (WebCore::computeEffectiveTouchActions):
+
+        For value 'manipulation' return the current effective value, similar to the reverse case above.
+        Set intersection should only be computed out of restrictive values (pan-x/pan-y/pinch-zoom/none).
+
 2019-06-27  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [SOUP] Use libsoup WebSockets API
index b3e6e14..ad9d3bb 100644 (file)
@@ -856,9 +856,12 @@ static OptionSet<TouchAction> computeEffectiveTouchActions(const RenderStyle& st
     if (effectiveTouchActions.contains(TouchAction::None))
         return { TouchAction::None };
 
-    if (effectiveTouchActions.contains(TouchAction::Auto) || effectiveTouchActions.contains(TouchAction::Manipulation))
+    if (effectiveTouchActions.containsAny({ TouchAction::Auto, TouchAction::Manipulation }))
         return touchActions;
 
+    if (touchActions.containsAny({ TouchAction::Auto, TouchAction::Manipulation }))
+        return effectiveTouchActions;
+
     auto sharedTouchActions = effectiveTouchActions & touchActions;
     if (sharedTouchActions.isEmpty())
         return { TouchAction::None };