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

Re: Suggestion: Inheritance

From: Mikko Rantalainen <mikko.rantalainen@peda.net>
Date: Thu, 19 May 2005 15:30:25 +0300
Message-ID: <428C86E1.10404@peda.net>
To: www-style@w3.org

Hans Meiser wrote:
>>From: Mikko Rantalainen <mikko.rantalainen@peda.net>
>>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.
> 
> 
> According to the example above, the following would apply:
> 
> p { color: span.color; }   /* forward-reference - ignored */
> span { color: p.color; }   /* ignored because not given */
> 
> So only the following CSS rules would apply:
> 
>      .special+p ー color ー blue
>      .div ー color ー red

Seems pretty limited to me. Is this any better than a single-pass 
precompiler?

In addition, you'll run into problems because you decided to use CSS 
selector as a key to reference to. For example:

serif, fantasy /* elements 'serif' and 'fantasy' */
{
	font: "Arial Unicode MS" 1em;
}

fantasy.font /* special class here */
{
	font: "Garamond" 1em;
}

.myspecialclass
{
	font: serif, fantasy.font; /* is this replaced? */
}

Or

p
{
	color: blue;
}

html:nth-of-type(1) > head + body div > table td > p
{
	color: red;
}

html:nth-of-type(1) > head + body div > table td > ul > li
{
	color: html:nth-of-type(1) > head + body div > table td > p.color; 
/* is this supposed to work to get red instead of blue? */
}

It may be pretty easy to implement but if it has no power over a 
single-pass precompiler, it's not worth it.

-- 
Mikko
Received on Thursday, 19 May 2005 12:30:35 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:37 GMT