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

Re: eval()

From: Matthew Brealey <webmaster@richinstyle.com>
Date: Thu, 27 Apr 2000 11:40:37 -0700
Message-ID: <390889A5.18D4@richinstyle.com>
To: www-style@w3.org
Daniel Glazman wrote:
> Matthew Brealey wrote:
>  > Since the value is an integer (in pixels) rather than (say) 12cm, the
>  > issue of 12cm-1 doesn't arise - we have one integer minus another.
> No you don't. You have a length minus a integer without unit.
> Some other people could say that the equation is not homogeneous.
> Please do not read "cast 12cm-1px into pixels" when you have "12cm-1".

No, you have size="1". The *value* is an integer, although it happens to
*represent* a number of pixels.
>  > Yes, I know. I'm talking at the moment as being under CSS3; i.e., under
>  > the UI WD, which redefines content so that this is ok.
> The UI WD allows the use of content in certain cases, not for all
> elements.

No, it allows it in all cases.

>  > One could change this of course, so that the UA effectively validates
>  > twice, and therefore the UA is required when it encounters a
> I don't think so. This single validation process is a major item in CSS
> and I am quite sure that Bert, the Temple's keeper as we say in french,
> will follow me on that point. (hey Bert, don't play with that :-)
> Preserving that is a key element in the promise some people made some
> time ago (we are all getting old...) : CSS will not be a programming
> language.
>  > declaration, either of the type eval() that might turn out to be invalid
>  > or of type that could return a null value, to remember the previous
>  > declaration. For example, if there was BODY {background:  white;
>  > background: eval(attr(bgcolor)) in the UA style sheet, then the UA would
>  > say 'Aha! This might not be valid, I'd best not forget my earlier
>  > declaration'.
> This is simple to write, not so simple to implement. Oh, by the way, it
> breaks the current specificity machanism...

Your objections seem be caused by the manner in which I expressed my
argument: had I said that 'if the attribute hasn't been set, the
declaration is invalid and should be ignored', rather than 'if the
function returns a null value, the declaration is invalid and should be
ignored' I do not think you would have said that it would turn CSS into
a programming language (anymore than had I said if the value for the
declaration hasn't been set (e.g., 'color: '), the declaration should be
ignored (as in fact is the case now), and I think you should now see
that my proposal has got very little to do with programming at all.

But, however, there is a more real problem, and one that has been raised
before, and that is that any kind of UA declaration mapping HTML to CSS
suffers from specificity and order problems. For example, the UI WD
sample style sheet includes its sample UA style sheet declarations of
the form content: attr(value). Such declarations are mapping HTML
formatting attributes, of specificity 0 at start of author style sheet,
to UA style sheets of irrelevant specificity. Clearly this is wrong, and
to allow such declarations, and also those of form
[formatting-attribute=value] {property: value}, more far-reaching
changes to the cascade than the minor (or non-existent) ones for which
you lambast my proposal.

Please visit http://RichInStyle.com. Featuring:
MySite - offer your users customizable styles.
AlwaysWork style - style sheets that always work.
Browser bug table covering all of CSS2 with links to full descriptions.
Lists of more than 1000 browser bugs, plus demonstrations of each.
Websafe Colorizer - view all foreground colors with all backgrounds. 
CSS2, CSS1 and HTML4 tutorials.
CSS masterclass - how to write better style sheets.
CSS2 test suite with 5000++ tests and 300+ test pages.
Received on Thursday, 27 April 2000 06:36:06 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:54 UTC