W3C home > Mailing lists > Public > www-style@w3.org > October 2004

[CSS21] Vendor specific extensions and unary minus

From: Christian Roth <roth@visualclick.de>
Date: Mon, 18 Oct 2004 17:09:11 +0200
To: "www-style Mailing List" <www-style@w3.org>
Message-Id: <20041018160911.7591@mail.visualclick.de>

CSS21 is about to allow identifiers to start with a dash (minus sign)
[1]. This has the funny consequence that ordinary (i.e., not vendor
specific) functions may not have a unary minus.

Example:

Assuming some CSS version will define the function sum( a , b ), then:

  -sum( 2cm , 4cm )

will not be handled as the negative value of sum( 2cm, 4cm ), but as a
function call to a function named "-sum", as the leading dash is
attributed to the {ident} macro used to define the FUNCTION token.

The problem seems solvable by writing it as

 - sum( 2cm ,  4cm )

That, however, is not allowed according to the grammar [2, 'term'
production], which is normative.

It seems that allowing {ident} to start with a dash makes it impossible
to add a unary minus to non-vendor specific functions.

[1] <http://www.w3.org/TR/CSS21/syndata.html#tokenization>
[2] <http://www.w3.org/TR/CSS21/grammar.html#q1>

Regards, Christian.
Received on Monday, 18 October 2004 15:09:48 GMT

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