[csswg-drafts] [selectors] selector for scroll bar types (#7697)

CendioOssman has just created a new issue for https://github.com/w3c/csswg-drafts:

== [selectors] selector for scroll bar types ==
(spawned from [Firefox discussion](https://bugzilla.mozilla.org/show_bug.cgi?id=1786016))

We (noVNC) need to be able to tell what kind of scroll bars the browser is presenting as we override some of the other methods for scrolling. For some cases, we then need to change the layout and behaviour of the page to return some scroll ability to the user. As this is about how the browser presents things, a media selector seems like the obvious choice of API.

noVNC is a VNC client, i.e. a way to access another (remote) computer. As such, it does some things that interfere with scrolling:

 * It sends all mouse wheel events to the remote computer, prevent wheel scrolling
 * It sends all touch events to the remote computer, preventing touch-and-drag scrolling
 * It sends all keyboard events to the remote computer, preventing keyboard scrolling

The only scroll method left is to use the scroll bar. However, this is not always available. We historically saw two types of scroll bars:

 1. Gutter scroll bars
 2. Purely visual scroll bars (no way to interact with them)

So, we found a method to detect the gutter, and if it wasn't present, we assumed a purely visual scroll bar and enabled some alternative methods for scrolling in our UI.

But there is now a third type of scroll bar:

 3. Overlay scroll bars

We are currently misdetecting these as purely visual scroll bars, as they have no gutter. Meaning, we activate our fallback methods needlessly.

Initially, only macOS had overlay scroll bars, but they are broken¹, so this misdetection turned out to be a feature there. However, Firefox now has properly working overlay scroll bars on Windows and Linux, causing practical issues for us.

¹ They only appear when another scrolling method is used, and as stated above, all other methods are overridden 

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7697 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 5 September 2022 14:05:10 UTC