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

Re: Scoped style element questions Re: Unscoped <style> found outside the <head>

From: liorean <liorean@gmail.com>
Date: Tue, 29 May 2007 03:26:01 +0200
Message-ID: <cee13aa30705281826i6e41a5e6iffe0289c31221f09@mail.gmail.com>
To: "HTML WG" <public-html@w3.org>
On 29/05/07, Karl Dubost <karl@w3.org> wrote:
> Le 27 mai 2007 à 17:13, David Hyatt a écrit :
> > This behavior is clearly what Web authors think happens now when
> > they misuse <style> in random spots in the middle of the document.
> > They just think they've thrown some extra rules into the page that
> > will apply to following content.  They don't think that it will
> > retroactively apply to previous content in the page.

> If I understand the two proposals so far.
>
> * Dave Hyatt is saying only what comes after the style element is
> styled, i.e. "content 2" and "div.child"
> * Others: everything inside div.parent is styled.

Wasn't there a third suggestion as well, something along the lines of

    <style scope="scope.identifier.string">...</style>
    [ - - -]
    <elm scope="scope.identifier.string">...</elm>
    <elm><!-- not included in scope--></elm>
    <elm scope="scope.identifier.string">...</elm>

Probably should include that as a third proposal.

> <div class="parent">
>      content 1
>      <style scope="">
>       some CSS rules
>      </style>
>      content 2
>      <div class="child">
>      content 3
>      </div>
> </div>

> Issues:
> * everything inside div.parent
>      - including div.parent?
>      - excluding div.parent?

Sounds like including the parent would be a bad idea to me, because it
would make it much harder to control the design of surrounding
content.

If we include scoping, I think the rule should be that it only applies
to the element itself and siblings after it in the DOM tree. Or
possibly not to the element itself, only to siblings after it.

> * what's happening with a rule like:
>      style {display: block;
>          background:red;}

Is it practical for browser vendors to include the style element
itself in the scoping? If so, I think it should apply.

> * Is an empty element a parent?

How could it be a parent if it has no children? In your example, it's
an earlier sibling, not a parent.

> <div class="parent">
>      <img src="foo" alt="bar">
>      <style scope="">
>       some CSS rules
>      </style>
[snip]
> </div>
-- 
David "liorean" Andersson
Received on Tuesday, 29 May 2007 01:26:04 GMT

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