Skip to content

Commit

Permalink
Make animations to display:none also apply inert
Browse files Browse the repository at this point in the history
w3c/csswg-drafts#8389

Bug: 1422736
Change-Id: Ica770040e6932b00fdd0c3a2051c9aee745e4b2b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4342420
Commit-Queue: Joey Arhar <[email protected]>
Reviewed-by: Robert Flack <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1118269}
  • Loading branch information
josepharhar authored and chromium-wpt-export-bot committed Mar 16, 2023
1 parent e385e89 commit 341c644
Showing 1 changed file with 32 additions and 0 deletions.
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>

0 comments on commit 341c644

Please sign in to comment.