Open zcorpan opened 1 year ago
But, at what point does the UA determine that scrolling is completed? If it's not done in "run the scroll steps", the spec may fire scrollend first and scroll afterwards. Or, if "scrolling is completed" happens in parallel (off-main-thread), then the spec says to fire an event in a situation where would instead have to queue an event to fire the event (which the spec doesn't say to do).
Similar to what is stated here, what is the expected behavior given a user scrolling with a mousewheel in a scenario where smooth scroll is disabled. Currently Firefox fires a scrollend event as soon as the mousewheel scroll completes, which results in many scrollend
events for a series of mousewheel scrolls. Simple tests with chrome seem to indicate that scrollend events are a bit more aggressively coalesced.
https://w3c.github.io/csswg-drafts/cssom-view/#scrolling-events
This setup doesn't make sense to me. As specified, the "pending scrollend event targets" can be optimized away since you add a single entry to it, then immediately process it, then empty the list, in the same algorithm.
But, at what point does the UA determine that scrolling is completed? If it's not done in "run the scroll steps", the spec may fire
scrollend
first andscroll
afterwards. Or, if "scrolling is completed" happens in parallel (off-main-thread), then the spec says to fire an event in a situation where would instead have to queue an event to fire the event (which the spec doesn't say to do).For
scroll
events, the "pending scroll event targets" list can be populated in parallel, and the "run the scroll steps" is called from HTML's event loop: https://html.spec.whatwg.org/multipage/webappapis.html#update-the-renderingI think the appropriate fix here is to move the "fire an event" and emptying of the queue for
scrollend
into "run the scroll steps" algorithm, after it has dealt with anyscroll
events.cc @emilio @dlrobertson @argyleink