Re: Inline SVG: Embedded vs. Metadata Content Distinction (Was: Fwd: Allow Select SVG Elements In <head>)

"Tab Atkins Jr." <[email protected]>
Newsgroups gmane.org.w3c.whatwg.discuss,gmane.comp.web.svg
Message-ID <CAAWBYDCkpq9GvZu6fYm7FjOrpinVbaejkw9neomCkx=VugRedg@mail.gmail.com>
On Sat, Aug 29, 2015 at 12:51 AM, Hugh Guiney <[email protected]> wrote:
> Bueller...? Bueller...?
>
> This request is almost 5 years old now, but it is even more relevant today,
> now that web developers are increasingly embracing SVG for purposes of
> responsive design and accommodating HiDPI displays.
>
> Putting SVG <defs> and other metadata-related elements in HTML's <head>
> seems like an obvious choice from a semantic standpoint. But it is currently
> illegal in the HTML spec because SVG does not distinguish between embedded
> and metadata content models for its elements, which Hixie has requested so
> that the HTML spec can simply point to the SVG spec's definitions. (Please
> see quoted text.)
>
> Again, is this something the SVG WG is willing to do?

This isn't even something for the SVGWG to decide; it's simply
impossible to add new elements to HTML's <head>.  <head> autocloses
when it sees any element that's not <title>, <meta>, <link>, <script>,
or <style>, and people depend on this behavior - there's definitely
pages out there where an <svg> element is the first content and needs
to be displayed.

Just put a <defs>-only <svg> in the <body>.  Its location doesn't
actually matter, it's fine.

~TJ
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.