W3C home > Mailing lists > Public > www-style@w3.org > June 2012

Re : [css3-values] nesting calc()

From: François REMY <fremycompany_pub@yahoo.fr>
Date: Wed, 20 Jun 2012 09:46:45 +0100 (BST)
Message-ID: <1340182005.72690.YahooMailNeo@web171603.mail.ir2.yahoo.com>
To: "Kang-Hao \(Kenny\) Lu" <kennyluck@csail.mit.edu>
Cc: fantasai <fantasai.lists@inkedblade.net>, "www-style@w3.org" <www-style@w3.org>
-- HS: attr() is returning a string? Wow, what a misused potential. Never noticed it.
My concern is that
    animation: compute (15s - 3s);
is a valid animation declaration right now (if we suppose the 'calc' to be implied). However, if we introduce a 'compute' function, it will be a breaking change in the language: the animation declaration will not work anymore, because it's going to be read as a call to the 'compute' function which may do something completely different than the initial purpose.
This will probably lead to one ofthose  two possible consequences: 
(a) we're going to restrict the scope of new functions to places that are not preceeded by an identifier.
(b) we're going to modify the meaning of values when we introduce new functions. 
Both of them are a concern for me. But maybe there's a trick I didn't notice that makes my concern invalid.

----- Mail original -----
De : Kang-Hao (Kenny) Lu <kennyluck@csail.mit.edu>
À : François REMY <fremycompany_pub@yahoo.fr>
Cc : fantasai <fantasai.lists@inkedblade.net>; www-style@w3.org
Envoyé le : Mercredi 20 juin 2012 9h58
Objet : Re: [css3-values] nesting calc()

(12/06/20 15:45), François REMY wrote:
> I'm not an expert in CSS syntax but it seems to be a dangerous idea. Is
> there a way in CSS to distinguish a function from an identifier followed
> by parenthized expression? Example:
>    animation: attr(anim);
> and:
>    animation: myAnim (15s - 3s);
> ?

Probably no, but I am not exactly sure what your concern is.

Are you saying that people would be tempted to do

  margin: auto(100% - 1em);

and get wrong? If that's the case, why wouldn't people get wrong by thinking

  margin: auto1em;

would work? Is is the parenthesis notation that allures the authors to
drop the whitespace in the middle?

(In your example, "animation: attr(anim);" isn't valid because
"attr(anim)" is a <string>.)

Received on Wednesday, 20 June 2012 08:47:19 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:00 UTC