Re: Proprietary identifier names

Christian Roth writes:

> I see that Microsoft seems to use "mso-" for prefix, whereas Mozilla uses
> "-moz-".

Microsoft's prefix predates the WG's discussions on the topic.


> What route is the recommended way to go? We'd rather not need to change
> the prefix once the product is released.

The latest proposal (unfortunately still not published) is to use

   1. a hyphen or an underscore, followed by
   2. the (possibly abbreviated) name of your company,
   3. another hyphen or underscore, and
   4. the property name

E.g., "-moz-border-radius" if you are Mozilla or "-wap-accesskey" if
you are OMA :-)

Those extensions are meant for local use, they should ideally not be
passed over the public Web, but to reduce any risk of clashes, you
should probably still use a prefix whose length is inversely
proportional to how well-known your company is...

(And, of course, you should not use proprietary extensions at all.)

The initial hyphen is guaranteed never to clash with any official CSS
property, because indeed in the official grammar, an identifier cannot
start with a hyphen. We thought that somebody who needed a proprietary
property would not have much problem with also using a proprietary
tokenizer (the modification is tiny), but apparently it does pose a
problem for some implementations, so we added the underscore
convention. The underscore is a legal initial character, but part of
the proposal is that the CSS WG promises never to use it for any
official property.



Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos/                              W3C/INRIA
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France

Received on Thursday, 20 February 2003 13:12:29 UTC