A user account is required in order to edit this wiki, but we've had to disable public user registrations due to spam.

To request an account, ask an autoconfirmed user on Chat (such as one of these permanent autoconfirmed members).

Meta element href

From WHATWG Wiki
Jump to navigation Jump to search
Extending the Meta element to support a href attribute that references a current document element id attribute.

Use Case Description

A new href attribute would allow referencing element id's within the document, who's content would replace the meta content.

Current Limitations

The current meta element causes redundant content in many cases. And it is hidden from view usually.

Current Usage and Workarounds

No known current usage of meta href, no workarounds currently known/possible.

Benefits

Avoiding redundancy, meta content is no longer hidden from view, consistent and more varied meta content, humanly readable.

Requests for this Feature

  • [1] WhatWG Mailing list

Proposed Solutions

=== My Solution === (Roger Hågensen)

Allow use of href attribute with meta element, enabling id referencing to replace content attribute with other document content.
<!doctype html>
<html lang="en">
 <head>
  <meta charset="utf-8" />
  <meta name="description" href="#description" />
  <meta name="author" href="#author" />
  <meta name="date" href="#date" />
  <meta name="copyright" href="#copyright" />
  <meta name="keywords" href="#keywords" />
  <title>href extending the meta tags.</title>
 </head>
 <body>
  <article>
   <header>Section header.</header>
   <p id="#description">This is the first paragraph in the document or an aside or some other content perhaps.</p>
   <p>More content here.</p>
   <footer>Author: <a href="example.com/author/url/" id="#author">Roger Hågensen</a> on <time datetime="2010-03-18T08:00:00" id="#date">18th March 2010 at 8 o'clock.</time><br />
   <span id="#copyright">© Roger Hågensen 2010</span><br />
   Keywords: <span id="#keywords"><a href="http://example.com/tag/Example/">Example</a>, <a href="http://example.com/tag/Meta/">Meta</a>, <a href="http://example.com/tag/HTML5/">HTML5</a></span></footer>
  </article>
 </body>
</html>

Processing Model

Validators would check if there is a content or href attribute define for the meta element, content and href are mutually exclusive and validators should show a warning. Browsers and parsers should if both are present, ignore content attribute and use href instead. Parsers/browsers need to look through the all elements of the current document for an id attribute that matches the meta href, if found the content of the element need to have it's tags and any presentational markup stripped so the pure content is available. This stripped content will now be used as if it was the meta content attribute. If the id is not found, or if after stripping the tags of the referenced element the content is empty, then it should be treated the same as if the meta description was either missing or empty.

Limitations

Only local to the document, url's is beyond this spec's current scope and should no be allowed.

Implementation

Browsers, screenreaders and parsers will benefit from this, but more importantly indexers and search engines will benefit even more. As the meta href references an element in the document, which is humanly readable like say the first paragraph, it ensures that the meta description is actually proper page content. Unlike presently where the meta description and keyword and author and copyright and so on are far from usefull or relevant. Many meta keywords or meta description attributes contain sitewide content rather than page relevant content.

Adoption

Improved content displayed in search engine results. Screenreaders will have humanly readable content available. Less bandwidth use due to reduced redundancy. Does not clash with any existing standards.