Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make HTML parser put iframe, audio, video, and canvas nested in SVG in HTML namespace #1996

Closed
birtles opened this issue Nov 1, 2016 · 2 comments

Comments

@birtles
Copy link
Contributor

birtles commented Nov 1, 2016

In SVG 2's section on HTML elements in SVG subtrees has the comment,

Currently, the HTML parser does not recognize these tagnames within an SVG subtree to be HTML-namespaced elements, although this may change in the future. Therefore, in order to include these elements within your SVG, you must either use an XML serialization that recognizes namespace declarations (such as stand-alone SVG or XHTML), or you must create namespaced elements via the createElementNS DOM API method. Alternatively, you can use the foreignObject element to wrap the HTML-namespaced elements; the HTML parser correctly parses HTML elements within a foreignObject.

Is it possible to adjust the HTML parser so that these elements and their children end up in the HTML namespace?

i.e.

<html> <!-- HTML namespace -->
   <svg> <!-- SVG namespace -->
      <iframe> <!-- HTML namespace -->
        <p> <!-- HTML namespace -->
      </iframe>
      <g></g> <!-- SVG namespace -->
   </svg>
</html>

None of these elements are in the list of elements that trigger auto-escaping from SVG (see rules for parsing tokens in foreign content) so I think we're fine from that point of view.

This seems to be much more conservative than any of the things we discussed in the past. (Although I do wonder where we're at with <template> and whether or not we should do something about it at the same time.)

@annevk ?

CC: @nikosandronikos @satakagi @AmeliaBR @heycam

@annevk
Copy link
Member

annevk commented Nov 1, 2016

Duplicate of #919?

@birtles
Copy link
Contributor Author

birtles commented Nov 1, 2016

Yes, thanks!

@birtles birtles closed this as completed Nov 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants