Bug 253706
| Summary: | RenderLayer::hasVisibleContent() incorrect when layer removed | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ahmad Saleem <ahmad.saleem792> |
| Component: | Layout and Rendering | Assignee: | Ahmad Saleem <ahmad.saleem792> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | bfulgham, karlcow, koivisto, simon.fraser, webkit-bug-importer, zalan |
| Priority: | P2 | Keywords: | BrowserCompat, InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Ahmad Saleem
Hi Team,
While going through Blink's commit, I came across another failing test case:
Test case - https://jsfiddle.net/b7kwpvx8/1/
^ Safari Technology Preview 164 show 'Red' while Chrome Canary 113 and Firefox Nightly 112 show 'Green'.
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 'Green' similar to other browsers.
Appreciate if someone can share input and I am happy to do PR.
Thanks!
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/106860749>
Karl Dubost
That looks like a low hanging fruit.
alan
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& oldChild)
if (oldChild.hasBlendMode() || (oldChild.hasNotIsolatedBlendingDescendants() && !oldChild.isolatesBlending()))
dirtyAncestorChainHasBlendingDescendants();
#endif
+ if (renderer().style().visibility() != Visibility::Visible)
+ dirtyVisibleContentStatus();
}
void RenderLayer::dirtyPaintOrderListsOnChildChange(RenderLayer& child)
shows green.
Ahmad Saleem
(In reply to zalan from comment #3)
> 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& oldChild)
> if (oldChild.hasBlendMode() ||
> (oldChild.hasNotIsolatedBlendingDescendants() &&
> !oldChild.isolatesBlending()))
> dirtyAncestorChainHasBlendingDescendants();
> #endif
> + if (renderer().style().visibility() != Visibility::Visible)
> + dirtyVisibleContentStatus();
> }
>
> void RenderLayer::dirtyPaintOrderListsOnChildChange(RenderLayer& child)
>
> shows green.
Running through EWS - https://github.com/WebKit/WebKit/pull/12005
Let's see.
Ahmad Saleem
PR - https://github.com/WebKit/WebKit/pull/12005
EWS
Committed 262284@main (059e2bb75dc3): <https://commits.webkit.org/262284@main>
Reviewed commits have been landed. Closing PR #12005 and removing active labels.