Re: LINK only in HEAD?

On 11/27/13 2:44 PM, Dimitri Glazkov wrote:
> "If the rel attribute is used, the element is restricted to the head
> element."
>
> This is part of a non-normative content (a note), so I think we're off
> the hook here :)

No.  The normative bit is sort of scattered around the spec, but for 
example:

http://www.whatwg.org/specs/web-apps/current-work/multipage/sections.html#the-body-element 
says its content model (this part is normative!) is 
http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#flow-content 
which is a whitelist of things that are allowed in <body> and contains:

   link (if the itemprop attribute is present)

So <link> without @itemprop is not allowed as flow content.

The other normative bit is:

   A link element must have either a rel attribute or an itemprop
   attribute, but not both.

which means that if you have a rel you are required to not have 
itemprop, and then you're not flow content per the above normative 
definition of flow content.

In general, Hixie tries hard to not have informative text that's not 
actually supported by normative bits...

That said, this is all only relevant for validation purposes.

 > Nothing precludes the author from using custom elements in HEAD

Unless you want your document to validate, per 
http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#metadata-content

-Boris

Received on Wednesday, 27 November 2013 20:42:20 UTC