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

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

From: Preston L. Bannister <preston@bannister.us>
Date: Sat, 26 May 2007 15:48:49 -0700
Message-ID: <7e91ba7e0705261548k5b2bfbald575f08c583501bc@mail.gmail.com>
To: "David Hyatt" <hyatt@apple.com>
Cc: "Daniel Glazman" <daniel.glazman@disruptive-innovations.com>, "Dan Connolly" <connolly@w3.org>, "public-html@w3.org WG" <public-html@w3.org>
Perhaps not a great practice, but there is a certain amount of sense in this
usage.  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.  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.

On the other hand, there are all the interesting test cases on MySpace.


On 5/26/07, David Hyatt <hyatt@apple.com> wrote:
>
>
> 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:48:53 UTC

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