<?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>301443</bug_id>
          
          <creation_ts>2025-10-24 14:02:04 -0700</creation_ts>
          <short_desc>UIEvents misbehaving when inline text prediction is active</short_desc>
          <delta_ts>2025-12-19 14:08:08 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>UI Events</component>
          <version>Safari 26</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Franco Vieira de Souza">franco_vieira</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>lily_spiniolas</cc>
    
    <cc>richard_robinson2</cc>
    
    <cc>rniwa</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2154129</commentid>
    <comment_count>0</comment_count>
    <who name="Franco Vieira de Souza">franco_vieira</who>
    <bug_when>2025-10-24 14:02:04 -0700</bug_when>
    <thetext>On macOS, while the inline text prediction is activated (grayed out text in front of what was already written), the UIEvents received by the the DOM seem to misbehave: a `compositionend` with no corresponding `compositionstart` event is fired; `keydown` events are ignored, and keyup events are being buffered (being dispatched all at once when the prediction ends). `input` and `beforeinput` events seem to fire normally.

Here&apos;s an excerpted log of what I observe when typing out `autocompl.` , which produces the text `autocomplete.`. Inline text prediction activated after typing out the first e; the second one is filled in after typing `.`, accepting the prediction:

```
a    keydown; tstamp=633.46s at t=633.47s
a    keypress; tstamp=633.46s at t=633.49s
a    beforeinput; tstamp=633.49s at t=633.49s
a    input; tstamp=633.50s at t=633.50s
a    keyup; tstamp=633.58s at t=633.59s

u    keydown; tstamp=633.59s at t=633.61s
u    keypress; tstamp=633.59s at t=633.63s
u    beforeinput; tstamp=633.63s at t=633.63s
u    input; tstamp=633.64s at t=633.64s
u    keyup; tstamp=633.73s at t=633.74s

( . . . omitting letters t-o-c-o-m-p . . . )

l    type=keydown; tstamp=635.83s at t=635.84s
l    type=keypress; tstamp=635.83s at t=635.86s
l    type=beforeinput; tstamp=635.86s at t=635.86s
l    type=input; tstamp=635.87s at t=635.87s
l    type=keyup; tstamp=635.92s at t=635.92s

( prediction start with e, it has its keyup buffered )

e    type=keydown; tstamp=636.73s at t=636.74s
e    type=keypress; tstamp=636.73s at t=636.76s
e    type=beforeinput; tstamp=636.76s at t=636.76s
e    type=input; tstamp=636.76s at t=636.76s

( random compositionend? )

e    type=compositionend; tstamp=637.09s at t=637.09s

( t is typed, filling a grayed out letter; no keydown is produced, and the keyup is buffered )

t   type=beforeinput; tstamp=637.36s at t=637.36s
t   type=input; tstamp=637.36s at t=637.36s

( typing . accepts the prediction )

.    type=beforeinput; tstamp=639.14s at t=639.14s
.    type=input; tstamp=639.14s at t=639.14s

( buffered events fired at once, in sequence, with old timestamps )
 
e    type=keyup; tstamp=636.79s at t=639.15s
t    type=keyup; tstamp=637.43s at t=639.18s
.    type=keyup; tstamp=639.19s at t=639.23s

```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2154130</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-10-24 14:02:37 -0700</bug_when>
    <thetext>&lt;rdar://problem/163364312&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>