Skip to content

Commit

Permalink
[inert] Let modal dialogs escape inertness from ancestors
Browse files Browse the repository at this point in the history
If an ancestor of a modal <dialog> has the 'inert' attribute, the dialog
and its subtree will no longer be inert.

However, if the 'inert' attribute is in the <dialog> itself, then the
subtree will still be inert.

This aligns Blink with Gecko and WebKit. The spec conversation about
this topic is in whatwg/html#7808

Bug: 1323680

TEST=external/wpt/inert/inert-with-modal-dialog-001.html
TEST=StyleResolverTest.IsInertWithAttributeAndDialog

Cq-Include-Trybots: luci.chromium.try:linux-blink-web-tests-force-accessibility-rel
Change-Id: Id2752ce3d1c8985b68b1d700710c3ff3eb100714
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3634684
Reviewed-by: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: Mason Freed <masonf@chromium.org>
Commit-Queue: Oriol Brufau <obrufau@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1006974}
  • Loading branch information
Loirooriol authored and chromium-wpt-export-bot committed May 24, 2022
1 parent b85ee34 commit be0a42d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions inert/inert-with-modal-dialog-001.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<title>Interaction of 'inert' attribute with modal dialog</title>
<link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com">
<link rel="help" href="https://html.spec.whatwg.org/multipage/interaction.html#inert">
<meta name="assert" content="Checks that being part of a modal dialog does not protect a node from being marked inert by an 'inert' attribute.">
<meta name="assert" content="Checks that a modal dialog escapes inertness from ancestors.">
<div id="log"></div>
<div id="wrapper">
wrapper
Expand Down Expand Up @@ -51,6 +51,6 @@
test(function() {
wrapper.inert = true;
this.add_cleanup(() => { wrapper.inert = false; });
checkSelection("");
}, "If an ancestor of the dialog has the 'inert' attribute, everything becomes inert");
checkSelection("dialog child");
}, "If an ancestor of the dialog has the 'inert' attribute, the dialog escapes inertness");
</script>

0 comments on commit be0a42d

Please sign in to comment.