-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't throw when popovers and dialogs are in requested state
This is being changed in the HTML spec here: whatwg/html#9142 Change-Id: Ib8aaaf314c2a1de5d082494e5172e029d531c8e8
- Loading branch information
1 parent
25eb850
commit e1878a3
Showing
5 changed files
with
73 additions
and
18 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
html/semantics/interactive-elements/the-dialog-element/dialog-no-throw-requested-state.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!DOCTYPE html> | ||
<link rel=author href="mailto:[email protected]"> | ||
<link rel=help href="https://github.com/whatwg/html/pull/9142"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
|
||
<dialog>hello</dialog> | ||
|
||
<script> | ||
test(() => { | ||
const dialog = document.querySelector('dialog'); | ||
|
||
// calling close() on a dialog that is already closed should not throw. | ||
dialog.close(); | ||
|
||
dialog.show(); | ||
// calling show() on a dialog that is already showing non-modal should not throw. | ||
dialog.show(); | ||
assert_throws_dom('InvalidStateError', () => dialog.showModal(), | ||
'Calling showModal() on a dialog that is already showing non-modal should throw.'); | ||
dialog.close(); | ||
|
||
dialog.showModal(); | ||
assert_throws_dom('InvalidStateError', () => dialog.show(), | ||
'Calling show() on a dialog that is already showing modal should throw.'); | ||
// calling showModal() on a dialog that is already showing modal should not throw. | ||
dialog.showModal(); | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters