This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 27304 - Allow <link> in body
Summary: Allow <link> in body
Status: RESOLVED DUPLICATE of bug 27303
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P2 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-11 18:15 UTC by Ilya Grigorik
Modified: 2014-11-12 19:11 UTC (History)
2 users (show)

See Also:


Attachments

Description Ilya Grigorik 2014-11-11 18:15:21 UTC
Current spec: "If the rel attribute is used, the element is restricted to the head element."

http://www.w3.org/TR/html5/document-metadata.html#the-link-element

In practice, developers do not follow above restriction and embed <link>'s in body, and all browsers support this behavior as well. Removing this constraint has multiple benefits: 

1) It allows UA's to stop treating this as an error condition and instead use position of <link rel=stylesheet> in the document as an optimization hint to improve rendering performance - e.g. content above <link> should not block first paint, which is similar to how blocking scripts behave today. Some browsers already implement this behavior, and some sites rely on this behavior to improve painting performance; Baidu experience shows that this can deliver significant perf improvement. 

2) <link rel=import> is already being used in the wild inside of <body> to import HTML and other content.

3) It makes the spec consistent with what's actually implemented and deployed in the wild (by UAs and site developers).

whatwg thread with background discussion: http://lists.w3.org/Archives/Public/public-web-perf/2014Oct/0115.html
Comment 1 Ian 'Hixie' Hickson 2014-11-12 19:11:53 UTC

*** This bug has been marked as a duplicate of bug 27303 ***