Title: [239301] tags/Safari-607.1.16.5
Revision
239301
Author
alanc...@apple.com
Date
2018-12-17 15:58:32 -0800 (Mon, 17 Dec 2018)

Log Message

Cherry-pick r239150. rdar://problem/46531919

    REGRESSION (r238090): CAPCHA UI jumps to the wrong location
    https://bugs.webkit.org/show_bug.cgi?id=192651
    rdar://problem/46531919

    Reviewed by Zalan Bujtas.

    Source/WebCore:

    When a RenderLayer becomes non-composited because of a style change, we need to set a dirty
    bit to say that descendants need their geometry updated (because they now have to
    compute their positions relative to a different ancestor). This wasn't happening
    in the layerStyleChanged() code path.

    In the code path that did do this correctly (in the computeCompositingRequirements() tree walk),
    we can address a FIXME and only dirty direct children, not all descendants (that code was
    written before the child-only dirty bit existed).

    Test: compositing/geometry/update-child-geometry-on-compositing-change.html

    * rendering/RenderLayerCompositor.cpp:
    (WebCore::RenderLayerCompositor::computeCompositingRequirements):
    (WebCore::RenderLayerCompositor::layerStyleChanged):

    LayoutTests:

    Testcase that makes an intermediate layer non-composited (but still a RenderLayer).

    * compositing/geometry/update-child-geometry-on-compositing-change-expected.html: Added.
    * compositing/geometry/update-child-geometry-on-compositing-change.html: Added.

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

Modified Paths

Added Paths

Diff

Modified: tags/Safari-607.1.16.5/LayoutTests/ChangeLog (239300 => 239301)


--- tags/Safari-607.1.16.5/LayoutTests/ChangeLog	2018-12-17 23:58:27 UTC (rev 239300)
+++ tags/Safari-607.1.16.5/LayoutTests/ChangeLog	2018-12-17 23:58:32 UTC (rev 239301)
@@ -1,3 +1,53 @@
+2018-12-17  Alan Coon  <alanc...@apple.com>
+
+        Cherry-pick r239150. rdar://problem/46531919
+
+    REGRESSION (r238090): CAPCHA UI jumps to the wrong location
+    https://bugs.webkit.org/show_bug.cgi?id=192651
+    rdar://problem/46531919
+    
+    Reviewed by Zalan Bujtas.
+    
+    Source/WebCore:
+    
+    When a RenderLayer becomes non-composited because of a style change, we need to set a dirty
+    bit to say that descendants need their geometry updated (because they now have to
+    compute their positions relative to a different ancestor). This wasn't happening
+    in the layerStyleChanged() code path.
+    
+    In the code path that did do this correctly (in the computeCompositingRequirements() tree walk),
+    we can address a FIXME and only dirty direct children, not all descendants (that code was
+    written before the child-only dirty bit existed).
+    
+    Test: compositing/geometry/update-child-geometry-on-compositing-change.html
+    
+    * rendering/RenderLayerCompositor.cpp:
+    (WebCore::RenderLayerCompositor::computeCompositingRequirements):
+    (WebCore::RenderLayerCompositor::layerStyleChanged):
+    
+    LayoutTests:
+    
+    Testcase that makes an intermediate layer non-composited (but still a RenderLayer).
+    
+    * compositing/geometry/update-child-geometry-on-compositing-change-expected.html: Added.
+    * compositing/geometry/update-child-geometry-on-compositing-change.html: Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239150 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-12-12  Simon Fraser  <simon.fra...@apple.com>
+
+            REGRESSION (r238090): CAPCHA UI jumps to the wrong location
+            https://bugs.webkit.org/show_bug.cgi?id=192651
+            rdar://problem/46531919
+
+            Reviewed by Zalan Bujtas.
+
+            Testcase that makes an intermediate layer non-composited (but still a RenderLayer).
+
+            * compositing/geometry/update-child-geometry-on-compositing-change-expected.html: Added.
+            * compositing/geometry/update-child-geometry-on-compositing-change.html: Added.
+
 2018-12-12  Kocsen Chung  <kocsen_ch...@apple.com>
 
         Cherry-pick r238946. rdar://problem/46364206

Added: tags/Safari-607.1.16.5/LayoutTests/compositing/geometry/update-child-geometry-on-compositing-change-expected.html (0 => 239301)


--- tags/Safari-607.1.16.5/LayoutTests/compositing/geometry/update-child-geometry-on-compositing-change-expected.html	                        (rev 0)
+++ tags/Safari-607.1.16.5/LayoutTests/compositing/geometry/update-child-geometry-on-compositing-change-expected.html	2018-12-17 23:58:32 UTC (rev 239301)
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <style>
+        .container {
+            position: relative;
+            margin: 20px;
+            width: 300px;
+            height: 300px;
+            border: 1px solid black;
+        }
+        .box {
+            position: absolute;
+            left: 50px;
+            top: 50px;
+            z-index: 0;
+            width: 200px;
+            height: 200px;
+        }
+        .middle {
+            background-color: red;
+        }
+        .child {
+            background-color: green;
+            top: 0;
+            left: 0;
+        }
+        .composited {
+            transform: translateZ(0);
+        }
+    </style>
+</head>
+<body>
+    <div class="composited container">
+        <div id="target" class="middle box">
+            <div class="child composited box"></div>
+        </div>
+    </div>
+</body>
+</html>

Added: tags/Safari-607.1.16.5/LayoutTests/compositing/geometry/update-child-geometry-on-compositing-change.html (0 => 239301)


--- tags/Safari-607.1.16.5/LayoutTests/compositing/geometry/update-child-geometry-on-compositing-change.html	                        (rev 0)
+++ tags/Safari-607.1.16.5/LayoutTests/compositing/geometry/update-child-geometry-on-compositing-change.html	2018-12-17 23:58:32 UTC (rev 239301)
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <style>
+        .container {
+            position: relative;
+            margin: 20px;
+            width: 300px;
+            height: 300px;
+            border: 1px solid black;
+        }
+        .box {
+            position: absolute;
+            left: 50px;
+            top: 50px;
+            z-index: 0;
+            width: 200px;
+            height: 200px;
+        }
+        .middle {
+            background-color: red;
+        }
+        .child {
+            background-color: green;
+            top: 0;
+            left: 0;
+        }
+        .composited {
+            transform: translateZ(0);
+        }
+    </style>
+    <script>
+        if (window.testRunner)
+            testRunner.waitUntilDone();
+
+        window.addEventListener('load', () => {
+            requestAnimationFrame(() => {
+                document.getElementById('target').classList.remove('composited');
+                if (window.testRunner)
+                    testRunner.notifyDone();
+            });
+        }, false);
+    </script>
+</head>
+<body>
+    <div class="composited container">
+        <div id="target" class="middle composited box">
+            <div class="child composited box"></div>
+        </div>
+    </div>
+</body>
+</html>

Modified: tags/Safari-607.1.16.5/Source/WebCore/ChangeLog (239300 => 239301)


--- tags/Safari-607.1.16.5/Source/WebCore/ChangeLog	2018-12-17 23:58:27 UTC (rev 239300)
+++ tags/Safari-607.1.16.5/Source/WebCore/ChangeLog	2018-12-17 23:58:32 UTC (rev 239301)
@@ -1,3 +1,63 @@
+2018-12-17  Alan Coon  <alanc...@apple.com>
+
+        Cherry-pick r239150. rdar://problem/46531919
+
+    REGRESSION (r238090): CAPCHA UI jumps to the wrong location
+    https://bugs.webkit.org/show_bug.cgi?id=192651
+    rdar://problem/46531919
+    
+    Reviewed by Zalan Bujtas.
+    
+    Source/WebCore:
+    
+    When a RenderLayer becomes non-composited because of a style change, we need to set a dirty
+    bit to say that descendants need their geometry updated (because they now have to
+    compute their positions relative to a different ancestor). This wasn't happening
+    in the layerStyleChanged() code path.
+    
+    In the code path that did do this correctly (in the computeCompositingRequirements() tree walk),
+    we can address a FIXME and only dirty direct children, not all descendants (that code was
+    written before the child-only dirty bit existed).
+    
+    Test: compositing/geometry/update-child-geometry-on-compositing-change.html
+    
+    * rendering/RenderLayerCompositor.cpp:
+    (WebCore::RenderLayerCompositor::computeCompositingRequirements):
+    (WebCore::RenderLayerCompositor::layerStyleChanged):
+    
+    LayoutTests:
+    
+    Testcase that makes an intermediate layer non-composited (but still a RenderLayer).
+    
+    * compositing/geometry/update-child-geometry-on-compositing-change-expected.html: Added.
+    * compositing/geometry/update-child-geometry-on-compositing-change.html: Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239150 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-12-12  Simon Fraser  <simon.fra...@apple.com>
+
+            REGRESSION (r238090): CAPCHA UI jumps to the wrong location
+            https://bugs.webkit.org/show_bug.cgi?id=192651
+            rdar://problem/46531919
+
+            Reviewed by Zalan Bujtas.
+
+            When a RenderLayer becomes non-composited because of a style change, we need to set a dirty
+            bit to say that descendants need their geometry updated (because they now have to
+            compute their positions relative to a different ancestor). This wasn't happening
+            in the layerStyleChanged() code path.
+
+            In the code path that did do this correctly (in the computeCompositingRequirements() tree walk),
+            we can address a FIXME and only dirty direct children, not all descendants (that code was
+            written before the child-only dirty bit existed).
+
+            Test: compositing/geometry/update-child-geometry-on-compositing-change.html
+
+            * rendering/RenderLayerCompositor.cpp:
+            (WebCore::RenderLayerCompositor::computeCompositingRequirements):
+            (WebCore::RenderLayerCompositor::layerStyleChanged):
+
 2018-12-12  Kocsen Chung  <kocsen_ch...@apple.com>
 
         Cherry-pick r238946. rdar://problem/46364206

Modified: tags/Safari-607.1.16.5/Source/WebCore/rendering/RenderLayerCompositor.cpp (239300 => 239301)


--- tags/Safari-607.1.16.5/Source/WebCore/rendering/RenderLayerCompositor.cpp	2018-12-17 23:58:27 UTC (rev 239300)
+++ tags/Safari-607.1.16.5/Source/WebCore/rendering/RenderLayerCompositor.cpp	2018-12-17 23:58:32 UTC (rev 239301)
@@ -975,8 +975,8 @@
     // during post-order traversal (e.g. for clipping).
     if (updateBacking(layer, queryData, CompositingChangeRepaintNow, willBeComposited ? BackingRequired::Yes : BackingRequired::No)) {
         layer.setNeedsCompositingLayerConnection();
-        // Child layers need to get a geometry update to recompute their position. FIXME: Ideally we'd only dirty direct children.
-        layer.setDescendantsNeedUpdateBackingAndHierarchyTraversal();
+        // Child layers need to get a geometry update to recompute their position.
+        layer.setChildrenNeedCompositingGeometryUpdate();
         // The composited bounds of enclosing layers depends on which descendants are composited, so they need a geometry update.
         layer.setNeedsCompositingGeometryUpdateOnAncestors();
     }
@@ -1366,6 +1366,7 @@
     
     bool layerChanged = updateBacking(layer, queryData, CompositingChangeRepaintNow);
     if (layerChanged) {
+        layer.setChildrenNeedCompositingGeometryUpdate();
         layer.setNeedsCompositingLayerConnection();
         layer.setSubsequentLayersNeedCompositingRequirementsTraversal();
         // Ancestor layers that composited for indirect reasons (things listed in styleChangeMayAffectIndirectCompositingReasons()) need to get updated.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to