-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1830736 [wpt PR 39781] - Don't throw when popovers and dialogs ar…
…e in requested state, a=testonly Automatic update from web-platform-tests 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 <[email protected]> Commit-Queue: Joey Arhar <[email protected]> Cr-Commit-Position: refs/heads/main@{#1144952} -- wpt-commits: 0297d56d41123bb302ed3fdc84ec4f0fa891c4bf wpt-pr: 39781
- Loading branch information
1 parent
a20add2
commit 0795755
Showing
5 changed files
with
73 additions
and
18 deletions.
There are no files selected for viewing
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:[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