Bug 230686 - Replace Node::isInert() with RenderStyle::effectiveInert()
Summary: Replace Node::isInert() with RenderStyle::effectiveInert()
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: 229330
Blocks: dialog-element
  Show dependency treegraph
 
Reported: 2021-09-23 05:11 PDT by Tim Nguyen (:ntim)
Modified: 2021-09-27 04:26 PDT (History)
20 users (show)

See Also:


Attachments
Patch (13.35 KB, patch)
2021-09-23 08:05 PDT, Tim Nguyen (:ntim)
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (13.24 KB, patch)
2021-09-23 09:49 PDT, Tim Nguyen (:ntim)
no flags Details | Formatted Diff | Diff
Patch (13.25 KB, patch)
2021-09-25 06:56 PDT, Tim Nguyen (:ntim)
no flags Details | Formatted Diff | Diff
Patch (9.31 KB, patch)
2021-09-27 02:27 PDT, 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-09-23 05:11:10 PDT
The latter is less buggy, and one source of truth is always better.
Comment 1 Tim Nguyen (:ntim) 2021-09-23 08:05:36 PDT
Created attachment 439043 [details]
Patch
Comment 2 Tim Nguyen (:ntim) 2021-09-23 09:49:42 PDT
Created attachment 439053 [details]
Patch
Comment 3 Tim Nguyen (:ntim) 2021-09-25 06:56:44 PDT
Created attachment 439263 [details]
Patch
Comment 4 Antti Koivisto 2021-09-27 01:25:57 PDT
Comment on attachment 439263 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=439263&action=review

> Source/WebCore/dom/Element.cpp:3537
> +    // FIXME: Replace inert/modal dialog logic with style->effectiveInert() after fixing invalidation
> +    auto elementHasInertAttribute = [](Element& element) -> bool {
> +        return element.document().settings().inertAttributeEnabled() && is<HTMLElement>(element) && element.hasAttribute(HTMLNames::inertAttr);
> +    };
> +
> +    if (elementHasInertAttribute(const_cast<Element&>(*this)))
> +        return false;
> +
> +    Node* activeModalDialog = document().activeModalDialog();
> +    if (activeModalDialog && !activeModalDialog->containsIncludingShadowDOM(this))
> +        return false;

This doesn't look correct. I can look at some point into resolving this correctly via style.

Meanwhile I think you should leave Node::isInert() equivalent in place (that is compute inertness separately from DOM) and use that in isFocusable() as before.

Or you could just let whatever focusability-with-inert-test you are trying to fix regress. It is probably not critical at this point.
Comment 5 Tim Nguyen (:ntim) 2021-09-27 02:27:21 PDT
Created attachment 439336 [details]
Patch
Comment 6 EWS 2021-09-27 04:25:57 PDT
Committed r283105 (242163@main): <https://commits.webkit.org/242163@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 439336 [details].
Comment 7 Radar WebKit Bug Importer 2021-09-27 04:26:19 PDT
<rdar://problem/83568603>