Summary: | Leading white spaces should be ignored when parsing an SVG list property | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Mathias Bynens <mathias> | ||||||||
Component: | SVG | Assignee: | Said Abou-Hallawa <sabouhallawa> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | dino, ews-watchlist, fmalita, gyuyoung.kim, mathias, mmaxfield, pdr, sabouhallawa, sam, schenney, sergio, webkit-bug-importer, zimmermann | ||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||
Version: | WebKit Nightly Build | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Attachments: |
|
Created attachment 406775 [details]
test case with simpler workaround
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. Created attachment 407320 [details]
Patch
Comment on attachment 407320 [details]
Patch
Nice. Our whitespace ignoring for SVG is quite odd, glad to see we improving on inconsistencies here.
Committed r266206: <https://trac.webkit.org/changeset/266206> All reviewed patches have been landed. Closing bug and clearing flags on attachment 407320 [details]. |
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>`.