Closed Bug 1744398 Opened 2 years ago Closed 2 years ago

Media element load algorithm must fire 'emptied' BEFORE 'timeupdate'

Categories

(Core :: Audio/Video, defect, P4)

Firefox 96
defect

Tracking

()

RESOLVED FIXED
100 Branch
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:

  1. Make a media element play (e.g. https://www.w3schools.com/html/mov_bbb.mp4).
  2. Attach 'emptied' and 'timeupdate' event listeners to it.
v = document.querySelector('video');
v.addEventListener('emptied', console.log);
v.addEventListener('timeupdate', console.log);
  1. 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.

Component: Untriaged → Audio/Video
Product: Firefox → Core
Hardware: Unspecified → All

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.

Thanks for your interest, wofwca! Alastor, would you be a good person to advise on this?

Flags: needinfo?(alwu)

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.

Mentor: alwu
Severity: -- → S4
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(alwu)
Keywords: good-first-bug
Priority: -- → P4
Hardware: All → Unspecified
Whiteboard: [media-element-spec]
Assignee: nobody → azebrowski
Pushed by azebrowski@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/392a29b950a5
Media element load algorithm must fire 'emptied' before 'timeupdate' r=alwu
https://hg.mozilla.org/integration/autoland/rev/4e24b1d12558
Test if media element receives 'emptied' before 'timeupdate' r=alwu
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/33474 for changes under testing/web-platform/tests
Whiteboard: [media-element-spec] → [media-element-spec], [wptsync upstream]
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 100 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: