Title: [236632] trunk
Revision
236632
Author
[email protected]
Date
2018-09-28 18:53:34 -0700 (Fri, 28 Sep 2018)

Log Message

RenderLayer::removeOnlyThisLayer() should not call updateLayerPositions()
https://bugs.webkit.org/show_bug.cgi?id=190093

Reviewed by Dean Jackson and Zalan Bujtas.

Source/WebCore:

It's wrong for RenderLayer::removeOnlyThisLayer() to call updateLayerPositions(),
because this is called at style update time, and layout will be stale.

It was added (see webkit.org/b/25252) so that opacity changes, which can destroy layers, correctly update
descendants. However, RenderStyle::changeRequiresLayout() checks for opacity <=> no opacity
changes and triggers layout accordingly, which will result in a full post-layout
updateLayerPositions().

This also revealed that changes to the "isolate" property fail to trigger any kind of style recalc or layout;
we need it to trigger layout (for now) because it affects z-order.

Covered by existing tests.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::removeOnlyThisLayer):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresLayout const):

LayoutTests:

The ordering of the repaints changes.

blend-mode-turn-off-isolation-no-effect.html now issues a repaint, which is expected now.
Isolation is so rare that this is not a problem.

* css3/blending/repaint/blend-mode-isolate-stacking-context-expected.txt:
* css3/blending/repaint/blend-mode-turn-off-isolation-expected.txt:
* css3/blending/repaint/blend-mode-turn-off-isolation-no-effect-expected.txt:
* fast/repaint/absolute-position-change-containing-block-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (236631 => 236632)


--- trunk/LayoutTests/ChangeLog	2018-09-29 01:38:26 UTC (rev 236631)
+++ trunk/LayoutTests/ChangeLog	2018-09-29 01:53:34 UTC (rev 236632)
@@ -1,3 +1,20 @@
+2018-09-28  Simon Fraser  <[email protected]>
+
+        RenderLayer::removeOnlyThisLayer() should not call updateLayerPositions()
+        https://bugs.webkit.org/show_bug.cgi?id=190093
+
+        Reviewed by Dean Jackson and Zalan Bujtas.
+        
+        The ordering of the repaints changes.
+        
+        blend-mode-turn-off-isolation-no-effect.html now issues a repaint, which is expected now.
+        Isolation is so rare that this is not a problem.
+
+        * css3/blending/repaint/blend-mode-isolate-stacking-context-expected.txt:
+        * css3/blending/repaint/blend-mode-turn-off-isolation-expected.txt:
+        * css3/blending/repaint/blend-mode-turn-off-isolation-no-effect-expected.txt:
+        * fast/repaint/absolute-position-change-containing-block-expected.txt:
+
 2018-09-28  Devin Rousso  <[email protected]>
 
         Web Inspector: crash in InspectorNetworkAgent::didReceiveResponse when loading denied x-frame resources

Modified: trunk/LayoutTests/css3/blending/repaint/blend-mode-isolate-stacking-context-expected.txt (236631 => 236632)


--- trunk/LayoutTests/css3/blending/repaint/blend-mode-isolate-stacking-context-expected.txt	2018-09-29 01:38:26 UTC (rev 236631)
+++ trunk/LayoutTests/css3/blending/repaint/blend-mode-isolate-stacking-context-expected.txt	2018-09-29 01:53:34 UTC (rev 236632)
@@ -20,7 +20,6 @@
   (rect 28 290 60 60)
   (rect 48 290 60 60)
   (rect 28 290 60 60)
-  (rect 48 290 60 60)
   (rect 28 526 60 60)
   (rect 48 526 60 60)
   (rect 48 408 60 60)
@@ -28,10 +27,11 @@
   (rect 48 644 60 60)
   (rect 68 644 60 60)
   (rect 48 644 60 60)
-  (rect 68 644 60 60)
   (rect 28 290 60 60)
   (rect 48 644 60 60)
+  (rect 48 290 60 60)
   (rect 28 526 60 60)
   (rect 88 644 20 60)
+  (rect 68 644 60 60)
 )
 

Modified: trunk/LayoutTests/css3/blending/repaint/blend-mode-turn-off-isolation-expected.txt (236631 => 236632)


--- trunk/LayoutTests/css3/blending/repaint/blend-mode-turn-off-isolation-expected.txt	2018-09-29 01:38:26 UTC (rev 236631)
+++ trunk/LayoutTests/css3/blending/repaint/blend-mode-turn-off-isolation-expected.txt	2018-09-29 01:53:34 UTC (rev 236632)
@@ -3,7 +3,8 @@
 (repaint rects
   (rect 8 68 100 100)
   (rect 58 68 100 100)
+  (rect 8 68 100 100)
+  (rect 8 68 100 100)
   (rect 58 68 100 100)
-  (rect 8 68 100 100)
 )
 

Modified: trunk/LayoutTests/css3/blending/repaint/blend-mode-turn-off-isolation-no-effect-expected.txt (236631 => 236632)


--- trunk/LayoutTests/css3/blending/repaint/blend-mode-turn-off-isolation-no-effect-expected.txt	2018-09-29 01:38:26 UTC (rev 236631)
+++ trunk/LayoutTests/css3/blending/repaint/blend-mode-turn-off-isolation-no-effect-expected.txt	2018-09-29 01:53:34 UTC (rev 236632)
@@ -1,3 +1,6 @@
 This test checks that removing isolation from an element being stacking context for other reasons will not trigger any repaint.
 
+(repaint rects
+  (rect 8 68 100 100)
+)
 

Modified: trunk/LayoutTests/fast/repaint/absolute-position-change-containing-block-expected.txt (236631 => 236632)


--- trunk/LayoutTests/fast/repaint/absolute-position-change-containing-block-expected.txt	2018-09-29 01:38:26 UTC (rev 236631)
+++ trunk/LayoutTests/fast/repaint/absolute-position-change-containing-block-expected.txt	2018-09-29 01:53:34 UTC (rev 236632)
@@ -2,11 +2,11 @@
   (rect 8 5000 100 100)
   (rect 108 5100 100 100)
   (rect 8 5000 100 100)
-  (rect 108 5100 100 100)
-  (rect 100 100 100 100)
   (rect 8 8 784 2000)
   (rect 16 5008 100 100)
   (rect 16 5008 100 100)
   (rect 8 8 100 100)
+  (rect 108 5100 100 100)
+  (rect 100 100 100 100)
 )
 

Modified: trunk/Source/WebCore/ChangeLog (236631 => 236632)


--- trunk/Source/WebCore/ChangeLog	2018-09-29 01:38:26 UTC (rev 236631)
+++ trunk/Source/WebCore/ChangeLog	2018-09-29 01:53:34 UTC (rev 236632)
@@ -1,3 +1,28 @@
+2018-09-28  Simon Fraser  <[email protected]>
+
+        RenderLayer::removeOnlyThisLayer() should not call updateLayerPositions()
+        https://bugs.webkit.org/show_bug.cgi?id=190093
+
+        Reviewed by Dean Jackson and Zalan Bujtas.
+        
+        It's wrong for RenderLayer::removeOnlyThisLayer() to call updateLayerPositions(),
+        because this is called at style update time, and layout will be stale.
+        
+        It was added (see webkit.org/b/25252) so that opacity changes, which can destroy layers, correctly update
+        descendants. However, RenderStyle::changeRequiresLayout() checks for opacity <=> no opacity
+        changes and triggers layout accordingly, which will result in a full post-layout
+        updateLayerPositions().
+        
+        This also revealed that changes to the "isolate" property fail to trigger any kind of style recalc or layout;
+        we need it to trigger layout (for now) because it affects z-order.
+
+        Covered by existing tests.
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::removeOnlyThisLayer):
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::changeRequiresLayout const):
+
 2018-09-28  Jiewen Tan  <[email protected]>
 
         [WebAuthN] Polish WebAuthN auto-test environment

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (236631 => 236632)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2018-09-29 01:38:26 UTC (rev 236631)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2018-09-29 01:53:34 UTC (rev 236632)
@@ -1751,9 +1751,6 @@
         removeChild(current);
         m_parent->addChild(current, nextSib);
         current->setRepaintStatus(NeedsFullRepaint);
-        // updateLayerPositions depends on hasLayer() already being false for proper layout.
-        ASSERT(!renderer().hasLayer());
-        current->updateLayerPositions(); // FIXME: use geometry map.
         current = next;
     }
 

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (236631 => 236632)


--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2018-09-29 01:38:26 UTC (rev 236631)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2018-09-29 01:53:34 UTC (rev 236632)
@@ -784,6 +784,13 @@
         return true;
     }
 
+#if ENABLE(CSS_COMPOSITING)
+    if (m_rareNonInheritedData->isolation != other.m_rareNonInheritedData->isolation) {
+        // Ideally this would trigger a cheaper layout that just updates layer z-order trees (webit.org/b/190088).
+        return true;
+    }
+#endif
+
     if (m_rareNonInheritedData->hasFilters() != other.m_rareNonInheritedData->hasFilters())
         return true;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to