Title: [281364] trunk/Source/WebCore
Revision
281364
Author
[email protected]
Date
2021-08-20 22:53:25 -0700 (Fri, 20 Aug 2021)

Log Message

Walk up stacking contexts in RenderLayerBacking::compositingOpacity
https://bugs.webkit.org/show_bug.cgi?id=229350

Reviewed by Simon Fraser.

Shorter way to do the same thing, since stackingContext() chain is top-layer aware and opacity creates stacking contexts anyway.

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::compositingOpacity const):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (281363 => 281364)


--- trunk/Source/WebCore/ChangeLog	2021-08-21 05:25:07 UTC (rev 281363)
+++ trunk/Source/WebCore/ChangeLog	2021-08-21 05:53:25 UTC (rev 281364)
@@ -1,3 +1,15 @@
+2021-08-20  Tim Nguyen  <[email protected]>
+
+        Walk up stacking contexts in RenderLayerBacking::compositingOpacity
+        https://bugs.webkit.org/show_bug.cgi?id=229350
+
+        Reviewed by Simon Fraser.
+
+        Shorter way to do the same thing, since stackingContext() chain is top-layer aware and opacity creates stacking contexts anyway.
+
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::compositingOpacity const):
+
 2021-08-20  Alan Bujtas  <[email protected]>
 
         [IFC][Integration] canUseForLineLayoutWithReason's establishesInlineFormattingContext should check against inflow content

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (281363 => 281364)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2021-08-21 05:25:07 UTC (rev 281363)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2021-08-21 05:53:25 UTC (rev 281364)
@@ -2430,21 +2430,12 @@
 {
     float finalOpacity = rendererOpacity;
 
-    // Top layer elements should not be affected by parent elements opacity
-    if (m_owningLayer.establishesTopLayer())
-        return finalOpacity;
-    
-    for (auto* curr = m_owningLayer.parent(); curr; curr = curr->parent()) {
-        // We only care about parents that are stacking contexts.
-        // Recall that opacity creates stacking context.
-        if (!curr->isCSSStackingContext())
-            continue;
-        
+    for (auto* curr = m_owningLayer.stackingContext(); curr; curr = curr->stackingContext()) {
         // If we found a compositing layer, we want to compute opacity
         // relative to it. So we can break here.
         if (curr->isComposited())
             break;
-        
+
         finalOpacity *= curr->renderer().opacity();
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to