RESOLVED FIXED 157347
Media elements should not be paused right away when removed from the document
https://bugs.webkit.org/show_bug.cgi?id=157347
Summary Media elements should not be paused right away when removed from the document
Chris Dumez
Reported 2016-05-04 09:49:56 PDT
Media elements should not be paused right away when removed from the document. Instead we should allow the task that removed the media element from the document to finish because considering pausing. This avoid inadvertently pausing media elements when the JS merely moves them on the page (e.g. using Node.replaceChild()). Text from the HTML specification: """ When a media element is removed from a Document, the user agent must run the following steps: 1. Await a stable state, allowing the task that removed the media element from the Document to continue. The synchronous section consists of all the remaining steps of this algorithm. (Steps in the synchronous section are marked with ⌛.) 2. ⌛ If the media element is in a Document, abort these steps. 3. ⌛ Run the internal pause steps for the media element. """ c.f. https://html.spec.whatwg.org/multipage/embedded-content.html#htmlmediaelement
Attachments
Patch (18.99 KB, patch)
2016-05-04 13:35 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2016-05-04 09:50:19 PDT
Chris Dumez
Comment 2 2016-05-04 13:35:37 PDT
Chris Dumez
Comment 3 2016-05-04 14:33:06 PDT
Comment on attachment 278122 [details] Patch Clearing flags on attachment: 278122 Committed r200431: <http://trac.webkit.org/changeset/200431>
Chris Dumez
Comment 4 2016-05-04 14:33:11 PDT
All reviewed patches have been landed. Closing bug.
Darin Adler
Comment 5 2016-05-06 11:08:20 PDT
Comment on attachment 278122 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=278122&action=review > Source/WebCore/dom/GenericEventQueue.cpp:81 > + Deque<WeakPtr<GenericEventQueue>> queuedEvents; > + std::swap(queuedEvents, pendingQueues()); Why swap instead of move here?
Note You need to log in before you can comment on or make changes to this bug.