-
Notifications
You must be signed in to change notification settings - Fork 7.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 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4494823 Reviewed-by: Mason Freed <masonf@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1144952}
- Loading branch information
1 parent
7d0ccaa
commit 69a2d95
Showing
8 changed files
with
133 additions
and
42 deletions.
There are no files selected for viewing
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
29 changes: 29 additions & 0 deletions
29
...ml/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:jarhar@chromium.org"> | ||
<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