| <!DOCTYPE html> |
| <html> |
| <head> |
| <script src="../../../resources/js-test.js"></script> |
| </head> |
| <body> |
| <dialog id="mydialog">It's my dialog.</dialog> |
| <script> |
| description("Tests that dialog is visible after show() is called and not visible after close() is called. bug 90931"); |
| |
| dialog = document.getElementById('mydialog'); |
| computedStyle = window.getComputedStyle(dialog, null); |
| shouldBe("computedStyle.getPropertyValue('display')", "'none'"); |
| |
| dialog.show(); |
| computedStyle = window.getComputedStyle(dialog, null); |
| shouldBe("computedStyle.getPropertyValue('display')", "'block'"); |
| |
| dialog.close(); |
| computedStyle = window.getComputedStyle(dialog, null); |
| |
| shouldBe("computedStyle.getPropertyValue('display')", "'none'"); |
| shouldThrow('dialog.close();', '"InvalidStateError: Failed to execute \'close\' on \'HTMLDialogElement\': The element does not have an \'open\' attribute, and therefore cannot be closed."'); |
| </script> |
| </body> |
| </html> |