W3C home > Mailing lists > Public > public-html@w3.org > May 2007

Re: Unscoped <style> found outside the <head>

From: David Hyatt <hyatt@apple.com>
Date: Sat, 26 May 2007 21:08:30 -0700
Message-Id: <81345923-1381-4F5C-8035-EAFA2C254272@apple.com>
Cc: Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Dan Connolly <connolly@w3.org>, "public-html@w3.org WG" <public-html@w3.org>
To: Preston L. Bannister <preston@bannister.us>

On May 26, 2007, at 3:48 PM, Preston L. Bannister wrote:

> Perhaps not a great practice, but there is a certain amount of  
> sense in this usage.

In HTML4 yes, since <style> could not be scoped.  In HTML5, with the  
addition of scoped <style>, unscoped style no longer makes sense  
outside of the <head>.

> If a page is dynamically assembled from multiple somewhat- 
> independent sources, then the need for dropping in new <style> at  
> the point the fragment is inserted into the page is understandable.

Yes, but it should be scoped.

> Not great for the browser implementors, but if in practice class  
> names are chosen so that the <style> only apply to the included  
> fragment, then effect should be limited in scope.

That's what scoping does.  To reiterate, I am proposing that unscoped  
style outside of the head be non-conformant, but that scoped style is  

Scoped style is a new feature of HTML5.


I am proposing that <style scoped> be allowed anywhere, but that  
<style> should only be conforming if used inside the head.  I do not  
believe anyone has presented a valid use case for using unscoped  
<style> outside of the <head>, and given the performance impact it  
will have on the display of Web pages, the practice should be  
strongly discouraged.

I think "scoped" should be even more limited than it already is, and  
that the HTML5 spec should limit the scoping to nodes that follow the  
<style> in a pre-order traversal of the tree.

Received on Sunday, 27 May 2007 04:31:39 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 9 October 2021 18:44:13 UTC