Re: Cascade: Supplement instead of Overwrite

> But you still have to modify the syntax of each property to say that
> the function can be accepted. For example, just inventing the attr()
> function didn't mean that any property could take it -- it has to be
> explicitly stated in the syntax of the 'content' property.
>
> Maybe this should be changed, but I imagine that would be quite a
> complex task. One of the CSS2 drafts touched on this. One problem is
> that you have to define the return type of the functions -- currently

I don't know about that. All property values are plain text, which represent
the different types. There is no type-casting, and there is no property that
needs to now what type it's value has. If the implementation simply replaces
the function with the returned text of te funtion, just like an author would
put it there, it's impossible to get problems.

> CSS strategically avoids that by only allowing functions in
> predescribed places which know how to cope with each of the functions.
> Once a return type for each function is defined, then you have to
> explicitly say which types each property understands. This is all not
> as obvious as it may seem -- The attr() function, for example, can
> return a string, a URI, a number, a space delimited keyword list, etc.
> But how do you know that it has returned a URI and not a string?
You cannot. But in the rare case this is a problem, you could use
url(attr())
The function 'url()' could be seen as a function that converts an URI to an
URL, and returns the URL as plain text.

Please reread the part about bottom-up and top-down. You misunderstood
bottom-up as being from the bottom of the table you mentioned, where I meant
from lowest specificity to the highest. Maybe there's just a communication
problem, instead of a difference in meaning.

> So, when _is_ the "Value assignments, cascading and inheritance" CSS3
> draft coming out? :-)
No, wait until there's fewer to discuss on this mailing list. This is eating
my free time!

Sjoerd Visscher

Received on Sunday, 10 October 1999 17:15:13 UTC