Bug 77755 - SVG parser does not interpret "form feed" as white space
Summary: SVG parser does not interpret "form feed" as white space
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
: 267873 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-02-03 11:19 PST by Jacob Goldstein
Modified: 2024-01-23 05:35 PST (History)
12 users (show)

See Also:


Attachments
Patch (test only) (3.04 KB, patch)
2012-02-09 10:29 PST, Jacob Goldstein
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
Safari 15.5 differs from other browsers (403.77 KB, image/png)
2022-06-19 08:04 PDT, Ahmad Saleem
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jacob Goldstein 2012-02-03 11:19:15 PST
SVG parser does not interpret "form feed" (U+000C) as white space, CSS parser does.
Comment 1 Jacob Goldstein 2012-02-03 11:19:50 PST
Placeholder issue for future work
Comment 2 Jacob Goldstein 2012-02-09 10:29:35 PST
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 3 Alexey Proskuryakov 2012-02-09 10:54:29 PST
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 4 WebKit Review Bot 2012-02-09 11:04:19 PST
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
Comment 5 Jacob Goldstein 2012-02-09 11:54:22 PST
Failure expected, this is a placeholder for a potential future change
Comment 6 Jacob Goldstein 2012-02-09 12:10:13 PST
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.
Comment 7 Alexey Proskuryakov 2012-02-09 12:57:53 PST
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.
Comment 8 Jacob Goldstein 2012-02-10 13:47:28 PST
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.
Comment 9 Ahmad Saleem 2022-06-19 08:04:33 PDT
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!
Comment 10 Radar WebKit Bug Importer 2022-06-19 08:05:06 PDT
<rdar://problem/95488677>
Comment 11 Ahmad Saleem 2024-01-22 14:48:57 PST
*** Bug 267873 has been marked as a duplicate of this bug. ***
Comment 12 Ahmad Saleem 2024-01-22 14:52:05 PST
PR - https://github.com/WebKit/WebKit/pull/23059

Let's fix this now to align with other browsers.
Comment 13 EWS 2024-01-23 05:35:18 PST
Committed 273353@main (15c6cea827c0): <https://commits.webkit.org/273353@main>

Reviewed commits have been landed. Closing PR #23059 and removing active labels.