Created attachment 320641 [details]
Testcase for <video> element
Based on the attached test-case (and the resolution of https://bugzilla.mozilla.org/show_bug.cgi?id=1398341), it seems that WebKit will restart playback of a media element when it is moved in the DOM.
Firefox and Edge continue playback smoothly as per spec (see https://bugzilla.mozilla.org/show_bug.cgi?id=1398341 for context), while Chrome currently erroneously pauses the element (bug: https://bugs.chromium.org/p/chromium/issues/detail?id=737744)
(This behavior was uncovered while investigating an interop/webcompat issue: https://webcompat.com/issues/8777)
It looks like we are pausing the element to early:
When a media element is removed from a Document, the user agent must run the following steps:
1. Asynchronously 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. ⌛ If the media element's networkState attribute has the value NETWORK_EMPTY, abort these steps.
4. ⌛ Pause the media element.