Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/embedded-content/the-embed-element/embed-change-src.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html class="reftest-wait">
<meta charset="utf-8">
<link rel="author" title="Joey Arhar" href="mailto:jarhar@chromium.org">
<link rel="help" href="https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-embed-element">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<script>
promise_test(async () => {
const embed = document.createElement('embed');
let loadPromise = new Promise(resolve => embed.onload = resolve);
embed.src = '/media/white.mp4';
document.body.appendChild(embed);
await loadPromise;
loadPromise = new Promise(resolve => embed.onload = resolve);
embed.src = '/media/white.webm';
await loadPromise;
}, 'Verifies that embed elements reload with new content when the src attribute is changed.');
</script>