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

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