W3C home > Mailing lists > Public > public-css-archive@w3.org > August 2019

Re: [csswg-drafts] [cssom-view][proposal] beforescroll event (#4172)

From: Hristiyan Dodov via GitHub <sysbot+gh@w3.org>
Date: Mon, 05 Aug 2019 13:19:14 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-518230815-1565011153-sysbot+gh@w3.org>
From what I understand, having a non-passive `wheel` event listener means the browser no longer uses accelerated scrolling (since it needs to wait for the event handler to see if it should further scroll).

Well, can't it be the same for the `beforescroll` event too? By adding a non-passive `beforescroll` listener, you opt-out of accelerated scrolling in exchange for better scroll control. It's a decision that the developer makes. The UA should simply give that choice.

If I have a passive `wheel` listener and no `beforescroll` listeners, I should benefit from accelerated scrolling since there's still nothing to prevent the scroll from happening. It should act as the same way as if my proposed event was not implemented.

I think the `passive` option of events was designed to solve that very problem you're talking about. You won't have better scrolling performance with a non-passive `beforescroll` the same way you won't have it with a non-passive `wheel` listener. By specifying that the event is passive, you tell the browser that it can assume nothing will prevent scrolling so it can optimize it. Why can't `beforescroll` function the same way?

GitHub Notification of comment by hdodov
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4172#issuecomment-518230815 using your GitHub account
Received on Monday, 5 August 2019 13:19:16 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:51 UTC