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

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 UTC