Bug 225120

Summary: SVG filter is applied twice when applied to the root <svg> element
Product: WebKit Reporter: Xiaolong Li <lxlstudent>
Component: SVGAssignee: Kiet Ho <kiet.ho>
Status: RESOLVED FIXED    
Severity: Normal CC: dino, kiet.ho, sabouhallawa, simon.fraser, webkit-bug-importer, zimmermann
Priority: P2 Keywords: InRadar
Version: Safari 14   
Hardware: Mac (Intel)   
OS: macOS 11   
URL: https://codepen.io/xiaolong-li/pen/YzNMZpM
See Also: https://bugs.webkit.org/show_bug.cgi?id=260152
https://bugs.webkit.org/show_bug.cgi?id=265465
Bug Depends on:    
Bug Blocks: 260152, 262180    
Attachments:
Description Flags
reduced test case none

Xiaolong Li
Reported 2021-04-27 13:19:51 PDT
The issue happens when defining a filter inside an <svg> element and directly reference/apply it on the <svg> element itself. In this case, Safari seems to "over-apply" the effect, and one guess is that it may have applied the effect twice. This issue doesn't appear in Chrome or Firefox. I also checked SVG spec and this is a legal structure. If I move the filter attribute to a sub-element of the <svg>, then it works correctly. Here is an example in CodePen demonstrating this. Opening it in Safari/Firefox/Chrome to see the difference: https://codepen.io/xiaolong-li/pen/YzNMZpM I found an existing bug (https://bugs.webkit.org/show_bug.cgi?id=139281) that may be related to this, but not sure.
Attachments
reduced test case (537 bytes, text/html)
2023-06-06 13:22 PDT, Said Abou-Hallawa
no flags
Radar WebKit Bug Importer
Comment 1 2021-05-04 13:20:15 PDT
Said Abou-Hallawa
Comment 2 2023-06-06 13:21:08 PDT
This is correct. When the SVGFilter is applied to the <svg> root element, it is applied as an SVGFilter and it is also applied as CSSFilter referencing this SVGFilter.
Said Abou-Hallawa
Comment 3 2023-06-06 13:22:04 PDT
Created attachment 466605 [details] reduced test case
Kiet Ho
Comment 4 2023-06-08 11:22:18 PDT
EWS
Comment 5 2023-06-13 14:26:57 PDT
Committed 265135@main (0dac14ca10cb): <https://commits.webkit.org/265135@main> Reviewed commits have been landed. Closing PR #14780 and removing active labels.
Kiet Ho
Comment 6 2023-06-13 23:42:09 PDT
*** Bug 139281 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.