<?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>217692</bug_id>
          
          <creation_ts>2020-10-13 21:31:55 -0700</creation_ts>
          <short_desc>`beforeinput` event is not fired when selecting an item of autocomplete or password manager</short_desc>
          <delta_ts>2024-05-07 00:30:26 -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>HTML Editing</component>
          <version>Safari 14</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>macOS 10.15</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Masayuki Nakano">masayuki</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>karlcow</cc>
    
    <cc>megan_gardner</cc>
    
    <cc>mike</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1697605</commentid>
    <comment_count>0</comment_count>
    <who name="Masayuki Nakano">masayuki</who>
    <bug_when>2020-10-13 21:31:55 -0700</bug_when>
    <thetext>1. Go to https://d-toybox.com/studio/lib/input_event_viewer.html
2. Choose &quot;&lt;input type=&quot;text&quot;&gt;&quot;
3. Submit the form below &quot;Test editor beahvior:&quot;
4. Then, you&apos;ll see same page, backspace some characters from the last to show autocomplete suggest.
5. Choose one of the list.

Then, `beforeinput` should be fired when replacing the `&lt;input&gt;`&apos;s value, but only `input` event is fired. You can check it with the table below &quot;Events:&quot;.

You can similar thing with password manager with choosing &quot;&lt;input type=&quot;password&quot;&gt;&quot; at #2.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1697840</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-10-14 12:58:30 -0700</bug_when>
    <thetext>&lt;rdar://problem/70304782&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1699542</commentid>
    <comment_count>2</comment_count>
    <who name="Masayuki Nakano">masayuki</who>
    <bug_when>2020-10-19 17:27:43 -0700</bug_when>
    <thetext>FYI: Firefox will ship `beforeinput` with the following hack because of this WebKit&apos;s bug and Blink&apos;s same bug (https://bugs.chromium.org/p/chromium/issues/detail?id=1051844).

1. Will fire `beforeinput` event when user uses build-in autocomplete etc.
2. Set its `inputType` to `insertReplacementText` as defined by the spec.
3. But make it not cancelable for protecting Firefox users from web apps which unexpectedly blocks default actions of `insertReplacementText`.

https://phabricator.services.mozilla.com/D93206</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2033392</commentid>
    <comment_count>3</comment_count>
    <who name="sideshowbarker">mike</who>
    <bug_when>2024-05-05 22:12:40 -0700</bug_when>
    <thetext>Nakano-san, Do you know if we have any relevant WPT tests for this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2033393</commentid>
    <comment_count>4</comment_count>
    <who name="sideshowbarker">mike</who>
    <bug_when>2024-05-05 22:14:54 -0700</bug_when>
    <thetext>Nakano-san, Is the Chrome behavior for this case spec-conforming?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2033645</commentid>
    <comment_count>5</comment_count>
    <who name="Masayuki Nakano">masayuki</who>
    <bug_when>2024-05-07 00:30:26 -0700</bug_when>
    <thetext>(In reply to sideshowbarker from comment #3)
&gt; Nakano-san, Do you know if we have any relevant WPT tests for this?

Unfortunately, there is no WPTs because the test driver does not provide a way to work with browsers&apos; UI like a popup of autocomplete.

(In reply to sideshowbarker from comment #4)
&gt; Nakano-san, Is the Chrome behavior for this case spec-conforming?

No, I filed Chromium bug too.
https://issues.chromium.org/issues/40673974</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>