Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

  • This WPT test may be referenced by the following Test IDs:
<!DOCTYPE html>
<html class=test-wait>
<link rel=author href="mailto:jarhar@chromium.org">
<link rel=author href="mailto:noel@chromium.org">
<template>
<custom-dialog></custom-dialog>
</template>
<div id=shadow></div>
<iframe id=sibling></iframe>
<script>
customElements.define('custom-dialog',class extends HTMLElement {
constructor() {
super();
this.attachShadow({mode: 'open'}).innerHTML = '<dialog></dialog>';
}
show() {
this.shadowRoot.querySelector('dialog').showModal();
}
});
onload = () => {
const template = document.querySelector('template');
const content = document.importNode(template.content, true);
const dialog = content.querySelector('custom-dialog');
document.querySelector('div').appendChild(dialog);
dialog.show();
document.documentElement.classList.remove('test-wait');
};
</script>