Re: [css3-hyperlinks] inclusion of Clink in next WD

Boris Zbarsky wrote:
>>1. Determine what rules match an element, including property matching 
>>rules, in a single set (no rule may be applied more than once, in other 
>>words).
>>2. Determine what rules apply based on specificity and declaration 
>>order, linearly.
> Ah, ok.  So the point is that we draw a distinction between rules matching an
> element and rules applying to the element.  There is no such distinction in CSS
> at this time.  That's a pretty fundamental change.  So all :css[whatever] rules
> match, but not all of them may apply, right?  In fact, whether they apply depends on
> what lower-specificity rules applied.  Of course this involves redefining what
> selectors do (they no longer match an element, really, they control something
> being applied to it).

Well, the way that suggestion was structured, they would apply based on 
what the final result was, not really making the distiction between 
matching and applied rules (or properties, really, since the order goes 
for properties and not entire rules). The intention was really to put 
the resolving of any :css[] selectors after the computation of 
everything else. And really, the :css[] selector was indeed intended to 
match elements with a certain property applied to, not to match the 
actual property.

Hmm, okay, that may not be an option, then. Let's refine the idea a bit.

> Also, this forces rules to be applied in specificity order... that's a good bit
> slower than applying them in reverse specificity order and stopping when you
> have a rule that sets the property you're interested in.

Okay, but how about giving :css[] a specificity level above that of id, 
type and element selectors. Then it would be resolved last. (Though I 
don't have any idea about how to handle !important...)

> One other optimization this defeats is lazy computation of style data.  With
> the proposed setup, it's not an option, since any property in any ruleset
> can affect any other property in a higher-priority ruleset, which may in
> turn affect the original property in a higher-priority ruleset....

Hmm, how about this:
@css property[property{operator}value] media {
     blah;
}
where what @css applies is calculated based on order alone (for each 
defined property inside), and applies to elements after all other style 
has been computed.

Thus, for each property value the effective @css rule to apply can be 
calculated on beforehand, and then apply after the regular selectors 
have already applied?
-- 
David "liorean" Andersson

ViewStyles, ViewScripts, SwitchStyles and GraphicsInfo bookmarklets:
<http://liorean.web-graphics.com/>
Hangouts:
<http://codingforums.com/> <http://yourmusicforums.com/>

Received on Friday, 12 March 2004 06:10:42 UTC