Re: CSS vendor extension issues

Why not view the CSS validator as a 'vendor' and introduce a 
pseudo-element look-alike ':experiment' selector, with the purpose of 
flagging use of experimental properties, simply to avoid validation of 
such features?

   \::experiment, div {foo:*;} /*Validator doesn't validate this*/

The :experiment flag's purpose would in principle only to suppress 
validation error messages while experimenting with (formally invalid) 
experimental properties. Everything that is flagged this way, must be 
experimental. Ordinary properties would be forbidden behind this flag. 
Also, vendor prefixed properties would be forbidden behind such a 
selector:

   \::experiment, div {-webkit-foo:*;} /* Does not validate */

The :experiment selector has the *shape* of a pseudo-element, but does 
not select anything. However, it must be used correctly, like a 
pseudo-element selector, in order to have its intended effect.  
Conforming legacy UAs that do support this selector, must - according 
to the CSS parsing rules - skip over the entire style rule. To assure 
that this works even in IE7, the type selector \: should be either 
RECOMMENDED or REQUIRED.

     :experiment, div {foo:*;} /* Works but should perhaps be invalid */
   \::experiment, div {foo:*;} /* Should be recommended or required */

The main effects of this proposal:

   a) No need for vendor prefixes - good for vendors + authors.
   b) Avoids that experimental properties cause a massive error 
      list during validation = CSS validation becomes useful again
   c) Places the burden of being valid on the author: On that day
      when the status of property 'foo' moves from experimental to
      implemented, nothing changes, except that author must remove
      :experiment selector, if validity is a goal.

   WHAT TO PERHAPS AVOID: 

The following extension of the above perhaps seems tempting:

   * Make experimental properties *require/depend on* being used
     together with the :experiment selector in order to have any
     effect at all. 

But a downside of that option is that when the property becomes 
official, some legacy user agents would still be in need  of the 
:experiment selector, in order to work. Thus the author would have to 
choose between being valid and supporting more UAs. If possible, one 
should not have to make that choice.
-- 
Leif Halvard Silli

Received on Thursday, 10 November 2011 02:35:33 UTC