Title: [263538] trunk
Revision
263538
Author
[email protected]
Date
2020-06-25 15:41:23 -0700 (Thu, 25 Jun 2020)

Log Message

[iOS] Event region briefly missing editable element after typing second character in question field on discussions.apple.com
https://bugs.webkit.org/show_bug.cgi?id=213618
<rdar://problem/62656131>

Reviewed by Simon Fraser.

Source/WebCore:

Ensure the event region is updated for the foreground layer, if there is one. The foreground layer paints
into a different backing and so will not be included in normal layer paint (i.e. RenderLayer::paintLayer()
will bail out).  A "z-index: -1" can create such a layer. An element with "z-index: -1" is above the
background, but below other content. Although the original reported bug was only concerned about the
editable region the fix is applicable to all regions tracked by EventRegion. I included a test for touch-action
region too.

Tests: editing/editable-region/text-field-inside-composited-negative-z-index-layer.html
       pointerevents/ios/touch-action-none-relative-inside-composited-negative-z-index-layer.html

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

LayoutTests:

Add some tests.

* editing/editable-region/text-field-inside-composited-negative-z-index-layer-expected.txt: Added.
* editing/editable-region/text-field-inside-composited-negative-z-index-layer.html: Added.
* pointerevents/ios/touch-action-none-relative-inside-composited-negative-z-index-layer-expected.txt: Added.
* pointerevents/ios/touch-action-none-relative-inside-composited-negative-z-index-layer.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (263537 => 263538)


--- trunk/LayoutTests/ChangeLog	2020-06-25 22:39:22 UTC (rev 263537)
+++ trunk/LayoutTests/ChangeLog	2020-06-25 22:41:23 UTC (rev 263538)
@@ -1,3 +1,18 @@
+2020-06-25  Daniel Bates  <[email protected]>
+
+        [iOS] Event region briefly missing editable element after typing second character in question field on discussions.apple.com
+        https://bugs.webkit.org/show_bug.cgi?id=213618
+        <rdar://problem/62656131>
+
+        Reviewed by Simon Fraser.
+
+        Add some tests.
+
+        * editing/editable-region/text-field-inside-composited-negative-z-index-layer-expected.txt: Added.
+        * editing/editable-region/text-field-inside-composited-negative-z-index-layer.html: Added.
+        * pointerevents/ios/touch-action-none-relative-inside-composited-negative-z-index-layer-expected.txt: Added.
+        * pointerevents/ios/touch-action-none-relative-inside-composited-negative-z-index-layer.html: Added.
+
 2020-06-25  Jason Lawrence  <[email protected]>
 
         [ Mac wk2 Debug ] imported/w3c/web-platform-tests/webrtc/RTCRtpReceiver-getContributingSources.https.html is flaky failing.

Added: trunk/LayoutTests/editing/editable-region/text-field-inside-composited-negative-z-index-layer-expected.txt (0 => 263538)


--- trunk/LayoutTests/editing/editable-region/text-field-inside-composited-negative-z-index-layer-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/editing/editable-region/text-field-inside-composited-negative-z-index-layer-expected.txt	2020-06-25 22:41:23 UTC (rev 263538)
@@ -0,0 +1,44 @@
+
+(GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (contentsOpaque 1)
+      (drawsContent 1)
+      (backgroundColor #FFFFFF)
+      (event region
+        (rect (0,0) width=800 height=600)
+      )
+      (children 1
+        (GraphicsLayer
+          (bounds 800.00 600.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=800 height=46)
+          (editable region
+            (rect (10,10) width=138 height=22)
+          )
+          )
+          (children 2
+            (GraphicsLayer
+              (position 8.00 33.00)
+            )
+            (GraphicsLayer
+              (bounds 800.00 600.00)
+              (drawsContent 1)
+              (event region
+                (rect (0,0) width=800 height=46)
+              (editable region
+                (rect (10,10) width=138 height=22)
+              )
+              )
+            )
+          )
+        )
+      )
+    )
+  )
+)
+

Added: trunk/LayoutTests/editing/editable-region/text-field-inside-composited-negative-z-index-layer.html (0 => 263538)


--- trunk/LayoutTests/editing/editable-region/text-field-inside-composited-negative-z-index-layer.html	                        (rev 0)
+++ trunk/LayoutTests/editing/editable-region/text-field-inside-composited-negative-z-index-layer.html	2020-06-25 22:41:23 UTC (rev 263538)
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+.trigger-bug {
+    position: absolute;
+    will-change: transform;
+    z-index: -1; /* Causes foreground layer creation */
+}
+</style>
+</head>
+<body>
+<div>
+    <input type="text">
+    <div class="trigger-bug"></div>
+</div>
+<pre id="results"></pre>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    results.textContent = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_EVENT_REGION | internals.LAYER_TREE_INCLUDES_ROOT_LAYER_PROPERTIES);
+</script>
+</body>
+</html>

Added: trunk/LayoutTests/pointerevents/ios/touch-action-none-relative-inside-composited-negative-z-index-layer-expected.txt (0 => 263538)


--- trunk/LayoutTests/pointerevents/ios/touch-action-none-relative-inside-composited-negative-z-index-layer-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/pointerevents/ios/touch-action-none-relative-inside-composited-negative-z-index-layer-expected.txt	2020-06-25 22:41:23 UTC (rev 263538)
@@ -0,0 +1,42 @@
+(GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (contentsOpaque 1)
+      (drawsContent 1)
+      (backgroundColor #FFFFFF)
+      (event region
+        (rect (0,0) width=800 height=600)
+      )
+      (children 1
+        (GraphicsLayer
+          (bounds 800.00 600.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=800 height=123)
+          )
+          (children 2
+            (GraphicsLayer
+              (position 8.00 110.00)
+            )
+            (GraphicsLayer
+              (bounds 800.00 600.00)
+              (drawsContent 1)
+              (event region
+                (rect (0,0) width=800 height=123)
+                (touch-action
+                  (none                  
+                    (rect (8,8) width=102 height=102)
+                  )
+                )
+              )
+            )
+          )
+        )
+      )
+    )
+  )
+)
+

Added: trunk/LayoutTests/pointerevents/ios/touch-action-none-relative-inside-composited-negative-z-index-layer.html (0 => 263538)


--- trunk/LayoutTests/pointerevents/ios/touch-action-none-relative-inside-composited-negative-z-index-layer.html	                        (rev 0)
+++ trunk/LayoutTests/pointerevents/ios/touch-action-none-relative-inside-composited-negative-z-index-layer.html	2020-06-25 22:41:23 UTC (rev 263538)
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+.trigger-bug {
+    position: absolute;
+    will-change: transform;
+    z-index: -1;
+}
+
+.touch-action {
+    position: relative;
+    touch-action: none;
+
+    /* The following are just to make the test prettier and help debug */
+    width: 100px;
+    height: 100px;
+    border: 1px solid black;
+}
+</style>
+</head>
+<body>
+<div>
+    <div class="touch-action"></div>
+    <div class="trigger-bug"></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 | internals.LAYER_TREE_INCLUDES_ROOT_LAYER_PROPERTIES);
+</script>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (263537 => 263538)


--- trunk/Source/WebCore/ChangeLog	2020-06-25 22:39:22 UTC (rev 263537)
+++ trunk/Source/WebCore/ChangeLog	2020-06-25 22:41:23 UTC (rev 263538)
@@ -1,3 +1,24 @@
+2020-06-25  Daniel Bates  <[email protected]>
+
+        [iOS] Event region briefly missing editable element after typing second character in question field on discussions.apple.com
+        https://bugs.webkit.org/show_bug.cgi?id=213618
+        <rdar://problem/62656131>
+
+        Reviewed by Simon Fraser.
+
+        Ensure the event region is updated for the foreground layer, if there is one. The foreground layer paints
+        into a different backing and so will not be included in normal layer paint (i.e. RenderLayer::paintLayer()
+        will bail out).  A "z-index: -1" can create such a layer. An element with "z-index: -1" is above the
+        background, but below other content. Although the original reported bug was only concerned about the
+        editable region the fix is applicable to all regions tracked by EventRegion. I included a test for touch-action
+        region too.
+
+        Tests: editing/editable-region/text-field-inside-composited-negative-z-index-layer.html
+               pointerevents/ios/touch-action-none-relative-inside-composited-negative-z-index-layer.html
+
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::updateEventRegion):
+
 2020-06-25  Jer Noble  <[email protected]>
 
         iOS Safari incorrectly reports "AppleCoreMedia" as UA string

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (263537 => 263538)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2020-06-25 22:39:22 UTC (rev 263537)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2020-06-25 22:41:23 UTC (rev 263538)
@@ -1768,6 +1768,9 @@
     if (m_scrolledContentsLayer)
         updateEventRegionForLayer(*m_scrolledContentsLayer);
 
+    if (m_foregroundLayer)
+        updateEventRegionForLayer(*m_foregroundLayer);
+
     renderer().view().setNeedsEventRegionUpdateForNonCompositedFrame(false);
 }
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to