| Summary: | BackgroundPainter::paintFillLayers should check box-shadow when finding an opaque layer. | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ahmad Saleem <ahmad.saleem792> |
| Component: | Layout and Rendering | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | bfulgham, karlcow, koivisto, ntim, simon.fraser, webkit-bug-importer, zalan |
| Priority: | P2 | Keywords: | BrowserCompat, InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
|
Description
Ahmad Saleem
2023-01-19 17:49:38 PST
There is a FIXME in the source code. https://searchfox.org/wubkat/rev/5b1acc527ab5b10c9d9e4dd21fcec68e315790c2/Source/WebCore/rendering/BackgroundPainter.cpp#122-132 And the code was last edited by antti but the FIXME predates this Adding occlusion detection to reduce overdraw in RenderBox background rendering Justin Novosad, Fri, 23 Nov 2012 18:43:51 +0000 added in https://searchfox.org/wubkat/commit/71cbe979b543bafb933abdd82a03d72df95c7e0e // Stop traversal when an opaque layer is encountered. // FIXME: It would be possible for the following occlusion culling test to be more aggressive // on layers with no repeat by testing whether the image covers the layout rect. // Testing that here would imply duplicating a lot of calculations that are currently done in // BackgroundPainter::paintFillLayer. A more efficient solution might be to move // the layer recursion into paintFillLayer, or to compute the layer geometry here // and pass it down. // The clipOccludesNextLayers condition must be evaluated first to avoid short-circuiting. if (layer->clipOccludesNextLayers(layer == &fillLayer) && layer->hasOpaqueImage(m_renderer) && layer->image()->canRender(&m_renderer, m_renderer.style().effectiveZoom()) && layer->hasRepeatXY() && layer->blendMode() == BlendMode::Normal) break; This compiles and fixes the bug:
&& !boxShadowShouldBeAppliedToBackground(m_renderer, rect.location(), bleedAvoidance, { })
___
Just wanted to share.
(Draft) PR - https://github.com/WebKit/WebKit/pull/25436
Committed 275735@main (b6231f750f4e): <https://commits.webkit.org/275735@main> Reviewed commits have been landed. Closing PR #25436 and removing active labels. |