W3C home > Mailing lists > Public > www-style@w3.org > October 2011

Re: Selecting the parent of an element

From: Roland Steiner <rolandsteiner@google.com>
Date: Fri, 7 Oct 2011 11:30:44 +0000
Message-ID: <CACFPSpjhFdSL21xDfm-nLdMUC8VnZfU1Mfao9R3qRuPubf+Wpw@mail.gmail.com>
To: Barry van Oudtshoorn <bvanoudtshoorn@gmail.com>
Cc: www-style@w3.org
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

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:05 UTC