W3C home > Mailing lists > Public > www-style@w3.org > May 2005

Re: Suggestion: Inheritance

From: Mikko Rantalainen <mikko.rantalainen@peda.net>
Date: Tue, 17 May 2005 11:39:19 +0300
Message-ID: <4289ADB7.4070203@peda.net>
To: www-style@w3.org

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

<p class="special>A</p>

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 

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

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:18 UTC