Title: [269000] trunk
Revision
269000
Author
simon.fra...@apple.com
Date
2020-10-26 16:38:10 -0700 (Mon, 26 Oct 2020)

Log Message

REGRESSION (r260276): Unable to click on image and text link at the bottom of https://www.nytimes.com/ article
https://bugs.webkit.org/show_bug.cgi?id=218137
<rdar://problem/70439526>

Reviewed by Zalan Bujtas.
Source/WebCore:

r238725 made RenderLayers for accelerated overflow:scroll be self-painting, but that
changes paint and hit-testing order, which affected this nytimes article (the failing
element has large negative margin-top).

This is the fundamental compositing bug, but we can work around it in this case by
only making the layer self-painting if it does actually scroll.

Test: fast/layers/overflow-scroll-self-painting.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateScrollInfoAfterLayout): Need to update isSelfPaintingLayer()
after layout because now it depends on scrollable overflow.
(WebCore::RenderLayer::shouldBeSelfPaintingLayer const): Consult hasCompositedScrollableOverflow()
rather than canUseCompositedScrolling().

LayoutTests:

New test. Rebaseline tests affected by the self-painting layer change.

* compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness-expected.txt:
* compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping-expected.txt:
* fast/layers/overflow-scroll-self-painting-expected.html: Added.
* fast/layers/overflow-scroll-self-painting.html: Added.
* platform/ios-wk2/compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness-expected.txt:
* platform/ios-wk2/compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping-expected.txt:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (268999 => 269000)


--- trunk/LayoutTests/ChangeLog	2020-10-26 23:09:16 UTC (rev 268999)
+++ trunk/LayoutTests/ChangeLog	2020-10-26 23:38:10 UTC (rev 269000)
@@ -1,3 +1,20 @@
+2020-10-26  Simon Fraser  <simon.fra...@apple.com>
+
+        REGRESSION (r260276): Unable to click on image and text link at the bottom of https://www.nytimes.com/ article
+        https://bugs.webkit.org/show_bug.cgi?id=218137
+        <rdar://problem/70439526>
+
+        Reviewed by Zalan Bujtas.
+
+        New test. Rebaseline tests affected by the self-painting layer change.
+
+        * compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness-expected.txt:
+        * compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping-expected.txt:
+        * fast/layers/overflow-scroll-self-painting-expected.html: Added.
+        * fast/layers/overflow-scroll-self-painting.html: Added.
+        * platform/ios-wk2/compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness-expected.txt:
+        * platform/ios-wk2/compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping-expected.txt:
+
 2020-10-26  Chris Dumez  <cdu...@apple.com>
 
         Improve exception messages when AudioContext.suspend() / resume() promises are rejected

Modified: trunk/LayoutTests/compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness-expected.txt (268999 => 269000)


--- trunk/LayoutTests/compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness-expected.txt	2020-10-26 23:09:16 UTC (rev 268999)
+++ trunk/LayoutTests/compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness-expected.txt	2020-10-26 23:38:10 UTC (rev 269000)
@@ -6,46 +6,28 @@
     (GraphicsLayer
       (bounds 800.00 600.00)
       (contentsOpaque 1)
-      (children 3
+      (children 4
         (GraphicsLayer
-          (position 28.00 20.00)
-          (bounds 324.00 324.00)
+          (position 30.00 22.00)
+          (bounds 320.00 320.00)
+          (clips 1)
           (children 1
             (GraphicsLayer
-              (offsetFromRenderer width=2 height=2)
-              (position 2.00 2.00)
-              (bounds 320.00 320.00)
-              (clips 1)
+              (position 10.00 10.00)
+              (bounds 300.00 300.00)
+              (drawsContent 1)
               (children 1
                 (GraphicsLayer
-                  (position 10.00 10.00)
-                  (bounds 300.00 300.00)
-                  (drawsContent 1)
-                  (children 2
+                  (offsetFromRenderer width=2 height=2)
+                  (position 2.00 2.00)
+                  (bounds 281.00 296.00)
+                  (clips 1)
+                  (children 1
                     (GraphicsLayer
                       (offsetFromRenderer width=2 height=2)
-                      (position 2.00 2.00)
-                      (bounds 281.00 296.00)
-                      (clips 1)
-                      (children 1
-                        (GraphicsLayer
-                          (offsetFromRenderer width=2 height=2)
-                          (anchor 0.00 0.00)
-                          (bounds 281.00 364.00)
-                        )
-                      )
+                      (anchor 0.00 0.00)
+                      (bounds 281.00 364.00)
                     )
-                    (GraphicsLayer
-                      (position 2.00 2.00)
-                      (bounds 296.00 296.00)
-                      (children 1
-                        (GraphicsLayer
-                          (position 281.00 0.00)
-                          (bounds 15.00 296.00)
-                          (drawsContent 1)
-                        )
-                      )
-                    )
                   )
                 )
               )
@@ -76,6 +58,24 @@
             )
           )
         )
+        (GraphicsLayer
+          (position 30.00 22.00)
+          (bounds 320.00 320.00)
+          (clips 1)
+          (children 1
+            (GraphicsLayer
+              (position 12.00 12.00)
+              (bounds 296.00 296.00)
+              (children 1
+                (GraphicsLayer
+                  (position 281.00 0.00)
+                  (bounds 15.00 296.00)
+                  (drawsContent 1)
+                )
+              )
+            )
+          )
+        )
       )
     )
   )

Modified: trunk/LayoutTests/compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping-expected.txt (268999 => 269000)


--- trunk/LayoutTests/compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping-expected.txt	2020-10-26 23:09:16 UTC (rev 268999)
+++ trunk/LayoutTests/compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping-expected.txt	2020-10-26 23:38:10 UTC (rev 269000)
@@ -8,42 +8,35 @@
       (contentsOpaque 1)
       (children 1
         (GraphicsLayer
-          (position 28.00 20.00)
-          (bounds 324.00 324.00)
+          (position 30.00 22.00)
+          (bounds 320.00 320.00)
           (children 1
             (GraphicsLayer
-              (offsetFromRenderer width=2 height=2)
-              (position 2.00 2.00)
-              (bounds 320.00 320.00)
-              (children 1
+              (position 10.00 10.00)
+              (bounds 300.00 300.00)
+              (drawsContent 1)
+              (children 2
                 (GraphicsLayer
-                  (position 10.00 10.00)
-                  (bounds 300.00 300.00)
-                  (drawsContent 1)
-                  (children 2
+                  (offsetFromRenderer width=2 height=2)
+                  (position 2.00 2.00)
+                  (bounds 281.00 296.00)
+                  (children 1
                     (GraphicsLayer
                       (offsetFromRenderer width=2 height=2)
-                      (position 2.00 2.00)
-                      (bounds 281.00 296.00)
-                      (children 1
-                        (GraphicsLayer
-                          (offsetFromRenderer width=2 height=2)
-                          (anchor 0.00 0.00)
-                          (bounds 281.00 466.00)
-                          (drawsContent 1)
-                        )
-                      )
+                      (anchor 0.00 0.00)
+                      (bounds 281.00 466.00)
+                      (drawsContent 1)
                     )
+                  )
+                )
+                (GraphicsLayer
+                  (position 2.00 2.00)
+                  (bounds 296.00 296.00)
+                  (children 1
                     (GraphicsLayer
-                      (position 2.00 2.00)
-                      (bounds 296.00 296.00)
-                      (children 1
-                        (GraphicsLayer
-                          (position 281.00 0.00)
-                          (bounds 15.00 296.00)
-                          (drawsContent 1)
-                        )
-                      )
+                      (position 281.00 0.00)
+                      (bounds 15.00 296.00)
+                      (drawsContent 1)
                     )
                   )
                 )

Added: trunk/LayoutTests/fast/layers/overflow-scroll-self-painting-expected.html (0 => 269000)


--- trunk/LayoutTests/fast/layers/overflow-scroll-self-painting-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/layers/overflow-scroll-self-painting-expected.html	2020-10-26 23:38:10 UTC (rev 269000)
@@ -0,0 +1,35 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true ] -->
+<html>
+<head>
+    <style>
+        .container {
+            width: 300px;
+            height: 300px;
+            border: 1px solid black;
+            background-color: rgba(200, 200, 200, 0.5);
+        }
+        
+        .content {
+            height: 90%;
+        }
+        
+        .box {
+            margin-top: -120px;
+            margin-left: 50px;
+            width: 200px;
+            height: 200px;
+            background-color: blue;
+            
+        }
+        
+        .box:hover {
+            background-color: green;
+        }
+    </style>
+</head>
+<body>
+    <p>Blue box should be on top.</p>
+    <div class="container"></div>
+    <div class="box"></div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/layers/overflow-scroll-self-painting.html (0 => 269000)


--- trunk/LayoutTests/fast/layers/overflow-scroll-self-painting.html	                        (rev 0)
+++ trunk/LayoutTests/fast/layers/overflow-scroll-self-painting.html	2020-10-26 23:38:10 UTC (rev 269000)
@@ -0,0 +1,36 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true ] -->
+<html>
+<head>
+    <style>
+        .container {
+            width: 300px;
+            height: 300px;
+            border: 1px solid black;
+            background-color: rgba(200, 200, 200, 0.5);
+            overflow-x: hidden;
+        }
+        
+        .content {
+            height: 90%;
+        }
+        
+        .box {
+            margin-top: -120px;
+            margin-left: 50px;
+            width: 200px;
+            height: 200px;
+            background-color: blue;
+            
+        }
+        
+        .box:hover {
+            background-color: green;
+        }
+    </style>
+</head>
+<body>
+    <p>Blue box should be on top.</p>
+    <div class="container"></div>
+    <div class="box"></div>
+</body>
+</html>

Modified: trunk/LayoutTests/platform/ios-wk2/compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness-expected.txt (268999 => 269000)


--- trunk/LayoutTests/platform/ios-wk2/compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness-expected.txt	2020-10-26 23:09:16 UTC (rev 268999)
+++ trunk/LayoutTests/platform/ios-wk2/compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness-expected.txt	2020-10-26 23:38:10 UTC (rev 269000)
@@ -8,32 +8,25 @@
       (contentsOpaque 1)
       (children 3
         (GraphicsLayer
-          (position 28.00 20.00)
-          (bounds 324.00 324.00)
+          (position 30.00 22.00)
+          (bounds 320.00 320.00)
+          (clips 1)
           (children 1
             (GraphicsLayer
-              (offsetFromRenderer width=2 height=2)
-              (position 2.00 2.00)
-              (bounds 320.00 320.00)
-              (clips 1)
+              (position 10.00 10.00)
+              (bounds 300.00 300.00)
+              (drawsContent 1)
               (children 1
                 (GraphicsLayer
-                  (position 10.00 10.00)
-                  (bounds 300.00 300.00)
-                  (drawsContent 1)
+                  (offsetFromRenderer width=2 height=2)
+                  (position 2.00 2.00)
+                  (bounds 296.00 296.00)
+                  (clips 1)
                   (children 1
                     (GraphicsLayer
                       (offsetFromRenderer width=2 height=2)
-                      (position 2.00 2.00)
-                      (bounds 296.00 296.00)
-                      (clips 1)
-                      (children 1
-                        (GraphicsLayer
-                          (offsetFromRenderer width=2 height=2)
-                          (anchor 0.00 0.00)
-                          (bounds 296.00 364.00)
-                        )
-                      )
+                      (anchor 0.00 0.00)
+                      (bounds 296.00 364.00)
                     )
                   )
                 )

Modified: trunk/LayoutTests/platform/ios-wk2/compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping-expected.txt (268999 => 269000)


--- trunk/LayoutTests/platform/ios-wk2/compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping-expected.txt	2020-10-26 23:09:16 UTC (rev 268999)
+++ trunk/LayoutTests/platform/ios-wk2/compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping-expected.txt	2020-10-26 23:38:10 UTC (rev 269000)
@@ -8,31 +8,24 @@
       (contentsOpaque 1)
       (children 1
         (GraphicsLayer
-          (position 28.00 20.00)
-          (bounds 324.00 324.00)
+          (position 30.00 22.00)
+          (bounds 320.00 320.00)
           (children 1
             (GraphicsLayer
-              (offsetFromRenderer width=2 height=2)
-              (position 2.00 2.00)
-              (bounds 320.00 320.00)
+              (position 10.00 10.00)
+              (bounds 300.00 300.00)
+              (drawsContent 1)
               (children 1
                 (GraphicsLayer
-                  (position 10.00 10.00)
-                  (bounds 300.00 300.00)
-                  (drawsContent 1)
+                  (offsetFromRenderer width=2 height=2)
+                  (position 2.00 2.00)
+                  (bounds 296.00 296.00)
                   (children 1
                     (GraphicsLayer
                       (offsetFromRenderer width=2 height=2)
-                      (position 2.00 2.00)
-                      (bounds 296.00 296.00)
-                      (children 1
-                        (GraphicsLayer
-                          (offsetFromRenderer width=2 height=2)
-                          (anchor 0.00 0.00)
-                          (bounds 296.00 468.00)
-                          (drawsContent 1)
-                        )
-                      )
+                      (anchor 0.00 0.00)
+                      (bounds 296.00 468.00)
+                      (drawsContent 1)
                     )
                   )
                 )

Modified: trunk/Source/WebCore/ChangeLog (268999 => 269000)


--- trunk/Source/WebCore/ChangeLog	2020-10-26 23:09:16 UTC (rev 268999)
+++ trunk/Source/WebCore/ChangeLog	2020-10-26 23:38:10 UTC (rev 269000)
@@ -1,3 +1,26 @@
+2020-10-26  Simon Fraser  <simon.fra...@apple.com>
+
+        REGRESSION (r260276): Unable to click on image and text link at the bottom of https://www.nytimes.com/ article
+        https://bugs.webkit.org/show_bug.cgi?id=218137
+        <rdar://problem/70439526>
+
+        Reviewed by Zalan Bujtas.
+        
+        r238725 made RenderLayers for accelerated overflow:scroll be self-painting, but that
+        changes paint and hit-testing order, which affected this nytimes article (the failing
+        element has large negative margin-top).
+
+        This is the fundamental compositing bug, but we can work around it in this case by
+        only making the layer self-painting if it does actually scroll.
+
+        Test: fast/layers/overflow-scroll-self-painting.html
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::updateScrollInfoAfterLayout): Need to update isSelfPaintingLayer()
+        after layout because now it depends on scrollable overflow.
+        (WebCore::RenderLayer::shouldBeSelfPaintingLayer const): Consult hasCompositedScrollableOverflow()
+        rather than canUseCompositedScrolling().
+
 2020-10-26  Chris Dumez  <cdu...@apple.com>
 
         Improve exception messages when AudioContext.suspend() / resume() promises are rejected

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (268999 => 269000)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2020-10-26 23:09:16 UTC (rev 268999)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2020-10-26 23:38:10 UTC (rev 269000)
@@ -3898,6 +3898,7 @@
     ScrollOffset originalScrollOffset = scrollOffset();
 
     computeScrollDimensions();
+    updateSelfPaintingLayer();
 
 #if ENABLE(CSS_SCROLL_SNAP)
     // FIXME: Ensure that offsets are also updated in case of programmatic style changes.
@@ -6503,7 +6504,7 @@
         return true;
 
     return hasOverlayScrollbars()
-        || canUseCompositedScrolling()
+        || hasCompositedScrollableOverflow()
         || renderer().isTableRow()
         || renderer().isCanvas()
         || renderer().isVideo()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to