Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<link rel=author href="mailto:jarhar@chromium.org">
<link rel=author href="mailto:falken@chromium.org">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<dialog id=mydialog>It's my dialog.</dialog>
<script>
test(() => {
const dialog = document.getElementById('mydialog');
let computedStyle = window.getComputedStyle(dialog, null);
assert_equals(computedStyle.getPropertyValue('display'), 'none');
dialog.show();
computedStyle = window.getComputedStyle(dialog, null);
assert_equals(computedStyle.getPropertyValue('display'), 'block');
dialog.close();
computedStyle = window.getComputedStyle(dialog, null);
assert_equals(computedStyle.getPropertyValue('display'), 'none');
dialog.close();
}, "Tests that dialog is visible after show() is called and not visible after close() is called.");
</script>