Title: [243694] trunk
Revision
243694
Author
[email protected]
Date
2019-04-01 09:38:03 -0700 (Mon, 01 Apr 2019)

Log Message

Trying to scroll the compose pane on gmail.com scrolls the message list behind
https://bugs.webkit.org/show_bug.cgi?id=196426
<rdar://problem/49402667>

Reviewed by Darin Adler.

Source/WebCore:

Test: fast/scrolling/ios/event-region-visibility-hidden.html

We fail to gather event region from desdendants of non-overflowing elements with 'visibility:hidden'.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintObject):

Skip the subtree walk only if the current region covers the box already.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintList):

Remove the (wrong) optimization, we bail out quickly on first renderer if possible so this is not high value.

LayoutTests:

* fast/scrolling/ios/event-region-visibility-hidden-expected.txt: Added.
* fast/scrolling/ios/event-region-visibility-hidden.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (243693 => 243694)


--- trunk/LayoutTests/ChangeLog	2019-04-01 13:36:16 UTC (rev 243693)
+++ trunk/LayoutTests/ChangeLog	2019-04-01 16:38:03 UTC (rev 243694)
@@ -1,3 +1,14 @@
+2019-04-01  Antti Koivisto  <[email protected]>
+
+        Trying to scroll the compose pane on gmail.com scrolls the message list behind
+        https://bugs.webkit.org/show_bug.cgi?id=196426
+        <rdar://problem/49402667>
+
+        Reviewed by Darin Adler.
+
+        * fast/scrolling/ios/event-region-visibility-hidden-expected.txt: Added.
+        * fast/scrolling/ios/event-region-visibility-hidden.html: Added.
+
 2019-04-01  Cathie Chen  <[email protected]>
 
         Change expectation for imported/w3c/web-platform-tests/resize-observer/eventloop.html.

Added: trunk/LayoutTests/fast/scrolling/ios/event-region-visibility-hidden-expected.txt (0 => 243694)


--- trunk/LayoutTests/fast/scrolling/ios/event-region-visibility-hidden-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/scrolling/ios/event-region-visibility-hidden-expected.txt	2019-04-01 16:38:03 UTC (rev 243694)
@@ -0,0 +1,47 @@
+ 
+  
+(GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (contentsOpaque 1)
+      (children 4
+        (GraphicsLayer
+          (position 8.00 8.00)
+          (bounds 204.00 204.00)
+          (drawsContent 1)
+          (event region
+            (rect (2,2) width=50 height=50)
+          )
+        )
+        (GraphicsLayer
+          (position 216.00 8.00)
+          (bounds 204.00 204.00)
+          (drawsContent 1)
+          (event region
+            (rect (2,2) width=50 height=50)
+          )
+        )
+        (GraphicsLayer
+          (position 424.00 8.00)
+          (bounds 204.00 204.00)
+          (drawsContent 1)
+          (event region
+            (rect (152,152) width=50 height=50)
+          )
+        )
+        (GraphicsLayer
+          (position 8.00 217.00)
+          (bounds 204.00 204.00)
+          (drawsContent 1)
+          (event region
+            (rect (152,152) width=50 height=50)
+          )
+        )
+      )
+    )
+  )
+)
+

Added: trunk/LayoutTests/fast/scrolling/ios/event-region-visibility-hidden.html (0 => 243694)


--- trunk/LayoutTests/fast/scrolling/ios/event-region-visibility-hidden.html	                        (rev 0)
+++ trunk/LayoutTests/fast/scrolling/ios/event-region-visibility-hidden.html	2019-04-01 16:38:03 UTC (rev 243694)
@@ -0,0 +1,53 @@
+<html>
+<style>
+.testdiv {
+    display: inline-block;
+    border: 2px solid blue;
+    position: relative;
+    height: 200px;
+    width: 200px;
+    background-color: blue;
+    will-change: transform;
+}
+.inner {
+    height: 50px;
+    width: 50px;
+    background-color: green;
+}
+.positioned {
+    position: absolute;
+    left: 150px;
+    top: 150px;
+}
+</style>
+<script>
+window._onload_ = function () {
+    if (!window.internals)
+        return;
+    if (window.testRunner)
+        testRunner.dumpAsText();
+
+    document.body.offsetLeft;
+
+    test2.style.visibility = 'visible';
+    test4.style.visibility = 'visible';
+
+    results.innerText += internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_EVENT_REGION);
+}
+</script>
+<body>
+<div class="testdiv" style="visibility:hidden">
+    <div class="inner" style="visibility:visible"></div>
+</div>
+<div class="testdiv" style="visibility:hidden">
+    <div class="inner" id="test2"></div>
+</div>
+<div class="testdiv" style="visibility:hidden">
+    <div class="inner positioned" style="visibility:visible"></div>
+</div>
+<div class="testdiv" style="visibility:hidden">
+    <div class="inner positioned" id="test4"></div>
+</div>
+<pre id="results"></pre>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (243693 => 243694)


--- trunk/Source/WebCore/ChangeLog	2019-04-01 13:36:16 UTC (rev 243693)
+++ trunk/Source/WebCore/ChangeLog	2019-04-01 16:38:03 UTC (rev 243694)
@@ -1,3 +1,25 @@
+2019-04-01  Antti Koivisto  <[email protected]>
+
+        Trying to scroll the compose pane on gmail.com scrolls the message list behind
+        https://bugs.webkit.org/show_bug.cgi?id=196426
+        <rdar://problem/49402667>
+
+        Reviewed by Darin Adler.
+
+        Test: fast/scrolling/ios/event-region-visibility-hidden.html
+
+        We fail to gather event region from desdendants of non-overflowing elements with 'visibility:hidden'.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::paintObject):
+
+        Skip the subtree walk only if the current region covers the box already.
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::paintList):
+
+        Remove the (wrong) optimization, we bail out quickly on first renderer if possible so this is not high value.
+
 2019-04-01  Emilio Cobos Álvarez  <[email protected]>
 
         Be less strict about closing blocks in attribute and functional pseudo-element selectors.

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (243693 => 243694)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2019-04-01 13:36:16 UTC (rev 243693)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2019-04-01 16:38:03 UTC (rev 243694)
@@ -1248,8 +1248,8 @@
             paintInfo.eventRegion->unite(borderRegion);
         }
 
-        // No need to check descendants if we don't have overflow.
-        if (!hasVisualOverflow())
+        // No need to check descendants if we don't have overflow and the area is already covered.
+        if (!hasVisualOverflow() && paintInfo.eventRegion->contains(enclosingIntRect(borderRect)))
             return;
     }
 

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (243693 => 243694)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2019-04-01 13:36:16 UTC (rev 243693)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2019-04-01 16:38:03 UTC (rev 243694)
@@ -4488,9 +4488,6 @@
     if (!hasSelfPaintingLayerDescendant())
         return;
 
-    if (paintFlags.contains(PaintLayerCollectingEventRegion) && renderBox() && !renderBox()->hasRenderOverflow())
-        return;
-
 #if !ASSERT_DISABLED
     LayerListMutationDetector mutationChecker(*this);
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to