Bug 1739737 [wpt PR 31533] - [inert] Let modal dialogs make the root element inert...
commit6dba295f0ab5665f4bd041bf4dcc790cd5deb821
authorOriol Brufau <obrufau@igalia.com>
Sat, 13 Nov 2021 10:12:43 +0000 (13 10:12 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Mon, 15 Nov 2021 12:01:15 +0000 (15 12:01 +0000)
treeb9f501fa0467787e5014b425c0dc388446b3e962
parent44eb1bf4799133c35aff8e2a27abc33dc0e80e6e
Bug 1739737 [wpt PR 31533] - [inert] Let modal dialogs make the root element inert, a=testonly

Automatic update from web-platform-tests
[inert] Let modal dialogs make the root element inert

From https://html.spec.whatwg.org/multipage/interaction.html#inert,

> A Document document is blocked by a modal dialog subject if subject is
> the topmost dialog element in document's top layer. While document is
> so blocked, every node that is connected to document, with the
> exception of the subject element and its shadow-including descendants,
> must be marked inert.

This doesn't exclude the root element, so it should also be inert.

Simply doing this change would break these tests:
- html/dialog/modal-dialog-ancestor-is-inert.html
- html/dialog/modal-dialog-blocks-mouse-events.html

Excluding the root element in HitTestResult::SetInnerNode avoids that.

Note I plan to track inertness in ComputedStyle, and then remove both
Node::IsInert and hit test retargeting for inert. So this patch is just
temporary, to align with the final behavior.

Also note that only the the root element (documentElement) is affected.
The root node (document), represented as rootWebArea in a11y, will still
not become inert when there is a modal dialog or fullscreen element.

Bug: 692360

TEST=All/DumpAccessibilityTreeTest.AccessibilityModalDialogOpened/blink
TEST=All/DumpAccessibilityTreeTest.AccessibilityModalDialogStack/blink
TEST=All/DumpAccessibilityTreeTest.AccessibilityOpenModal/blink
TEST=external/wpt/html/semantics/interactive-elements/the-dialog-element/inert-node-is-unfocusable.html

Change-Id: I8ce7905a85e386fae6163423f5e078b6c4588db1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3263132
Commit-Queue: Oriol Brufau <obrufau@igalia.com>
Reviewed-by: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: Nektarios Paisios <nektar@chromium.org>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Reviewed-by: Mason Freed <masonf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#941302}

--

wpt-commits: 0457111e7109ec3d9e575aa421b96d8c36ce2ae8
wpt-pr: 31533
testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/inert-node-is-unfocusable.html