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

Re: [css-hierarchies] HTML style attribute

From: François REMY <fremycompany_pub@yahoo.fr>
Date: Tue, 6 Mar 2012 17:04:55 +0100
Message-ID: <0ACA92894F444C3EAF50599CEC7C8782@FREMYD2>
To: <www-style@w3.org>
Good catch. I'm in favor of a new cascading level, too. The issue should be 
reviewed by the Scoped Stylesheets editors.

BTW, here's a blog post I found when searching for the scoped stylesheet 
proposal which is probably worth reading: 
Personnally, I tend to agree. I would prefer to extend the style attribute 
than create a new kind of stylesheet that has many backwards-compatibility 
issues. Allow CSS Hierarchies in the style attribute would be way better 
(because it's ignored by incompatible browsers and not applied to the whole 
document) and would only need the introduction of CSS Hiearchies to have it 
working. Additionnaly, that would discourage large scoped styles (because 
they lay in an attribute which we tend to keep inline) and this is a good 
design-pattern enforcer.

The CSS OM extension API would be very simple: "element.style.cssRule" would 
return the CSS Rule defined by the style attribute, and the CSS Hierarchies 
proposal only have to specify how it interacts with the CSSRule OM (it 
already does).

@Daniel: I don't think this thread is kept alive artificially. There's a 
real issue here because if we wait for too long we'll end up with 
contradictory or bad proposals implemented in browsers with no (easy) way to 
go back. The discussion should happen now, before implementations widen.

-----Message d'origine----- 
From: Boris Zbarsky
Sent: Tuesday, March 06, 2012 4:28 PM
To: www-style@w3.org
Subject: Re: [css-hierarchies] HTML style attribute

On 3/4/12 10:47 AM, Tab Atkins Jr. wrote:
> Good point.  "<el style='foo'>...</el>" can be thought of as a
> shorthand for "<el><style scoped>:scope { foo }</style></el>"

Except for the fact that it has totally different cascading behavior,
right?  Though it's not clear to me whether the cascading behavior of
<style scoped> is the right one...  It would make somewhat more sense if
it cascaded in a separate level similar to inline style, I think.

The other thing to keep in mind when changing what @style does is that
this is one of the few cases where the CSSOM is _very_ widely used.
Which means that how all this stuff is exposed to the CSSOM becomes very
important in terms of evaluating the impact of the change.

Received on Tuesday, 6 March 2012 16:05:23 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:12 UTC