<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>327523</bug_id>
          
          <creation_ts>2026-10-14 04:27:51 -0700</creation_ts>
          <short_desc>[WPEPlatform] Headless views are never focused, so `document.hasFocus()` is always `false`</short_desc>
          <delta_ts>2026-10-26 09:45:40 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Vitaly Dyackhov">vitaly</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2263769</commentid>
    <comment_count>0</comment_count>
    <who name="Vitaly Dyackhov">vitaly</who>
    <bug_when>2026-10-14 04:27:51 -0700</bug_when>
    <thetext>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&apos;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&apos;t catch this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2263774</commentid>
    <comment_count>1</comment_count>
    <who name="Vitaly Dyackhov">vitaly</who>
    <bug_when>2026-10-14 05:16:39 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/77001</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2269373</commentid>
    <comment_count>2</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-10-26 09:45:38 -0700</bug_when>
    <thetext>Committed 324721@main (b2ee81e6da9c): &lt;https://commits.webkit.org/324721@main&gt;

Reviewed commits have been landed. Closing PR #77001 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>