Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /custom-elements/custom-image-abort-insertion-crash.html - WPT Dashboard Interop Dashboard
<!doctype html>
<html class="test-wait">
<title>Custom image element insertion is aborted after its form is set.</title>
<script src="/common/gc.js"></script>
<script>
customElements.define("x-i", class extends HTMLImageElement {
constructor() {
super();
window.image = this;
this.appendChild(document.querySelector("form"));
}
}, { extends: "img" });
addEventListener("load", async () => {
image.removeChild(image.firstChild);
await garbageCollect();
image.removeAttribute("id");
document.documentElement.classList.remove('test-wait');
});
</script>
<form><img is="x-i" id="i"></form>
</html>