Skip to content

Commit

Permalink
Implement the new dialog initial focus algorithm
Browse files Browse the repository at this point in the history
The main changes of the new algorithm are

* Make the dialog focusing steps look at sequentially focusable elements instead of any focusable element.
* Make the dialog element itself get focus if it has the autofocus attribute set.
* Make the dialog element itself get focus as a fallback instead of focus being "reset" to the body element.

Spec PR (merged): whatwg/html#8199

Differential Revision: https://phabricator.services.mozilla.com/D181263

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1811129
gecko-commit: 94d3ff1570f4ef28436d580200a642fc1ab41883
gecko-reviewers: emilio
  • Loading branch information
sefeng211 authored and moz-wptsync-bot committed Aug 2, 2023
1 parent 0e2b419 commit be8c0ab
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
background-color: rgb(0, 128, 0);
opacity: 0.5;
}
dialog:focus {
outline: none;
}
</style>
<body>
<dialog>Test passes if you see a green backdrop at half opacity.</dialog>
Expand Down

0 comments on commit be8c0ab

Please sign in to comment.