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

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  
ok.

Scoped style is a new feature of HTML5.

http://www.whatwg.org/specs/web-apps/current-work/#the-style

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.

dave
(hyatt@apple.com)

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