W3C home > Mailing lists > Public > www-style@w3.org > December 2012

Re: [css3-cascade] style attribute should override scoped style sheets

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Sun, 2 Dec 2012 09:16:28 -0800
Message-ID: <CAAWBYDCKEVX5VRuR-mv7HO-XAURkyR-OXyYnZ3hF93msYyp8Bg@mail.gmail.com>
To: "L. David Baron" <dbaron@dbaron.org>
Cc: www-style list <www-style@w3.org>
On Sun, Dec 2, 2012 at 12:20 AM, L. David Baron <dbaron@dbaron.org> wrote:
> http://dev.w3.org/csswg/css3-cascade/#cascade defines cascading for
> scoped style sheets so that the depth of scope nesting increases
> importance in the cascade (overriding specificity).  This is good.
>
> However, it doesn't assign any extra bump to style attributes.
> Previously style attributes were described as having extra
> specificity, though their behavior was equivalent to being a
> separate origin.
>
> Now that scoping is a part of the cascade, I think style attributes
> should have their role in the cascade be defined either in terms of
> scoping or (my preference) as a separate origin, so that in this
> HTML markup,
>
>   <div>
>     <!-- a scoped style sheet applying to the div and its contents -->
>     <style scoped>
>       p { color: red }
>     </style>
>     <p style="color: green">
>       this should be green.
>     </p>
>   </div>

Makes sense to me.  I think, though, that it makes the most sense as
tying into scoping.  If we ever do the requested extension to the
style attribute where you can embed rulesets, we'll want a style
attribute on the child to override the style attribute on a parent
targetting the child.

~TJ
Received on Sunday, 2 December 2012 17:17:35 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:03 GMT