Re: [csswg-drafts] [cssom-view] Clarify number and order of `scroll` and `scrollend` events when a `scroll` event listener performs another scroll (#13772)

The CSS Working Group just discussed ``[cssom-view] Clarify number and order of `scroll` and `scrollend` events when a `scroll` event listener performs another scroll``, and agreed to the following:

* `RESOLVED: snapshot the event queue and empty it before dispatching all the events`

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> scribe+<br>
&lt;emilio> flackr: this is about what events you should expect to see when you perform a scroll from a scroll event listener<br>
&lt;emilio> ... I think the expectation is that because scroll events are dispatched after the scroll finished you'll see the queued scrollend from the previous scroll<br>
&lt;emilio> q+<br>
&lt;astearns> ack emilio<br>
&lt;fantasai> emilio: I think that falls out of the current spec, but bit that is not specced is that you copy the queued list of scroll events before dispatching all of them<br>
&lt;fantasai> emilio: We have this scroll event queue<br>
&lt;fantasai> emilio: I think that's the behavior you want?<br>
&lt;fantasai> flackr: Yes, I think so<br>
&lt;fantasai> emilio: So that needs clarification<br>
&lt;fantasai> emilio: Otherwise conceptually you could end up with an almost synchronous scroll event<br>
&lt;fantasai> flackr: completely agree. Copy beforehand.<br>
&lt;fantasai> emilio: That matches rAF etc.<br>
&lt;fantasai> astearns: Does that fit the behavior you thought was correct smfr?<br>
&lt;fantasai> smfr: I think it does result in scroll/scrollEnd/scroll/scrollEnd pattern<br>
&lt;fantasai> smfr: Idk whether Safari behavior is better.<br>
&lt;fantasai> smfr: Would like to hear from authors whether having a scrollEnd in the middle is problematic<br>
&lt;emilio> flackr: keep in mind that new scroll would end up in the next update the rendering<br>
&lt;fantasai> smfr: So split into different frames... maybe that's ok<br>
&lt;ydaniv> I think it's ok<br>
&lt;fantasai> emilio: Proposal is to snapshot the event queue and empty it before dispatching all the events<br>
&lt;flackr> +1<br>
&lt;emilio> PROPOSED: snapshot the event queue and empty it before dispatching all the events<br>
&lt;emilio> RESOLVED: snapshot the event queue and empty it before dispatching all the events<br>
&lt;emilio> astearns: does this cover your second point of checking whether there's a pending scroll event?<br>
&lt;emilio> flackr: I think this covers it<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13772#issuecomment-4389622776 using your GitHub account


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

Received on Wednesday, 6 May 2026 15:30:39 UTC