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 14:56:07 -0700
Message-Id: <F6285950-6F29-4C17-BB9B-B2410B34B184@apple.com>
Cc: Dan Connolly <connolly@w3.org>, "public-html@w3.org WG" <public-html@w3.org>
To: Daniel Glazman <daniel.glazman@disruptive-innovations.com>

An unscoped <style> applies to the entire document.  There's no point  
in placing a <style> element in some random place in the <body>,  
since the style rules added will apply to the whole document.  This  
is very bad practice, since an incremental display of a document will  
have to rewind and re-evaluate style on everything seen so far.  If  
the elements are in the <head>, then this re-evaluation doesn't have  
to occur.

Some browsers (and I'm not endorsing this, but just pointing it out  
because this is the end effect achieved anyway) actually move <style>  
elements encountered in the <body> into the <head> during parsing.

<style> outside the <head> is invalid HTML4 as well.

dave

On May 26, 2007, at 3:12 AM, Daniel Glazman wrote:

> Dan Connolly wrote:
>> On Fri, 2007-05-25 at 14:26 -0700, David Hyatt wrote:
>>> Please make this non-conforming.  I don't think we should  
>>> encourage  this bad practice.
>> I wonder who you are directing this request to. You're an editor.
>> If you want the spec to change, please change it and
>> let us know.
>
> Sorry, this is bad for wysiwyg editors and I want to understand
> the rationale behind it. I disagree with the change w/o further
> explanations given here.
>
> </Daniel>
Received on Saturday, 26 May 2007 22:09:08 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:15:59 GMT