Re: [selectors4][css-round-display] Suggest a new type of pseudo class to support scrolling in rounded viewports

> On Jan 27, 2016, at 11:46, Jihye Hong <jh.hong@lge.com> wrote:
> 
> To support the last approach which is used in general nowadays and the best
> solution for scrolling in the round display so far, I figured out an idea
> about a new type of pseudo-class, the regional pseudo-class.
> The regional pseudo-class is a functional pseudo class for selecting an
> element in a particular area of the round display.
> 
>   :region( [ center || left || top || right || bottom ]? )
> 
> The pseudo-class can have keyword values for parameters like above.
> 
> Meaning of each keyword is:
>   * center: matches if the element overlaps a center point of a containing
> block
>   * left: matches if the element touches a left edge of a containing block
>   * top: matches if the element touches a top edge of a containing block
>   * right: matches if the element touches a right edge of a containing
> block
>   * bottom: matches if the element touches a bottom edge of a containing
> block

This seems like a worthy use case to address, but I don't think a pseudo class
can work. The reason is that you need to do layout to find if the pseudo class
applies. Not only does it means we need a two pass approach, but also we risk
having infinite loops.

:region(top) {
 position: relative;
 top: 100vh;
}

If the element is at the top, the pseudo matches, and we move it down. So it no longer is at the top and the pseudo no longer matches, so move it back up. So it is a the top, and the pseudo matches...

We could try to define conditions to break out of these loops, but the fact that they exists shows that this does not fit very well within the normal CSS model and how browsers implement it.

 - Florian

Received on Thursday, 28 January 2016 07:15:20 UTC