RESOLVED FIXED327523
[WPEPlatform] Headless views are never focused, so `document.hasFocus()` is always `false`
https://bugs.webkit.org/show_bug.cgi?id=327523
Summary [WPEPlatform] Headless views are never focused, so `document.hasFocus()` is a...
Vitaly Dyackhov
Reported 2026-10-14 04:27:51 PDT
Views created on a `WPEDisplayHeadless` are mapped as soon as they are added to a toplevel, but nothing ever calls `wpe_view_focus_in()` on them. The view's `has-focus` flag stays `false`, so the page never gets `ActivityState::IsFocused`. As a result, in headless mode: - `document.hasFocus()` is always false, and `window.focus()` does not change it. - `element.focus()` updates `document.activeElement`, but the element does not match `:focus` and no `focus`/`blur` events are dispatched. - The input method context never gets `notify_focus_in`, so an on-screen keyboard is never requested for focused editable elements. The only thing that focuses a headless view today is a pointer-down event, so a WebDriver click works, but focusing from script does not. The test harnesses (`WebKitTestRunner`, `TestWebKitAPI`) call `wpe_view_focus_in()` themselves, which is why existing tests don't catch this.
Attachments
Vitaly Dyackhov
Comment 1 2026-10-14 05:16:39 PDT
EWS
Comment 2 2026-10-26 09:45:38 PDT
Committed 324721@main (b2ee81e6da9c): <https://commits.webkit.org/324721@main> Reviewed commits have been landed. Closing PR #77001 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.