Bug 117443 - Consider using HTML parser to parse SVG
Summary: Consider using HTML parser to parse SVG
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: BlinkMergeCandidate
Depends on:
Blocks:
 
Reported: 2013-06-10 16:43 PDT by Ryosuke Niwa
Modified: 2014-07-14 08:44 PDT (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2013-06-10 16:43:39 PDT
https://chromium.googlesource.com/chromium/blink/+/b69618018614278cda72077611adc093f460dc57
Parse SVG as HTML

This change switches the SVG parser to be the HTML parser all the time. This
work is being done behind a flag to gauge the potential compat risk.

This is an interesting experiment.
Comment 1 Dirk Schulze 2014-07-12 23:30:19 PDT
The experiment kind of failed.

HTML parser does not allow entities. There are thousands of SVGs out there which use custom XML entities. (Most exported by Illustrator :(.)

Either the HTML parser allows a legacy mode with entities or we can not proceed with this idea.
Comment 2 Philip Rogers 2014-07-13 11:43:35 PDT
(In reply to comment #1)
> The experiment kind of failed.
> 
> HTML parser does not allow entities. There are thousands of SVGs out there which use custom XML entities. (Most exported by Illustrator :(.)
> 
> Either the HTML parser allows a legacy mode with entities or we can not proceed with this idea.

I discussed this with Kouhei and we don't think a basic level of xml entity support would be too hard to implement in the html parser.
Comment 3 Dirk Schulze 2014-07-13 22:24:19 PDT
(In reply to comment #2)
> (In reply to comment #1)
> > The experiment kind of failed.
> > 
> > HTML parser does not allow entities. There are thousands of SVGs out there which use custom XML entities. (Most exported by Illustrator :(.)
> > 
> > Either the HTML parser allows a legacy mode with entities or we can not proceed with this idea.
> 
> I discussed this with Kouhei and we don't think a basic level of xml entity support would be too hard to implement in the html parser.

Does the HTML parser handle renaming of ns shorthands?

Instead of 
    xmlns:xlink="http://www.w3.org/1999/xlink"

this
    xmlns:l="http://www.w3.org/1999/xlink" and l:href

This was another pattern we saw.
Comment 4 Ryosuke Niwa 2014-07-14 08:44:02 PDT
As far as I know, this experiment failed due to XSLT use.