SVG parser does not interpret "form feed" (U+000C) as white space, CSS parser does.
Placeholder issue for future work
Created attachment 126328 [details] Patch (test only) Patch with a test to verify if form feed is treated as whitespace when used in a transform translate function call. Not intended for review at this time
Comment on attachment 126328 [details] Patch (test only) Could you please post an explanation of why this should work? Different Web specifications have different whitespace definitions.
Comment on attachment 126328 [details] Patch (test only) Attachment 126328 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/11487368 New failing tests: svg/transforms/svg-formFeed-as-whitespace.html
Failure expected, this is a placeholder for a potential future change
As of right now this does not work - I created this issue as a placeholder for future work such that a test could be attached. I apologize for not making this more explicit. The hope is that the SVG parser will be updated to interpret form feed as white space for consistency with CSS. (In reply to comment #3) > (From update of attachment 126328 [details]) > Could you please post an explanation of why this should work? Different Web specifications have different whitespace definitions.
Consistency with CSS is not a great goal in itself. The goals are: 1. security (incorrect whitespace handling is a frequent cause of security bugs); 2. correct rendering of existing web content; 3. compatibility with other browsers behavior; 4. correct implementation of relevant specs. #1 is roughly guaranteed by #3 and #4 when these agree.
In support of goal 4, the SVG WG has agreed to turn the SVG attributes into presentation attributes. As such, these attributes should support the CSS syntax for transformation functions (which would include treating form feed as whitespace). This change will be part of the CSS Transforms (merged version) and SVG 2.0. Please note, I do not plan to land this patch at this time. This was created as a placeholder for future work to capture an early test that can be used to support development. (In reply to comment #7) > Consistency with CSS is not a great goal in itself. The goals are: > 1. security (incorrect whitespace handling is a frequent cause of security bugs); > 2. correct rendering of existing web content; > 3. compatibility with other browsers behavior; > 4. correct implementation of relevant specs. > > #1 is roughly guaranteed by #3 and #4 when these agree.
Created attachment 460336 [details] Safari 15.5 differs from other browsers I took the test case from the attached patch and changed into this JSFiddle: https://jsfiddle.net/v08r7qu1/show When I run it using Safari 15.5 on macOS 12.4, it differs from other browsers as seen in the screenshots. I think aligning with other browsers would be ideal here or web-specs. Thanks!
<rdar://problem/95488677>
*** Bug 267873 has been marked as a duplicate of this bug. ***
PR - https://github.com/WebKit/WebKit/pull/23059 Let's fix this now to align with other browsers.
Committed 273353@main (15c6cea827c0): <https://commits.webkit.org/273353@main> Reviewed commits have been landed. Closing PR #23059 and removing active labels.