Media element load algorithm must fire 'emptied' BEFORE 'timeupdate'
Categories
(Core :: Audio/Video, defect, P4)
Tracking
()
Tracking | Status | |
---|---|---|
firefox100 | --- | fixed |
People
(Reporter: wofwca, Assigned: az, Mentored)
Details
(Keywords: good-first-bug, Whiteboard: [media-element-spec], [wptsync upstream])
Attachments
(2 files)
Steps to reproduce:
- Make a media element play (e.g. https://www.w3schools.com/html/mov_bbb.mp4).
- Attach 'emptied' and 'timeupdate' event listeners to it.
v = document.querySelector('video');
v.addEventListener('emptied', console.log);
v.addEventListener('timeupdate', console.log);
- Change the source of the element.
v.src = '';
Actual results:
As you see in the console, 'timeupdate' event got fired before the 'emptied' event
Expected results:
'emptied' must have been fired before 'timeupdate', as the spec states.
Here's what I believe to be the responsible code: https://github.com/mozilla/gecko-dev/blob/e24f563e9e5b9580dbcda1b114ceb202162026f2/dom/html/HTMLMediaElement.cpp#L2306-L2333
And I believe
that fixing it is just a matter of moving the DispatchAsyncEvent(u"emptied"_ns);
line to the top of the if
block.
And I would like to try to fix this myself. As soon as I catch up to the contributing documentation.
Comment 3•3 years ago
|
||
Thanks for your interest, wofwca! Alastor, would you be a good person to advise on this?
Comment 4•3 years ago
•
|
||
Yes, according to the spec, it looks like you can simply move the empty
to the top line of that if
block. Feel free to set review flag on me, and feel free to NI me if you have any question about the contribution.
Thank you so much.
Updated•3 years ago
|
Comment 9•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/392a29b950a5
https://hg.mozilla.org/mozilla-central/rev/4e24b1d12558
Description
•