Content in <iframe> should override "touch-action" set in embedding document
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Aug 2019 15:48:03 +0000 (15:48 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Aug 2019 15:48:03 +0000 (15:48 +0000)
https://bugs.webkit.org/show_bug.cgi?id=200204
<rdar://problem/54355249>

Reviewed by Antoine Quint.

Source/WebCore:

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

Subframes where content doesn't use any touch-action properties won't generate event region for their main layer.
As a result the touch-action property gets computed in UI process to the parent frames touch-action (instead of 'auto').

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateEventRegion):

Generate event region for the main layer of subframes.

LayoutTests:

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

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

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

index 11ec193..b1607ed 100644 (file)
@@ -1,3 +1,14 @@
+2019-08-16  Antti Koivisto  <antti@apple.com>
+
+        Content in <iframe> should override "touch-action" set in embedding document
+        https://bugs.webkit.org/show_bug.cgi?id=200204
+        <rdar://problem/54355249>
+
+        Reviewed by Antoine Quint.
+
+        * pointerevents/ios/touch-action-region-frame-expected.txt: Added.
+        * pointerevents/ios/touch-action-region-frame.html: Added.
+
 2019-08-16  Chris Lord  <clord@igalia.com>
 
         Update WebGL test expectations for WebKit WPE
diff --git a/LayoutTests/pointerevents/ios/touch-action-region-frame-expected.txt b/LayoutTests/pointerevents/ios/touch-action-region-frame-expected.txt
new file mode 100644 (file)
index 0000000..f9d8f77
--- /dev/null
@@ -0,0 +1,43 @@
+(GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 300.00 1016.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 300.00 1016.00)
+      (drawsContent 1)
+      (event region
+        (rect (0,0) width=300 height=1016)
+      )
+      (children 1
+        (GraphicsLayer
+        )
+      )
+    )
+  )
+)
+(GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 300.00 1016.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 300.00 1016.00)
+      (drawsContent 1)
+      (event region
+        (rect (0,0) width=300 height=1016)
+        (touch-action
+          (manipulation          
+            (rect (0,0) width=27 height=8)
+            (rect (0,8) width=292 height=11)
+            (rect (8,19) width=284 height=989)
+          )
+        )
+      )
+      (children 1
+        (GraphicsLayer
+        )
+      )
+    )
+  )
+)
+
diff --git a/LayoutTests/pointerevents/ios/touch-action-region-frame.html b/LayoutTests/pointerevents/ios/touch-action-region-frame.html
new file mode 100644 (file)
index 0000000..f3a590b
--- /dev/null
@@ -0,0 +1,28 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true internal:AsyncFrameScrollingEnabled=true ] -->
+<html>
+<style>
+body { touch-action: none; }
+</style>
+<body onload="test()">
+<iframe srcdoc="<body style='height:1000px'>Test</body>"></iframe>
+<iframe srcdoc="<body style='height:1000px;touch-action:manipulation'>Test</body>"></iframe>
+
+<pre id="results"></pre>
+<script>
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+}
+
+function test() {
+    if (!window.internals)
+        return;
+    for (const frame of document.querySelectorAll("iframe")) {
+        const doc = frame.contentDocument;
+        results.innerText += internals.layerTreeAsText(doc, internals.LAYER_TREE_INCLUDES_EVENT_REGION |  internals.LAYER_TREE_INCLUDES_ROOT_LAYER_PROPERTIES);
+    }
+    testRunner.notifyDone();
+}
+</script>
+</body>
+</html>
index a181dd5..158df18 100644 (file)
@@ -1,3 +1,21 @@
+2019-08-16  Antti Koivisto  <antti@apple.com>
+
+        Content in <iframe> should override "touch-action" set in embedding document
+        https://bugs.webkit.org/show_bug.cgi?id=200204
+        <rdar://problem/54355249>
+
+        Reviewed by Antoine Quint.
+
+        Test: pointerevents/ios/touch-action-region-frame.html
+
+        Subframes where content doesn't use any touch-action properties won't generate event region for their main layer.
+        As a result the touch-action property gets computed in UI process to the parent frames touch-action (instead of 'auto').
+
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::updateEventRegion):
+
+        Generate event region for the main layer of subframes.
+
 2019-08-16  Miguel Gomez  <magomez@igalia.com>
 
         [GTK][WPE] Move TextureMapperAnimation to the nicosia namespace as Nicosia::Animation
index 22ed6dd..5cebb5e 100644 (file)
@@ -1588,7 +1588,7 @@ void RenderLayerBacking::updateEventRegion()
 #if ENABLE(POINTER_EVENTS)
     hasTouchActionElements = renderer().document().mayHaveElementsWithNonAutoTouchAction();
 #endif
-    if (m_owningLayer.isRenderViewLayer() && !hasTouchActionElements)
+    if (m_isMainFrameRenderViewLayer && !hasTouchActionElements)
         return;
 
     GraphicsContext nullContext(nullptr);