Given that most examples of Custom Elements are visible elements in the
body and the spec doesn't indicate its example is in the HEAD, this example
will likely increase the number of websites that put HTML Import LINK tags
in the body.

This has two downsides:

1. It's flagged as having errors using the HTML validator recommended by
the WhatWG <http://validator.whatwg.org/>. (Compare the validation results
for 
sync.php<http://html5.validator.nu/?doc=http%3A%2F%2Fstevesouders.com%2Ftests%2Flink-import%2Fsync.php>to
sync-body.php<http://html5.validator.nu/?doc=http%3A%2F%2Fstevesouders.com%2Ftests%2Flink-import%2Fsync-body.php>
where
the only change is moving the LINK from HEAD to BODY.)

2. It's start the HTML Import download later causing rendering delays.

I think it'd be better for the spec *not* to promote patterns with these
negative outcomes. As author, could you change the example? Or at least add
a note saying "this is in the HEAD - you don't want to put LINK tags in the
BODY"?

-Steve



On Wed, Nov 27, 2013 at 11:44 AM, Dimitri Glazkov <dglaz...@google.com>wrote:

> On Wed, Nov 27, 2013 at 11:35 AM, Steve Souders <soud...@google.com>wrote:
>
>> According to the HTML 4 
>> spec<http://www.w3.org/TR/html401/struct/links.html#h-12.1.3>LINK tags must 
>> appear in HEAD:
>>
>> *The LINK element may only appear in the head of a document.*
>>
>>
> We probably need something more modern as a reference here :)
>
> Here's the HTML Living Standard:
>
> http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#the-link-element
>
> "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 :)
>
> The HTML Imports 
> spec<http://www.w3.org/TR/custom-elements/#enqueuing-and-invoking-callbacks>contains
>  the following example:
>>
>>> <me-first></me-first>
>>> <link rel="import" href="import.html">
>>> <me-third></me-third>
>>
>>
>> Is the intention of this example that me-first and me-third occur in the
>> HEAD?
>>
>
> Sure. Nothing precludes the author from using custom elements in HEAD.
>
> :DG<
>
>

Reply via email to