On Sunday 2006-09-24 17:41 +0300, Mihai Sucan wrote:
> The UA searches for all "form" nodes, then goes for all "input" child
> nodes (not recursively in the tree, only the direct child nodes), then
> picks all of those input child nodes which are not checked, of type=radio.
> Having :parent only "asks" the UA to apply the properties to the parent
> nodes of the picked "input" child nodes. The UA already has the parent
> nodes (the "form" nodes), since it matched them previously to get to the
> inputs.
>
> If this is not how things work now (most likely), then how do they work?
It's not at all the way things work now.
Selectors are processed one *element* at a time. To style an element,
you find all the selectors that match the element. Each selector is
processed from end-to-beginning.
You are describing a model where selectors are processed one selector at
a time. Such a model would require rerunning the entire selection
algorithm every time the document changes.
Your proposals seems to be considerably less useful than previous
parent-selector or ancestor-selector proposals, but no easier to
implement efficiently.
-David
--
L. David Baron <URL: http://dbaron.org/ >
Technical Lead, Layout & CSS, Mozilla Corporation