[Webkit-unassigned] [Bug 237273] Implement focus fixup rule
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Feb 28 06:38:28 PST 2022
https://bugs.webkit.org/show_bug.cgi?id=237273
Tim Nguyen (:ntim) <ntim at apple.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rniwa at webkit.org
--- Comment #1 from Tim Nguyen (:ntim) <ntim at apple.com> ---
Adding this seems to work:
```
if (auto* activeElement = document.activeElement()) {
if (!activeElement->isFocusable())
document.setFocusedElement(nullptr);
}
```
I put it in the RenderingUpdateStep::FlushAutofocusCandidates block, but that's probably not the right place (not sure which one is?).
One thing that's broken is interaction with shadow DOM: shadow-dom/focus/focus-pseudo-on-shadow-host-1.html fails. This is precisely because activeElement->isFocusable() doesn't take in account contents of the shadow DOM, and wrongly clears focus in this case. Though I expect that's not too hard to fix.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220228/c991328f/attachment.htm>
More information about the webkit-unassigned
mailing list