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

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

From: François REMY <francois.remy.dev@outlook.com>
Date: Tue, 17 Jun 2014 23:19:39 +0200
Message-ID: <DUB130-DS20E14295B89AFC678A87ECA5110@phx.gbl>
To: "Tab Atkins Jr." <jackalmage@gmail.com>, "Kseso?" <kseso9@gmail.com>
Cc: "www-style list" <www-style@w3.org>
> 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".

Is that right?
François 
Received on Tuesday, 17 June 2014 21:20:03 UTC

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