Bug 233099 - Modal dialogs should make the root element unfocusable
Summary: Modal dialogs should make the root element unfocusable
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Nguyen (:ntim)
URL:
Keywords: InRadar
Depends on:
Blocks: dialog-element
  Show dependency treegraph
 
Reported: 2021-11-14 09:42 PST by Tim Nguyen (:ntim)
Modified: 2021-11-14 10:48 PST (History)
8 users (show)

See Also:


Attachments
Patch (8.47 KB, patch)
2021-11-14 09:57 PST, Tim Nguyen (:ntim)
no flags Details | Formatted Diff | Diff
Patch (8.36 KB, patch)
2021-11-14 09:58 PST, Tim Nguyen (:ntim)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Nguyen (:ntim) 2021-11-14 09:42:40 PST
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.


RenderStyle::effectiveInert() already matches this definition, Node::deprecatedIsInert() does not.

Main reason for the removed check was to prevent the whole document from being inert to hit-testing, but with the RenderStyle approach, we instead override effectiveInert to false for the modal dialog. Removing this check for focus is absolutely fine however, since focusability isn't inherited.

Tests added by this Chromium WPT: https://github.com/web-platform-tests/wpt/commit/0457111e7109ec3d9e575aa421b96d8c36ce2ae8
Comment 1 Tim Nguyen (:ntim) 2021-11-14 09:57:01 PST
Created attachment 444178 [details]
Patch
Comment 2 EWS Watchlist 2021-11-14 09:57:56 PST
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Comment 3 Tim Nguyen (:ntim) 2021-11-14 09:58:26 PST
Created attachment 444179 [details]
Patch
Comment 4 EWS 2021-11-14 10:47:39 PST
Committed r285791 (244235@main): <https://commits.webkit.org/244235@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 444179 [details].
Comment 5 Radar WebKit Bug Importer 2021-11-14 10:48:21 PST
<rdar://problem/85391533>