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

Re: :scroll() A proposal for a new Css pseudoclass

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 17 Jun 2014 15:01:14 -0700
Message-ID: <CAAWBYDBu5BGaaHeW+PhHQQcD3evx1-4eWAiA8tTu47sXrNXUOw@mail.gmail.com>
To: Fran├žois REMY <francois.remy.dev@outlook.com>
Cc: "Kseso?" <kseso9@gmail.com>, www-style list <www-style@w3.org>
On Tue, Jun 17, 2014 at 2:19 PM, Fran├žois REMY
<francois.remy.dev@outlook.com> wrote:
>> 2. There's still a bit of circular dependency possible, since whether
>> or not :scroll() works on an element depends on if the element is
>> scrollable at all.  You can set "overflow:visible" from a :scroll()
>> rule, which is problematic.  This one's a bit more direct and easier
>> to address, though - we could probably fix it in the way I outline at
>> <https://tabatkins.github.io/specs/css-toggle-states/#checked-problems>,
>> where "overflow" becomes a selector-affecting property and :scroll()
>> is a property-affected selector.
>> ~TJ
> Well, I think the issue is way worse.
>    div { width: 100px; height: 100px; }
>    div > div { width: 50px; height: 120px; margin: auto; }
>    div:scroll(more than 1px from the vertical axis) > div { display: none; }
> I'm pretty sure I can imagine a case where the parent div does overflow of
> "N" pixels when ":scroll(Npx)" starts to match, but has only "N-1" pixels of
> overflow after it is matched, so the scroll is moved automatically to the
> new maximum (N-1) then the rule doesn't match and another rule starts to
> match (only N-1 pixels scrolled) which may cause the element to only have
> "N-2" pixels of overflow, so the scroll is automatically adjusted, etc. You
> can create a loop that is as long as you wish, by making sure that when the
> element finally reaches no scroll at all, it starts to have a "N" scroll
> zone again. The size of the loop would be "N".

Ah, hm, that is indeed problematic.  Darn.  I thought we could avoid
this kind of problem.

Received on Tuesday, 17 June 2014 22:02:01 UTC

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