RESOLVED FIXED 229330
Implement hit testing bits of inert subtrees
https://bugs.webkit.org/show_bug.cgi?id=229330
Summary Implement hit testing bits of inert subtrees
Tim Nguyen (:ntim)
Reported 2021-08-20 02:30:53 PDT
Depending on whether we want to affect JS APIs or not, we can either: * Change hit testing code to treat inert nodes as pointer-events: none, like in: https://github.com/nt1m/WebKit/commit/991684e0f3b810e566329e0c031342de613933b0 -> This is close to Firefox's implementation -> Firefox argues the spec should be this way: https://github.com/whatwg/html/issues/5650 * Treat inert nodes more like isDisabledFormControl() (e.g. having similar checks when triggering events) -> More similar to Chrome's implementation -> Closer to latest inert attribute PR by the Chromium team: https://github.com/whatwg/html/pull/4288 In the context of <dialog>, I think both approaches are acceptable wrt. the spec and similarly easy. Hit testing also doesn't matter much generally since everything is behind a backdrop in a modal dialog context. This is more relevant for the inert attribute implementation.
Attachments
Patch (14.09 KB, patch)
2021-08-31 11:49 PDT, Tim Nguyen (:ntim)
no flags
Patch (23.75 KB, patch)
2021-09-20 04:45 PDT, Tim Nguyen (:ntim)
no flags
Patch (23.75 KB, patch)
2021-09-20 05:36 PDT, Tim Nguyen (:ntim)
no flags
Patch (43.43 KB, patch)
2021-09-22 14:40 PDT, Tim Nguyen (:ntim)
no flags
Patch (49.46 KB, patch)
2021-09-23 01:24 PDT, Tim Nguyen (:ntim)
no flags
Patch (42.79 KB, patch)
2021-09-23 05:06 PDT, Tim Nguyen (:ntim)
no flags
Patch (30.43 KB, patch)
2021-09-23 08:03 PDT, Tim Nguyen (:ntim)
no flags
Patch (30.75 KB, patch)
2021-09-25 06:50 PDT, Tim Nguyen (:ntim)
no flags
Radar WebKit Bug Importer
Comment 1 2021-08-20 14:39:26 PDT
Tim Nguyen (:ntim)
Comment 2 2021-08-31 11:49:32 PDT
Tim Nguyen (:ntim)
Comment 3 2021-09-20 04:45:18 PDT
Antti Koivisto
Comment 4 2021-09-20 05:06:31 PDT
Comment on attachment 438657 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=438657&action=review > Source/WebCore/rendering/style/StyleRareInheritedData.h:169 > + bool isInert; You should include this into the bitfield with the rest of the booleans.
Tim Nguyen (:ntim)
Comment 5 2021-09-20 05:36:51 PDT
Tim Nguyen (:ntim)
Comment 6 2021-09-22 14:40:28 PDT
Tim Nguyen (:ntim)
Comment 7 2021-09-23 01:24:32 PDT
Tim Nguyen (:ntim)
Comment 8 2021-09-23 01:30:44 PDT
Comment on attachment 439020 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=439020&action=review > Source/WebCore/style/StyleSharingResolver.cpp:283 > + return false; Note to self, this could use an inert attribute feature flag check (though not sure if that slows down the SharingResolver or not)
Tim Nguyen (:ntim)
Comment 9 2021-09-23 01:30:46 PDT
Comment on attachment 439020 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=439020&action=review > Source/WebCore/style/StyleSharingResolver.cpp:283 > + return false; Note to self, this could use an inert attribute feature flag check (though not sure if that slows down the SharingResolver or not)
Antti Koivisto
Comment 10 2021-09-23 01:31:52 PDT
Comment on attachment 439020 [details] Patch Please split this up to pieces that can be reviewed separately (along the lines of "Add effectiveInert bit to RenderStyle")
Tim Nguyen (:ntim)
Comment 11 2021-09-23 05:06:40 PDT
Tim Nguyen (:ntim)
Comment 12 2021-09-23 08:03:55 PDT
Antti Koivisto
Comment 13 2021-09-24 02:28:12 PDT
Comment on attachment 439042 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=439042&action=review > Source/WebCore/style/StyleAdjuster.cpp:526 > + bool isInertSubtreeRoot = (m_document.activeModalDialog() && m_element == m_document.documentElement()) > + || (m_document.settings().inertAttributeEnabled() && is<HTMLElement>(m_element) && m_element->hasAttribute(HTMLNames::inertAttr)); This would read better as a lambda. > Source/WebCore/style/StyleAdjuster.cpp:532 > + if (isInertSubtreeRoot) > + style.setEffectiveInert(true); > + > + // Make sure the active dialog is interactable when the whole document is blocked by the modal dialog > + if (m_element == m_document.activeModalDialog()) > + style.setEffectiveInert(false); What should happen when you have an active <dialog inert>?
Tim Nguyen (:ntim)
Comment 14 2021-09-25 06:50:50 PDT
Tim Nguyen (:ntim)
Comment 15 2021-09-25 06:53:40 PDT
Tim Nguyen (:ntim)
Comment 16 2021-10-04 00:39:35 PDT
*** Bug 229410 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.