NEW 271629
<video> elements moved out of a <template> immediately fail to load all candidate resources
https://bugs.webkit.org/show_bug.cgi?id=271629
Summary <video> elements moved out of a <template> immediately fail to load all candi...
Jonathan Heathcote
Reported 2024-03-24 23:59:20 PDT
Created attachment 470586 [details] A demo HTML page with a button which, when clicked, moves a <video> element out of a <template> and onto the page.. # Environment Epiphany 45.3, Arch Linux. # Steps to reproduce: When a <video> element is moved out of a <template> element (e.g. using .append(...)), the video will fail to play. A demo HTML page is attached which does exactly the above when a button is clicked. # Actual results: When the 'Move video out of template' button is clicked, the video element is moved into the document but no video plays. # Expected results: The video should have loaded and played as usual. NB: If the sample video element is placed on the page (i.e. outside the <template>) it plays correctly -- this is not a video format support issue. A similar issue appears to be present in Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1887573 The issue does not occur in Chromium. # Workaround For others impacted, the following workaround may be used immediately after inserting the element into the document to restore function: ``` const innerHTML = video.innerHTML; video.innerHTML = ""; video.innerHTML = innerHTML; ```
Attachments
A demo HTML page with a button which, when clicked, moves a <video> element out of a <template> and onto the page.. (791 bytes, text/html)
2024-03-25 06:59 PDT, Jonathan Heathcote
no flags
A version of the demo file without the accidentally included workaround. Please use this file to reproduce the bug! (686 bytes, text/html)
2024-03-25 07:04 PDT, Jonathan Heathcote
no flags
Jonathan Heathcote
Comment 1 2024-03-25 00:02:23 PDT
My apologies, I accidentally uploaded a version of the demo.html file which included the workaround noted in the report. Please remove lines 19-22 to see the effect of the bug!
Jonathan Heathcote
Comment 2 2024-03-25 00:04:03 PDT
Created attachment 470587 [details] A version of the demo file without the accidentally included workaround. Please use this file to reproduce the bug! Uploaded version of demo page without workaround.
Radar WebKit Bug Importer
Comment 3 2024-04-01 00:00:12 PDT
Note You need to log in before you can comment on or make changes to this bug.