W3C home > Mailing lists > Public > www-style@w3.org > June 2014

Re: Cross Referencing Between Elements

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Sat, 14 Jun 2014 12:53:54 -0700
Message-ID: <CAAWBYDBEZp0KXe_dk-2Bu1LLMOYHcAg2EoaJnkWTyBg0W_3S6w@mail.gmail.com>
To: Bobby Mozumder <mozumder@futureclaw.com>
Cc: Boris Zbarsky <bzbarsky@mit.edu>, Marat Tanalin <mtanalin@yandex.ru>, Brian Blakely <anewpage.media@gmail.com>, "www-style@w3.org" <www-style@w3.org>
On Sat, Jun 14, 2014 at 8:40 AM, Bobby Mozumder <mozumder@futureclaw.com> wrote:
> Not sure how I’d reference the state of another element with this right-hand
> spec proposal.  I’ve had several times where i needed at least simple cross
> references to just things like :hover.
>
> For example, change the color of an element based on if some other element
> in the DOM tree has :hover on it, or :active.  I don’t see how a selector on
> the right-hand side can select that state. (maybe store the state in the
> source element as a variable?)
>
> CSS does need a stateful representational model that perhaps includes
> time-domain considerations and variable storage… this could get rid of a lot
> of Javascript usage.

The issue here is that these kinds of things make it *far* more
complicated to resolve CSS efficiently, and we can still only give you
abilities for a small handful of use-cases, because declarative models
are hard to extend.  JS is still the right thing to use for lots of
these dynamic use-cases, and will probably always be.

~TJ
Received on Saturday, 14 June 2014 19:54:41 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:22 UTC