-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
What is the issue with the HTML Standard?
#10051 introduced an is currently stalled to support the :stalled pseudo-class, and updates it in tasks right after firing the progress and stalled events.
Doing it after mean that in the "stalled" event handler, the :stalled pseudo-class does not yet match, but will start matching right afterwards. Similarly, when the "progress" event fires, :stalled might still be matching, but will stop matching right afterwards.
@annevk was this an intentional choice?
Things are certainly not perfectly consistent, but for the most part the script-observable state changes before the event fires. For example, in "When the current playback position reaches the end of the media resource when the direction of playback is forwards, then the user agent must follow these steps" the paused attribute is updated before the "pause" event fires.
It's also quite common for the script-observable state to change right before queuing a task to fire an event, although mostly in cases where the change is coming from scripts, like setting video.volume firing the "volumechange" event.
I don't have a strong opinion, but writing the tests is slightly easier if "is currently stalled" is updated before the event is fired.
cc @whatwg/media