W3C home > Mailing lists > Public > www-style@w3.org > February 2010

[CSS3] @font vs @background

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Thu, 04 Feb 2010 20:04:46 -0800
Message-ID: <4B6B98DE.7000205@terrainformatica.com>
To: www-style <www-style@w3.org>

As for the moment CSS has three "sequence operators" in its grammar:

1. ' ' (whitespace) - it is a token delimiter and also list
    joining operator.
2. ',' (comma) list joining operator and
3  '/' (slash) list joining operator (used to make single value from
    pair of values).

Problem with space and comma operators.

Consider font and proposed multi-background declaration:

font: 12pt Arial, sans-serif;
background: url(1.gif) repeat, url(2.gif) no-repeat;

For the font, ',' comma, as an operator, has higher precedence
than space and in background it is vice versa - space is of higher
precedence.

This can demonstrated by using "priority" brackets:

font: (12pt) (Arial, sans-serif);
background: (url repeat), (url no-repeat);

(Arial, sans-serif) list is a single value of <font-family>.

Clearly these two properties are using different syntaxes/grammar rules
so parsing of such properties is context (property name) sensitive.

Such situation is highly non-desirable in my opinion. I tend to classify
as a bug of language design.

-- 
Andrew Fedoniouk.

http://terrainformatica.com
Received on Friday, 5 February 2010 04:05:08 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:24 GMT