Re: Selecting the parent of an element

On Fri, Oct 7, 2011 at 11:23, Barry van Oudtshoorn <bvanoudtshoorn@gmail.com
> wrote:

>
> Hmm. I quite like :has() -- it makes the contents parenthetical. However,
> would it then be possible to do direct descendants using :has() ? That is to
> say, does E:has(F) equate to $E > F or $E F? Can one write E:has(> F) (to my
> eye, that looks odd). Of course, the same question applies to the other
> combinators.
>
> If these issues can be resolved, then I think I'll withdraw my reversed
> combinators proposal in favour of :has().
>

IIRC there was a proposal to use '#' in :matches and :has for the current
node (only in last place for :matches, only in first place for :has). I.e.,
it would be

    E:has(# > F) vs. E:has(# F)

My main question in all of this is: has anyone thought about how to actually
implement this without a) traversing the whole tree twice (once to set
selected styles, once to do inheritance), or b) do a full subtree search
every time on matching :has()? Additionally, how to handle updating of nodes
- it seems ANY node could be affected by changes ANYWHERE in the DOM.


- Roland

Received on Friday, 7 October 2011 11:31:36 UTC