Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make animations to display:none also apply inert #39023

Merged
merged 1 commit into from
Mar 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions css/css-transitions/inert-while-transitioning-to-display-none.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<link rel=author href="mailto:[email protected]">
<link rel=help href="https://github.com/w3c/csswg-drafts/issues/8389">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<dialog>
<button>button</button>
</dialog>

<style>
dialog.ready {
transition: display 500ms;
}
</style>

<script>
promise_test(async () => {
const dialog = document.querySelector('dialog');
const button = document.querySelector('button');

dialog.showModal();
button.blur(); // Dialog initial focus focused the button
dialog.classList.add('ready');

dialog.close();
await new Promise(resolve => requestAnimationFrame(resolve));
button.focus();

assert_not_equals(document.activeElement, button, 'Inert elements should not be focusable.');
}, 'Elements which are transitioning to display:none should be inert.');
</script>