Event region generation needs to know about backing-sharing
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 May 2019 16:20:12 +0000 (16:20 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 May 2019 16:20:12 +0000 (16:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=197694
<rdar://problem/50584991>

Reviewed by Simon Fraser.

Source/WebCore:

Test: pointerevents/ios/touch-action-region-backing-sharing.html

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

Gather event region from backing sharing layers too.

LayoutTests:

* platform/ios-wk2/TestExpectations:
* pointerevents/ios/touch-action-region-backing-sharing-expected.txt: Added.
* pointerevents/ios/touch-action-region-backing-sharing.html: Added.

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

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

index 0464d88..b959a6d 100644 (file)
@@ -1,3 +1,15 @@
+2019-05-10  Antti Koivisto  <antti@apple.com>
+
+        Event region generation needs to know about backing-sharing
+        https://bugs.webkit.org/show_bug.cgi?id=197694
+        <rdar://problem/50584991>
+
+        Reviewed by Simon Fraser.
+
+        * platform/ios-wk2/TestExpectations:
+        * pointerevents/ios/touch-action-region-backing-sharing-expected.txt: Added.
+        * pointerevents/ios/touch-action-region-backing-sharing.html: Added.
+
 2019-05-10  Ryan Haddad  <ryanhaddad@apple.com>
 
         [iOS Debug] Layout Test webgl/2.0.0/conformance2/attribs/gl-vertexattribipointer.html is a flaky timeout
index d10195a..ad1a274 100644 (file)
@@ -1076,7 +1076,6 @@ webkit.org/b/156620 legacy-animation-engine/fast/animation/request-animation-fra
 webkit.org/b/153049 perf/array-binary-search.html [ Pass Failure Timeout ]
 
 fast/scrolling/ios/scroll-events-back-forward-after-pageshow.html [ Pass Failure ]
-webkit.org/b/197694 fast/scrolling/ios/overflow-scroll-overlap-4.html [ Failure ]
 
 webkit.org/b/157589 fast/text-autosizing/ios/text-autosizing-after-back.html [ Pass Timeout ]
 
diff --git a/LayoutTests/pointerevents/ios/touch-action-region-backing-sharing-expected.txt b/LayoutTests/pointerevents/ios/touch-action-region-backing-sharing-expected.txt
new file mode 100644 (file)
index 0000000..8aec3a7
--- /dev/null
@@ -0,0 +1,57 @@
+(GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 800.00 600.00)
+  (deep color 1)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (contentsOpaque 1)
+      (event region
+        (rect (0,0) width=800 height=600)
+      )
+      (deep color 1)
+      (children 2
+        (GraphicsLayer
+          (position 8.00 13.00)
+          (bounds 200.00 200.00)
+          (event region
+            (rect (0,0) width=500 height=500)
+          )
+          (deep color 1)
+          (children 1
+            (GraphicsLayer
+              (bounds 200.00 200.00)
+              (children 1
+                (GraphicsLayer
+                  (anchor 0.00 0.00)
+                  (bounds 500.00 500.00)
+                  (drawsContent 1)
+                  (deep color 1)
+                )
+              )
+            )
+          )
+        )
+        (GraphicsLayer
+          (position 8.00 13.00)
+          (bounds 150.00 150.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=100 height=50)
+            (rect (0,50) width=150 height=50)
+            (rect (50,100) width=100 height=50)
+            (touch-action
+              (none              
+                (rect (0,0) width=100 height=50)
+                (rect (0,50) width=150 height=50)
+                (rect (50,100) width=100 height=50)
+              )
+            )
+          )
+          (deep color 1)
+        )
+      )
+    )
+  )
+)
+
diff --git a/LayoutTests/pointerevents/ios/touch-action-region-backing-sharing.html b/LayoutTests/pointerevents/ios/touch-action-region-backing-sharing.html
new file mode 100644 (file)
index 0000000..59e9c3b
--- /dev/null
@@ -0,0 +1,21 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true ] -->
+<html>
+<style>
+.scroll { position:absolute; width:200px; height:200px; overflow:scroll }
+.scrollcontent {  width:500px; height:500px; background:green; }
+.overlap { position:absolute; width:100px; height:100px; background:blue; touch-action: none; }
+</style>
+<body>
+<div class="scroll"><div class="scrollcontent"></div></div>
+<div class="overlap">
+    <div class="overlap" style="left:50px; top:50px"></div>
+</div>
+<pre id="results"></pre>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    results.innerText = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_EVENT_REGION);
+</script>
+</body>
+</html>
index e498e8d..227dd90 100644 (file)
@@ -1,3 +1,18 @@
+2019-05-10  Antti Koivisto  <antti@apple.com>
+
+        Event region generation needs to know about backing-sharing
+        https://bugs.webkit.org/show_bug.cgi?id=197694
+        <rdar://problem/50584991>
+
+        Reviewed by Simon Fraser.
+
+        Test: pointerevents/ios/touch-action-region-backing-sharing.html
+
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::updateEventRegion):
+
+        Gather event region from backing sharing layers too.
+
 2019-05-10  Michael Catanzaro  <mcatanzaro@igalia.com>
 
         [WPE][GTK] Add WebKitWebPage::did-associate-form-controls-for-frame and deprecate original did-associate-form-controls
index 0ed800c..35a14c1 100644 (file)
@@ -1493,6 +1493,9 @@ void RenderLayerBacking::updateEventRegion()
     auto paintFlags = RenderLayer::paintLayerPaintingCompositingAllPhasesFlags() | RenderLayer::PaintLayerCollectingEventRegion;
     m_owningLayer.paintLayerContents(nullContext, paintingInfo, paintFlags);
 
+    for (auto& layerWeakPtr : m_backingSharingLayers)
+        layerWeakPtr->paintLayerContents(nullContext, paintingInfo, paintFlags);
+
     auto contentOffset = roundedIntSize(contentOffsetInCompositingLayer());
     eventRegion.translate(contentOffset);
     m_graphicsLayer->setEventRegion(WTFMove(eventRegion));