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

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

From: Maciej Stachowiak <mjs@apple.com>
Date: Tue, 29 May 2007 13:07:43 -0700
Message-Id: <329BCA97-2CAF-4987-912A-197252F95A36@apple.com>
Cc: David Hyatt <hyatt@apple.com>, "Preston L.Bannister" <preston@bannister.us>, Dan Connolly <connolly@w3.org>, "public-html@w3.org WG" <public-html@w3.org>
To: Daniel Glazman <daniel.glazman@disruptive-innovations.com>


On May 27, 2007, at 2:52 AM, Daniel Glazman wrote:

>
> People don't always put a style element to apply to elements after  
> them,
> they also often put the style element right after... Example
>
>     <div id="foo">...</div>
>     <style>#foo h1 { color : red }</style>
>
> So, let me summarize.
> If you make all styles in the body scoped, such pages will break.
> If you make all styles in the body apply in pre-order traversal tree,
> some pages will break and it's just totally ugly design that many  
> people
> will not understand.

Although you said you understood what Dave meant by his proposal,  
your objections seem to be based on a different understanding than mine.

I think what Dave was proposing as follows:

1) For purposes of user agent conformance, <style> elements in the  
body would behave exactly as they do in browsers today, they would be  
processed and would apply to the whole document.

2) For purposes of document conformance, the new <style scoped>  
feature in the HTML5 draft would be allowed anywhere in the document  
- this is already true in the draft. <style scoped> is a new kind of  
style element and applies only to its immediate parent and contents  
below.

3) For purposes of document conformance, <style> without the brand- 
new scoped attribute would not be allowed outside the <head>, since  
for efficiency it is better to avoid re-resolving styles, so we  
should encourage authors to put global styles in the head, so it  
appears before any incremental rendering has taken place.

4) The definition of <style scoped> could possibly be changed to  
affect only following siblings, and not the parent or previous  
siblings, to ensure that style resolution in this case is always  
backwards-looking only.

#4 is pretty separate from the others.

I think the confusion stems from the use of the term "scoped style",  
it is talking about a new feature, not changing behavior of existing  
style blocks.

In particular, I don't think dave proposed to do anything to "all  
styles in the body".

Regards,
Maciej
Received on Tuesday, 29 May 2007 20:07:58 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:38:44 UTC