<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>253706</bug_id>
          
          <creation_ts>2023-03-10 08:08:24 -0800</creation_ts>
          <short_desc>RenderLayer::hasVisibleContent() incorrect when layer removed</short_desc>
          <delta_ts>2023-03-29 12:34:17 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Layout and Rendering</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ahmad Saleem">ahmad.saleem792</reporter>
          <assigned_to name="Ahmad Saleem">ahmad.saleem792</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>karlcow</cc>
    
    <cc>koivisto</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1940385</commentid>
    <comment_count>0</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-03-10 08:08:24 -0800</bug_when>
    <thetext>Hi Team,

While going through Blink&apos;s commit, I came across another failing test case:

Test case - https://jsfiddle.net/b7kwpvx8/1/

^ Safari Technology Preview 164 show &apos;Red&apos; while Chrome Canary 113 and Firefox Nightly 112 show &apos;Green&apos;.

Blink Commit - https://chromium.googlesource.com/chromium/blink/+/c5587982b1ed1ec62452f5d2c93c0f385a3941a1

WebKit Source - https://searchfox.org/wubkat/source/Source/WebCore/rendering/RenderLayer.cpp#459

Below this WebKit source, in local testing when I add following:

if (renderer().style().visibility() != Visibility::Visible)
        dirtyVisibleContentStatus();

_________

It fixes this bug and show &apos;Green&apos; similar to other browsers.

Appreciate if someone can share input and I am happy to do PR.

Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1942110</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-03-17 09:09:15 -0700</bug_when>
    <thetext>&lt;rdar://problem/106860749&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1944111</commentid>
    <comment_count>2</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2023-03-26 20:59:03 -0700</bug_when>
    <thetext>That looks like a low hanging fruit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1944113</commentid>
    <comment_count>3</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2023-03-26 21:15:41 -0700</bug_when>
    <thetext>Indeed.
diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp
index db8ca3df7421..432a841c61e8 100644
--- a/Source/WebCore/rendering/RenderLayer.cpp
+++ b/Source/WebCore/rendering/RenderLayer.cpp
@@ -475,6 +475,8 @@ void RenderLayer::removeChild(RenderLayer&amp; oldChild)
     if (oldChild.hasBlendMode() || (oldChild.hasNotIsolatedBlendingDescendants() &amp;&amp; !oldChild.isolatesBlending()))
         dirtyAncestorChainHasBlendingDescendants();
 #endif
+    if (renderer().style().visibility() != Visibility::Visible)
+        dirtyVisibleContentStatus();
 }
 
 void RenderLayer::dirtyPaintOrderListsOnChildChange(RenderLayer&amp; child)

shows green.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1944229</commentid>
    <comment_count>4</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-03-27 07:41:04 -0700</bug_when>
    <thetext>(In reply to zalan from comment #3)
&gt; Indeed.
&gt; diff --git a/Source/WebCore/rendering/RenderLayer.cpp
&gt; b/Source/WebCore/rendering/RenderLayer.cpp
&gt; index db8ca3df7421..432a841c61e8 100644
&gt; --- a/Source/WebCore/rendering/RenderLayer.cpp
&gt; +++ b/Source/WebCore/rendering/RenderLayer.cpp
&gt; @@ -475,6 +475,8 @@ void RenderLayer::removeChild(RenderLayer&amp; oldChild)
&gt;      if (oldChild.hasBlendMode() ||
&gt; (oldChild.hasNotIsolatedBlendingDescendants() &amp;&amp;
&gt; !oldChild.isolatesBlending()))
&gt;          dirtyAncestorChainHasBlendingDescendants();
&gt;  #endif
&gt; +    if (renderer().style().visibility() != Visibility::Visible)
&gt; +        dirtyVisibleContentStatus();
&gt;  }
&gt;  
&gt;  void RenderLayer::dirtyPaintOrderListsOnChildChange(RenderLayer&amp; child)
&gt; 
&gt; shows green.

Running through EWS - https://github.com/WebKit/WebKit/pull/12005

Let&apos;s see.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1945047</commentid>
    <comment_count>5</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-03-29 10:53:48 -0700</bug_when>
    <thetext>PR - https://github.com/WebKit/WebKit/pull/12005</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1945070</commentid>
    <comment_count>6</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-03-29 12:34:13 -0700</bug_when>
    <thetext>Committed 262284@main (059e2bb75dc3): &lt;https://commits.webkit.org/262284@main&gt;

Reviewed commits have been landed. Closing PR #12005 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>