W3C home > Mailing lists > Public > public-html@w3.org > July 2015

HTML5 proposal: allow <meta name="..." content="..." /> outside of <head>

From: Derek Gray <dgray90@live.com>
Date: Mon, 27 Jul 2015 15:44:04 -0500
Message-ID: <COL125-W4184909EE36EFBE1F1AE8BC38E0@phx.gbl>
To: "public-html@w3.org" <public-html@w3.org>
According to the HTML5 specification, the meta element is not 'allowed' outside of a head element, even though the parsing model allows for the placement of meta elements within contexts that are parsed with the 'in body' insertion mode without any fostering. The 'itemprop' attribute has been specified for the meta element in the HTML5.1 nightly draft along with language that permits the meta element to be present where flow or phrasing content are expected as long as the attribute is present -- this development takes advantage of the aforementioned aspect of the HTML5 parsing model.

The 'itemprop' attribute then renders the meta element as officially usable in a document's body, but the attribute originates from and belongs to the Microdata specification -- so use of the attribute has certain requirements and implications such as needing an 'itemscope' somewhere or point to an 'itemref' when the element's value should not apply to the directly inherited 'itemscope'.

I would like to propose that, if the name attribute is present, the meta element should fall under the categories of metadata, flow and phrasing content, and should be allowed in contexts where metadata or phrasing content is expected. This is because as it stands, document authors have no specification-compliant means of including machine-readable metadata within the body of a document without doing one of the following:

- Using an existing element's text content and hiding the element with the 'hidden' attribute or CSS
- Using an existing element's 'data-' attributes
- Using a script element with an alternate 'type'
- Using an HTML comment (with Javascript wizardry to hack the information out of it)

The element is there, the attributes are there, the parsing model is there. Can this be allowed?

Received on Monday, 27 July 2015 20:44:32 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 9 October 2021 18:46:14 UTC