blob: efe58a03bfb9c04eb0729cc46eae956254ee46a6 [file] [log] [blame]
<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<template>
<custom-dialog></custom-dialog>
</template>
<div id=shadow></div>
<iframe id=sibling></iframe>
<script>
async_test(function(test) {
customElements.define('custom-dialog',class extends HTMLElement {
constructor() {
super();
this.attachShadow({mode: 'open'}).innerHTML = '<dialog></dialog>';
}
show() {
this.shadowRoot.querySelector('dialog').showModal();
}
});
onload = test.step_func(() => {
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();
test.done();
});
}, 'Shadow DOM <dialog>.showModal() on a page with an <iframe> should not crash.');
</script>