W3C home > Mailing lists > Public > www-style@w3.org > July 2001

Re: @version rule

From: Jeffrey Yasskin <jyasskin@hotmail.com>
Date: Fri, 27 Jul 2001 19:36:03 -0500
To: peter@linss.com, www-style@w3.org
Message-ID: <F1217VoAxRYG6jj69EH00000b29@hotmail.com>
I realize that SOME rules can be worked around by using forward-compatible 
parsing. However, in this list, I have seen many examples of good ideas that 
were shot down because they were not backwards-compatible. Obviously, the 
parsing already built into CSS is not forward-compatible enough. It's a very 
good start, and I don't want to get rid of it, but backwards-compatibility 
is not a good reason to throw out a perfectly good idea.
Also, there is no reason to clutter the document tree in order to hide a 
rule from an older UA.  Workarounds like HTML>P (instead of just P) should 
not have to be used in order to guarantee backwards-compatibility.
An @version rule would be self-documenting and would work with future 
versions of CSS, where selector-based compatibility will dry up as the new 
selectors get more complicated.

BTW, CSS3 UAs SHOULD NOT allow :first-child as it is NOT a valid 
pseudo-element. Unfortunately, they have to allow it since there is no way 
for them to tell if they are viewing a legacy stylesheet. :first-child 
should break in a CSS3 stylesheet in order to encourage authors to comply 
with the spec.

Jeffrey Yasskin

>From: "Peter S. Linss" <peter@linss.com>
>To: www-style@w3.org
>CC: www-style@w3.org
>Subject: Re: @version rule
>Date: Thu, 26 Jul 2001 21:22:26 -0700
>
>The feature is already built in, it's called the cascade and forward
>compatible parsing.
>
>Old user agents ignore rules using newer syntax, if you want fall-back
>behavior you put it in a rule that would otherwise be overridden by the
>cascade.
>
>h1.foo { color: red; } /* a CSS1, 2 or 3 selector */
>h1.foo.bar { color: blue; } /* a CSS2 or 3 selector only, CSS1 doesn't 
>allow
>multiple classes */
>
>The same can also be done for properties within declarations.
>
>h1 { color: red; color: inherit; } /* CSS1 doesn't allow inherit here so it
>will be red, others will inherit */
>
>BTW, CSS3 user agents will still recognize :first-letter as a
>pseudo-element. Legacy pseudo-elements are still allowed to use the old
>syntax.
>
>Jeffrey Yasskin wrote:
>
> > CSS needs something similar to the xsl:version attribute in XSLT whereby
> > a newer user agent can use backwards-compatibility mode for a stylesheet
> > written with an older version of CSS.
> > For instance, the :first-letter pseudo-element is valid CSS1 but not
> > valid CSS3 (it needs to be ::first-letter). A fully compliant browser
> > should accept the single-":" form in a CSS1 stylesheet while rejecting
> > it in a CSS3 stylesheet.
> > CSS could also define a more detailed forward-compatibility mode like
> > XSLT's for cases where the UA knows it doesn't support the current
> > stylesheet based on the version rule.
> > I propose that an @version rule be added of the syntax:
> > @version version-string
> > Where version-string is the version of CSS the stylesheet is written in.
> > "3" for CSS3, "2.1" for a hypothetical CSS 2.1, "17" for CSS17. . .
> > If this works:
> > Once the version of the entire stylesheet has been established,
> > additional @version rules could provide alternative stylesheets for
> > downlevel browsers like so:
> > <code>
> > @version "3";
> > /*CSS 3 selectors here*/
> > @version "2.1"
> > {
> >         /*CSS 2.1 selectors here*/
> > }
> > @version "4"
> > {
> >         /*Some neat CSS 4 feature that completely breaks backwards
> > compatibility*/
> > }
> > /*More CSS 3 selectors here*/
> > </code>
> > I don't know how the cascade should work with these rules.
> >
> > If there's a feature like this already built into CSS, please point me
> > to it.
> >
> > Jeffrey Yasskin
>
>


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
Received on Friday, 27 July 2001 20:36:35 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:10 GMT