Commit cb885be
committed
[LBSE] Apply filters specified on the outermost <svg>
https://bugs.webkit.org/show_bug.cgi?id=321427
Reviewed by Alejandro G. Castro.
A filter on an outermost <svg> was either dropped entirely or set up with the wrong
geometry under the layer-based SVG engine.
RenderLayer::shouldPaintWithFilters() bailed out for any SVG root referencing a
<filter>. That is correct for the legacy engine, where LegacyRenderSVGRoot applies
the referenced filter itself through SVGRenderingContext::prepareToRenderSVGContent()
and the layer must not apply it a second time. The layer-based engine has no such path,
RenderSVGRoot relies on its layer, exactly like an HTML box with 'filter: url(...)' -
so the filter was silently never applied. Fix that behavior for LBSE.
RenderLayerFilters::beginFilterEffect() then treated RenderSVGRoot as a renderer
whose filter lives in SVG user space, seeding the filter region and the reference
box from objectBoundingBox() and scaling by the accumulated SVG ancestor transform.
The outermost <svg> is a replaced element in the CSS box tree: its filter resolves
against its border box, in its container's coordinate system, not against the SVG
user space its children live in - fix that too.
Fixes svg/filters/filter-specified-on-svg-root.html and svg/filters/filter-image-ref-root.html.
* LayoutTests/platform/mac-tahoe-wk2-lbse-text/TestExpectations:
* Source/WebCore/rendering/RenderLayer.cpp:
(WebCore::RenderLayer::shouldPaintWithFilters const):
(WebCore::RenderLayer::paintLayerContents):
* Source/WebCore/rendering/RenderLayerFilters.cpp:
(WebCore::RenderLayerFilters::beginFilterEffect):
(WebCore::RenderLayerFilters::applyFilterEffect):
Canonical link: https://commits.webkit.org/319121@main1 parent 4af3bba commit cb885be
3 files changed
Lines changed: 22 additions & 31 deletions
File tree
- LayoutTests/platform/mac-tahoe-wk2-lbse-text
- Source/WebCore/rendering
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | 52 | | |
54 | 53 | | |
55 | 54 | | |
56 | 55 | | |
57 | | - | |
58 | 56 | | |
59 | 57 | | |
60 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1055 | 1055 | | |
1056 | 1056 | | |
1057 | 1057 | | |
1058 | | - | |
| 1058 | + | |
1059 | 1059 | | |
1060 | 1060 | | |
1061 | 1061 | | |
| |||
3771 | 3771 | | |
3772 | 3772 | | |
3773 | 3773 | | |
| 3774 | + | |
| 3775 | + | |
| 3776 | + | |
| 3777 | + | |
| 3778 | + | |
3774 | 3779 | | |
3775 | 3780 | | |
3776 | 3781 | | |
| |||
3783 | 3788 | | |
3784 | 3789 | | |
3785 | 3790 | | |
3786 | | - | |
3787 | | - | |
3788 | | - | |
3789 | | - | |
3790 | | - | |
3791 | | - | |
3792 | | - | |
3793 | 3791 | | |
3794 | | - | |
| 3792 | + | |
3795 | 3793 | | |
3796 | 3794 | | |
3797 | | - | |
3798 | | - | |
3799 | | - | |
3800 | | - | |
3801 | | - | |
3802 | | - | |
3803 | | - | |
3804 | 3795 | | |
3805 | 3796 | | |
3806 | 3797 | | |
3807 | | - | |
3808 | | - | |
| 3798 | + | |
| 3799 | + | |
| 3800 | + | |
3809 | 3801 | | |
3810 | 3802 | | |
3811 | 3803 | | |
| |||
3933 | 3925 | | |
3934 | 3926 | | |
3935 | 3927 | | |
3936 | | - | |
| 3928 | + | |
3937 | 3929 | | |
3938 | 3930 | | |
3939 | 3931 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
| 172 | + | |
| 173 | + | |
173 | 174 | | |
174 | 175 | | |
175 | 176 | | |
| |||
189 | 190 | | |
190 | 191 | | |
191 | 192 | | |
192 | | - | |
| 193 | + | |
193 | 194 | | |
194 | 195 | | |
195 | 196 | | |
| |||
199 | 200 | | |
200 | 201 | | |
201 | 202 | | |
202 | | - | |
| 203 | + | |
203 | 204 | | |
204 | 205 | | |
205 | 206 | | |
206 | | - | |
| 207 | + | |
207 | 208 | | |
208 | 209 | | |
209 | 210 | | |
| |||
221 | 222 | | |
222 | 223 | | |
223 | 224 | | |
224 | | - | |
| 225 | + | |
225 | 226 | | |
226 | 227 | | |
227 | 228 | | |
228 | 229 | | |
229 | | - | |
| 230 | + | |
230 | 231 | | |
231 | 232 | | |
232 | 233 | | |
233 | 234 | | |
234 | 235 | | |
235 | 236 | | |
236 | | - | |
| 237 | + | |
237 | 238 | | |
238 | 239 | | |
239 | 240 | | |
| |||
258 | 259 | | |
259 | 260 | | |
260 | 261 | | |
261 | | - | |
| 262 | + | |
262 | 263 | | |
263 | 264 | | |
264 | 265 | | |
| |||
270 | 271 | | |
271 | 272 | | |
272 | 273 | | |
273 | | - | |
| 274 | + | |
274 | 275 | | |
275 | 276 | | |
276 | 277 | | |
| |||
294 | 295 | | |
295 | 296 | | |
296 | 297 | | |
297 | | - | |
| 298 | + | |
298 | 299 | | |
299 | 300 | | |
300 | 301 | | |
| |||
0 commit comments