RESOLVED FIXED 215602
Leading white spaces should be ignored when parsing an SVG list property
https://bugs.webkit.org/show_bug.cgi?id=215602
Summary Leading white spaces should be ignored when parsing an SVG list property
Mathias Bynens
Reported 2020-08-18 02:09:27 PDT
Created attachment 406774 [details] test case showing either a red background (fail) or a green background (pass) This SVG filter definition doesn't have an effect, because Safari apparently cannot handle the newline characters in the `values` attribute value: <filter id="f"> <feColorMatrix values=" 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 1 0"> </filter> Rewriting the attribute value without any newlines (or dynamically updating the attribute value via JS, as done in the attached test case) causes the filter to work as expected: <filter id="f"> <feColorMatrix values="0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 1 0"> </filter> Please support newlines in `<feColorMatrix values>`.
Attachments
test case showing either a red background (fail) or a green background (pass) (697 bytes, text/html)
2020-08-18 02:09 PDT, Mathias Bynens
no flags
test case with simpler workaround (751 bytes, text/html)
2020-08-18 02:19 PDT, Mathias Bynens
no flags
Patch (55.49 KB, patch)
2020-08-26 12:32 PDT, Said Abou-Hallawa
no flags
Mathias Bynens
Comment 1 2020-08-18 02:19:03 PDT
Created attachment 406775 [details] test case with simpler workaround
Mathias Bynens
Comment 2 2020-08-18 02:20:32 PDT
Turns out only the leading newline is problematic. The other newlines don’t need to be removed. Rewriting <filter id="f"> <feColorMatrix values=" 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 1 0"> </filter> as <filter id="f"> <feColorMatrix values="0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 1 0"> </filter> …is a sufficient workaround.
Radar WebKit Bug Importer
Comment 3 2020-08-25 02:10:17 PDT
Said Abou-Hallawa
Comment 4 2020-08-26 12:32:35 PDT
Sam Weinig
Comment 5 2020-08-26 14:45:17 PDT
Comment on attachment 407320 [details] Patch Nice. Our whitespace ignoring for SVG is quite odd, glad to see we improving on inconsistencies here.
EWS
Comment 6 2020-08-26 17:06:35 PDT
Committed r266206: <https://trac.webkit.org/changeset/266206> All reviewed patches have been landed. Closing bug and clearing flags on attachment 407320 [details].
Note You need to log in before you can comment on or make changes to this bug.