Title: [271191] trunk
Revision
271191
Author
[email protected]
Date
2021-01-05 19:55:01 -0800 (Tue, 05 Jan 2021)

Log Message

REGRESSION: animated iframe painted blank
https://bugs.webkit.org/show_bug.cgi?id=220231
Source/WebCore:

<rdar://problem/72793724>

Reviewed by Zalan Bujtas.

When an <iframe> on a fractional pixel boundary, on a non-Retina display, with
composited contents had its visibility toggled from 'hidden' to 'visible' we could
fail to parent the iframe content compositing layers, resulting in missing iframe
content.

This happened when the iframe's GraphicsLayer had a m_contentsClippingLayer (which
acts as the parent for the content layers) due to the fractional pixel offset.
When GraphicsLayerCA::setContentsVisible(true) was called, it would fail to call
noteSublayersChanged() because the iframe host layer has no m_contentsLayer,
but we do need to rebuild sublayers in this case.

Test: compositing/iframes/content-visibility-with-clipping.html

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setContentsVisible):

LayoutTests:

Reviewed by Zalan Bujtas.

* compositing/iframes/content-visibility-with-clipping-expected.html: Added.
* compositing/iframes/content-visibility-with-clipping.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (271190 => 271191)


--- trunk/LayoutTests/ChangeLog	2021-01-06 03:27:09 UTC (rev 271190)
+++ trunk/LayoutTests/ChangeLog	2021-01-06 03:55:01 UTC (rev 271191)
@@ -1,3 +1,13 @@
+2021-01-05  Simon Fraser  <[email protected]>
+
+        REGRESSION: animated iframe painted blank
+        https://bugs.webkit.org/show_bug.cgi?id=220231
+
+        Reviewed by Zalan Bujtas.
+
+        * compositing/iframes/content-visibility-with-clipping-expected.html: Added.
+        * compositing/iframes/content-visibility-with-clipping.html: Added.
+
 2021-01-05  Peng Liu  <[email protected]>
 
         media-source-webm.html: Handle frame size in HAVE_METADATA

Added: trunk/LayoutTests/compositing/iframes/content-visibility-with-clipping-expected.html (0 => 271191)


--- trunk/LayoutTests/compositing/iframes/content-visibility-with-clipping-expected.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/iframes/content-visibility-with-clipping-expected.html	2021-01-06 03:55:01 UTC (rev 271191)
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <style>
+        iframe {
+            position: absolute;
+            display: block;
+            left: 12.5px;
+            will-change: transform;
+            border: 1px solid black;
+        }
+    </style>
+</head>
+<body>
+    <iframe scrolling="no" srcdoc="
+        <style>
+        .box {
+            width: 100px;
+            height: 100px;
+            background-color: green;
+            transform: translateZ(0);
+        }
+        </style>
+        <div class='box'>&nbsp;</div>
+        "></iframe>
+</body>
+</html>

Added: trunk/LayoutTests/compositing/iframes/content-visibility-with-clipping.html (0 => 271191)


--- trunk/LayoutTests/compositing/iframes/content-visibility-with-clipping.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/iframes/content-visibility-with-clipping.html	2021-01-06 03:55:01 UTC (rev 271191)
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <style>
+        iframe {
+            position: absolute;
+            display: block;
+            left: 12.5px;
+            visibility: hidden;
+            will-change: transform;
+            border: 1px solid black;
+        }
+        
+        body.changed iframe {
+            visibility: visible;
+        }
+    </style>
+    <script src=""
+    <script>
+        if (window.testRunner)
+            testRunner.waitUntilDone();
+
+        async function doTest()
+        {
+            await UIHelper.renderingUpdate();
+            document.body.classList.add('changed');
+            if (window.testRunner)
+                testRunner.notifyDone();
+        }
+        
+        window.addEventListener('load', () => {
+            doTest();
+        }, false);
+    </script>
+</head>
+<body>
+    <iframe scrolling="no" srcdoc="
+        <style>
+        .box {
+            width: 100px;
+            height: 100px;
+            background-color: green;
+            transform: translateZ(0);
+        }
+        </style>
+        <div class='box'>&nbsp;</div>
+        "></iframe>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (271190 => 271191)


--- trunk/Source/WebCore/ChangeLog	2021-01-06 03:27:09 UTC (rev 271190)
+++ trunk/Source/WebCore/ChangeLog	2021-01-06 03:55:01 UTC (rev 271191)
@@ -1,3 +1,27 @@
+2021-01-05  Simon Fraser  <[email protected]>
+
+        REGRESSION: animated iframe painted blank
+        https://bugs.webkit.org/show_bug.cgi?id=220231
+        <rdar://problem/72793724>
+
+        Reviewed by Zalan Bujtas.
+
+        When an <iframe> on a fractional pixel boundary, on a non-Retina display, with
+        composited contents had its visibility toggled from 'hidden' to 'visible' we could
+        fail to parent the iframe content compositing layers, resulting in missing iframe
+        content.
+
+        This happened when the iframe's GraphicsLayer had a m_contentsClippingLayer (which
+        acts as the parent for the content layers) due to the fractional pixel offset.
+        When GraphicsLayerCA::setContentsVisible(true) was called, it would fail to call
+        noteSublayersChanged() because the iframe host layer has no m_contentsLayer,
+        but we do need to rebuild sublayers in this case.
+
+        Test: compositing/iframes/content-visibility-with-clipping.html
+
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::setContentsVisible):
+
 2021-01-05  Megan Gardner  <[email protected]>
 
         Copy Localizable.strings file into the correct directory

Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (271190 => 271191)


--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2021-01-06 03:27:09 UTC (rev 271190)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2021-01-06 03:55:01 UTC (rev 271191)
@@ -741,8 +741,9 @@
 
     GraphicsLayer::setContentsVisible(contentsVisible);
     noteLayerPropertyChanged(ContentsVisibilityChanged);
+
     // Visibility affects whether the contentsLayer is parented.
-    if (m_contentsLayer)
+    if (m_contentsLayer || m_contentsClippingLayer)
         noteSublayersChanged();
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to