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

Allow whitespace after "rect" function identifier (was: http://www.w3.org/TR/REC-CSS2/visufx.html)

From: Thomas 'PointedEars' Lahn <PointedEars@web.de>
Date: Sat, 03 Apr 2004 15:56:12 +0200
Message-ID: <406EC27C.5000706@PointedEars.de>
To: www-style@w3.org
Philip TAYLOR wrote:
> The "real benefit" that I perceive, and the reason underlying my
> original request, is that some programmers /as a matter of course/
> separate function/procedure names from a following parenthesis
> by a space, because they believe that it makes the code more
> readable.  Such programmers, when writing CSS, would tend to
> insert a space between "clip" and the following parenthesis as
> a matter of course, and then be confused when a user agent fails
> to honour their intentions.  Since no ambiguity could result from
> the allowing of white space at this point, I respectfully ask that
> the specs. be amended to allow white space in this and all analogous
> contexts when they are next revised.

Besides CSS being AIUI not a programming language and thus there are no
"CSS programmers" (but only CSS authors), style guides for programming
languages usually recommend to write whitespace before paranthesed
expressions only if it fits the previous code.  The "Code Conventions
for the Java Programming Language" [1], e.g., recommend to write
whitespace before conditional expressions being used as arguments of
conditional statements (in general: keywords followed by paranthesis):

  ... if (x) ...

to distinguish them clearly from method calls where the whitespace
should be left out:

  ... foobar(x) ...

Since rect(...) is defined as a function by section 4.1.1 of the CSS2
Specification and its upcoming revision 1, when it comes to code style
and thus legibility of code, it is IMO correct to disallow whitespace here.

On the other hand, since CSS is not a programming language and the
"clip" property is a standalone one, I would not mind if whitespace
would be allowed there, but not to be recommended anyway.  However,
this nevertheless requires careful consideration: if "clip" is likely
to become part of a composed property (like "border"), the allowed
whitespace would then aggravate parsing of the value of that property.

\V/ PointedEars
[1] http://java.sun.com/docs/codeconv/html/CodeConventions.doc7.html#682

Received on Saturday, 3 April 2004 08:55:52 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:12 UTC