Re: Suggestion: Inheritance

Hans Meiser wrote:
> * A CSS file may be parsed as usual using a single-pass run.
> 
> It's a simple kind of macro expansion: When parsing a back-reference, 
> look-up the corresponding value using /computed/ values from the existing 
> CSS tree.

I thought that CSS *rules* are matched with the *DOM tree*. There's 
no CSS tree, AFAIK. How do you match your "back-reference" to a 
single element in DOM tree to query the computed value from? How do 
you get computed values for potentially all properties with a 
single-pass algorithm - the time you need to "expand" the 
back-reference, you haven't parsed the whole of CSS.

> There is no recursion involved. When a back-reference is being read, its 
> value is immediately computed by the application and only this computed 
> values can be back-referenced later, not the original back-reference link.

I repeat my question:
> p { color: span.color; }
> .special+p {color: blue; }
> span { color: p.color; }

given source fragment

<div>
<p class="special>A</p>
<p><span>B</span></p>
</div>

What is the computed 'color' value for <span> (the string "B")? 
Let's say we have also rule "div { color: red; }" if that makes any 
difference.

-- 
Mikko

Received on Tuesday, 17 May 2005 14:15:47 UTC