-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Destroy popover close watchers on hidepopover
Differential Revision: https://phabricator.services.mozilla.com/D223880 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1921363 gecko-commit: 49ce9d42094458fa66352c121d2f59eca257cda2 gecko-reviewers: smaug
- Loading branch information
1 parent
6f30ec0
commit fff1849
Showing
2 changed files
with
86 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!DOCTYPE html> | ||
<link rel=author href="mailto:[email protected]"> | ||
<link rel=author href="mailto:[email protected]"> | ||
<link rel=help href="https://github.com/whatwg/html/pull/9462"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/resources/testdriver.js"></script> | ||
<script src="/resources/testdriver-vendor.js"></script> | ||
<script src="/resources/testdriver-actions.js"></script> | ||
<script src="../resources/helpers.js"></script> | ||
|
||
<button id=b0>b0</button> | ||
|
||
<dialog id=d1> | ||
<button id=b1>b1</button> | ||
|
||
<dialog id=d2>d2</dialog> | ||
</dialog> | ||
|
||
<script> | ||
promise_test(async () => { | ||
const d1 = document.getElementById('d1'); | ||
const d2 = document.getElementById('d2'); | ||
await test_driver.click(b0); | ||
d1.showModal(); | ||
await test_driver.click(b1); | ||
d2.showModal(); | ||
|
||
assert_true(d1.matches(':modal'), 'd1 should be open.'); | ||
assert_true(d2.matches(':modal'), 'd2 should be open.'); | ||
|
||
d2.remove() | ||
|
||
assert_false(d2.matches(':modal'), 'd2 should now be closed.'); | ||
await sendCloseRequest(); | ||
assert_false(d2.matches(':modal'), 'd2 still now be closed.'); | ||
assert_false(d1.matches(':modal'), 'd1 should now be closed.'); | ||
|
||
await sendCloseRequest(); | ||
assert_false(d2.matches(':modal'), 'd2 still now be closed.'); | ||
assert_false(d1.matches(':modal'), 'd1 still now be closed.'); | ||
}, 'Disconnect dialog with close request'); | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!DOCTYPE html> | ||
<link rel=author href="mailto:[email protected]"> | ||
<link rel=author href="mailto:[email protected]"> | ||
<link rel=help href="https://github.com/whatwg/html/pull/9462"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/resources/testdriver.js"></script> | ||
<script src="/resources/testdriver-vendor.js"></script> | ||
<script src="/resources/testdriver-actions.js"></script> | ||
<script src="../resources/helpers.js"></script> | ||
|
||
<button id=b0>b0</button> | ||
|
||
<div id=p1 popover=auto> | ||
<button id=b1>b1</button> | ||
|
||
<div id=p2 popover=auto>p2</div> | ||
</div> | ||
|
||
<script> | ||
promise_test(async () => { | ||
const p1 = document.getElementById('p1'); | ||
const p2 = document.getElementById('p2'); | ||
await test_driver.click(b0); | ||
p1.showPopover(); | ||
await test_driver.click(b1); | ||
p2.showPopover(); | ||
|
||
assert_true(p1.matches(':popover-open'), 'p1 should be open.'); | ||
assert_true(p2.matches(':popover-open'), 'p2 should be open.'); | ||
|
||
p2.remove() | ||
|
||
assert_false(p2.matches(':popover-open'), 'p2 should now be closed.'); | ||
await sendCloseRequest(); | ||
assert_false(p2.matches(':popover-open'), 'p2 still now be closed.'); | ||
assert_false(p1.matches(':popover-open'), 'p1 should now be closed.'); | ||
|
||
await sendCloseRequest(); | ||
assert_false(p2.matches(':popover-open'), 'p2 still now be closed.'); | ||
assert_false(p1.matches(':popover-open'), 'p1 still now be closed.'); | ||
}, 'Disconnect popover with close request'); | ||
</script> |