(In reply to Kagami Rosylight [:saschanaz] (they/them) from comment #47) > Seems that's because `_isScrolling` becomes false during the scroll. And it gets multiple scrollend event during a single scroll. I think this answers: (In reply to Botond Ballo [:botond] [away until Jan 6] from comment #54) > I think a good next step here is to debug the arrowscrollbox.js code in more detail to understand how this artifact arises. If there is something about the event deltas or scrollend events coming from the platform that the arrowscrollbox.js code is not expecting, we should clarify what the code's expectations are, so we can make sure the platform is conforming to it (or adjust the code's expectations, as appropriate). The arrowscrollbox code tracks when scrolling starts and ends using `scroll` and `scrollend` events, respectively. This causes it to update its internal `_isScrolling` bool: https://searchfox.org/mozilla-central/rev/b6718bf263ae780289da471f0ea35797a09e2f05/toolkit/content/widgets/arrowscrollbox.js#751-752,757-758 . When processing _wheel_ events, this bool is consulted and determines whether we add the new scroll amount (determined by the information in the wheel event + the size of the items in the scroll box) to an existing tracker of how much we want to scroll, or whether we reset to the current position + whatever the scroll amount is. https://searchfox.org/mozilla-central/rev/b6718bf263ae780289da471f0ea35797a09e2f05/toolkit/content/widgets/arrowscrollbox.js#705-711 . Then we call `scrollBy` with that amount. I think in the cases reported with the performance profiles here, `instant` is never set (so we use `auto` as the `behaviour` value). From what I can tell, if the user were to make one continuous motion with a scroll wheel, this code would expect exactly 1 `scrollend` event, when the scrolling is done. Instead, we seem to be getting several. I'm not an APZ/scrolling expert so I would not want to comment on whether the expectations or the behaviour is at fault here! :-) Botond, does that help?
Bug 1924193 Comment 56 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
(In reply to Kagami Rosylight [:saschanaz] (they/them) from comment #47) > Seems that's because `_isScrolling` becomes false during the scroll. And it gets multiple scrollend event during a single scroll. I think this answers: (In reply to Botond Ballo [:botond] [away until Jan 6] from comment #54) > I think a good next step here is to debug the arrowscrollbox.js code in more detail to understand how this artifact arises. If there is something about the event deltas or scrollend events coming from the platform that the arrowscrollbox.js code is not expecting, we should clarify what the code's expectations are, so we can make sure the platform is conforming to it (or adjust the code's expectations, as appropriate). The arrowscrollbox code tracks when scrolling starts and ends using `scroll` and `scrollend` events, respectively. This causes it to update its internal `_isScrolling` bool: https://searchfox.org/mozilla-central/rev/b6718bf263ae780289da471f0ea35797a09e2f05/toolkit/content/widgets/arrowscrollbox.js#751-752,757-758 . When processing _wheel_ events, this bool is consulted and determines whether we add the new scroll amount (determined by the information in the wheel event + the size of the items in the scroll box) to an existing tracker of how much we want to scroll, or whether we reset to the current position + whatever the scroll amount is. https://searchfox.org/mozilla-central/rev/b6718bf263ae780289da471f0ea35797a09e2f05/toolkit/content/widgets/arrowscrollbox.js#705-711 . Then we call `scrollBy` with that amount. I think in the cases reported with the performance profiles here, `instant` is never set (so we use `auto` as the `behaviour` value). From what I can tell, if the user were to make one continuous motion with a scroll wheel, this code would expect exactly 1 `scrollend` event, when the scrolling is done. Instead, we seem to be getting several. I'm not an APZ/scrolling expert so I would not want to comment on whether the expectations or the behaviour is at fault here! :-) Botond, does that help? Edit: and it would seem that Hiro filed bug 1932985 which more or less covers a potential explanation of why there are so many `scrollend` events and how they're bogus...