<?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>172567</bug_id>
          
          <creation_ts>2017-05-24 17:57:11 -0700</creation_ts>
          <short_desc>Safari autofill doesn&apos;t work in form inputs that are in a shadow root</short_desc>
          <delta_ts>2023-06-14 10:19:38 -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>Forms</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=218507</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=203299</see_also>
          <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>
          
          <blocked>148695</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Taylor Savage">webkit</reporter>
          <assigned_to name="Ricky Mondello">rmondello</assigned_to>
          <cc>ben.hirsch</cc>
    
    <cc>cdumez</cc>
    
    <cc>daniel.ehrhardt</cc>
    
    <cc>iau87</cc>
    
    <cc>jberlin</cc>
    
    <cc>ldebeasi</cc>
    
    <cc>martincarstens</cc>
    
    <cc>maxwell.benton</cc>
    
    <cc>mnicpt</cc>
    
    <cc>peter.koshelev</cc>
    
    <cc>rmondello</cc>
    
    <cc>rniwa</cc>
    
    <cc>spatel2</cc>
    
    <cc>ssheldon</cc>
    
    <cc>tomerlichtash</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wenson_hsieh</cc>
    
    <cc>wwalter</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1312466</commentid>
    <comment_count>0</comment_count>
    <who name="Taylor Savage">webkit</who>
    <bug_when>2017-05-24 17:57:11 -0700</bug_when>
    <thetext>Autofill for form input fields such as credit card fields, email addresses, etc. doesn&apos;t appear to work for form inputs that are inside shadow roots.

Reproduction:

1) Go to polymer-shop2.appspot.com
2) Tap on &quot;men&apos;s outerwear&quot;
3) Tap on &quot;Men&apos;s tech shell full-zip&quot;
4) Tap on &quot;Add to cart&quot;
5) Tap on the cart icon on the upper right
6) Tap on &quot;Checkout&quot;
7) Tap in the &quot;Email&quot; field

Expected:
The autofill selector should appear to enable you to autofill from a contact.

Result:
No autofill appears supported.

This is also the case for other fields I&apos;d expect to autofill, like &quot;Card Number&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1312522</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2017-05-24 21:02:28 -0700</bug_when>
    <thetext>&lt;rdar://problem/32394943&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1813562</commentid>
    <comment_count>2</comment_count>
    <who name="Samuel Sheldon">ssheldon</who>
    <bug_when>2021-11-10 05:58:03 -0800</bug_when>
    <thetext>I have tried this in iOS 15.1 and this issue is still not fixed. 

This is a critical feature for many developers, is there any way to get an estimate on a fix? Or at the very lease a temporary work around or solution we can use in the mean time?

Any update or assistance you can give will be helpful, thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1815949</commentid>
    <comment_count>3</comment_count>
    <who name="Samuel Sheldon">ssheldon</who>
    <bug_when>2021-11-17 08:23:33 -0800</bug_when>
    <thetext>Any update on this issue?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1844641</commentid>
    <comment_count>4</comment_count>
    <who name="">peter.koshelev</who>
    <bug_when>2022-02-22 04:10:59 -0800</bug_when>
    <thetext>Same issue, when is it expected to be fixed!? 

it&apos;s 5th year already</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1880430</commentid>
    <comment_count>5</comment_count>
    <who name="Daniel Ehrhardt">daniel.ehrhardt</who>
    <bug_when>2022-07-03 13:33:49 -0700</bug_when>
    <thetext>Safari is the new Internet Explorer.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1883008</commentid>
    <comment_count>6</comment_count>
      <attachid>460859</attachid>
    <who name="Liam DeBeasi">ldebeasi</who>
    <bug_when>2022-07-13 08:53:31 -0700</bug_when>
    <thetext>Created attachment 460859
Code reproduction

I am attaching a new code reproduction as the link in the initial post is broken. Is there anything else we can do to help get this issue resolved?

Steps to reproduce:

1. Open reproduction on an iOS device.
2. Tap into any of the inputs in the &quot;Native&quot; section. Observe that the autofill/passwords button appears above the keyboard.
3. Tap into any of the inputs in the &quot;Web Component + Shadow DOM&quot; section. Observe that the autofill/passwords button does not appear above the keyboard.
4. Tap into any of the inputs in the &quot;Web Component + Light DOM&quot; section. Observe that the autofill/passwords button appears above the keyboard.

Expected Behavior:

I expect that the autofill button will appear regardless of the Shadow DOM.

Actual Behavior:

The autofill button only appears on inputs in the light DOM.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1898423</commentid>
    <comment_count>7</comment_count>
    <who name="Aidar">iau87</who>
    <bug_when>2022-09-14 02:54:16 -0700</bug_when>
    <thetext>Please fix this bug🙏</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1922616</commentid>
    <comment_count>8</comment_count>
    <who name="">ben.hirsch</who>
    <bug_when>2023-01-03 07:18:58 -0800</bug_when>
    <thetext>Any update on the progress of this? Autofill is supported by other browser makers. 

Looks like there is some progress in Chromium: https://chromestatus.com/feature/5769419581030400

Does webkit have any plans to support? Seems like a pretty important feature.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1923060</commentid>
    <comment_count>9</comment_count>
    <who name="Ricky Mondello">rmondello</who>
    <bug_when>2023-01-04 18:14:37 -0800</bug_when>
    <thetext>Fixing this actually requires a Safari change, not a WebKit change. I will report back to this bug when a fix for this is testable in Safari Technology Preview.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1923577</commentid>
    <comment_count>10</comment_count>
    <who name="Martin">martincarstens</who>
    <bug_when>2023-01-06 13:10:45 -0800</bug_when>
    <thetext>Would love to see support for this.

We&apos;ve had great feedback from clients moving away from remotely hosted iframes and re-implementing in client-hosted Shadow DOMs, but cannot recommend Safari on Mac over Chrome as a result of lacking autofill support.

On iOS, Safari performs better than the Chrome WebKit wrapper. Unlike Chrome, Safari can tab input fields and toggle the virtual keyboard. Unfortunately neither browser does autofill.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1923578</commentid>
    <comment_count>11</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2023-01-06 13:13:20 -0800</bug_when>
    <thetext>It would be really helpful for people commenting here to post URLs of websites that this bug affects.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1928294</commentid>
    <comment_count>12</comment_count>
    <who name="Ricky Mondello">rmondello</who>
    <bug_when>2023-01-25 15:20:46 -0800</bug_when>
    <thetext>Hi folks!

This is resolved in Safari Technology Preview 162. At least, I made a code change in Safari that I *believe* resolves it. (I used the reproduction attached by Liam DeBeasi to test.)

Can all of y’all who care about this issue give your web content a spin with Safari Technology Preview 162 and report back about whether the AutoFill issue is resolved or not? I’d really appreciate that, and I also appreciate your patience.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1928398</commentid>
    <comment_count>13</comment_count>
    <who name="Martin">martincarstens</who>
    <bug_when>2023-01-25 19:29:11 -0800</bug_when>
    <thetext>Confirmed working in Safari Technology Preview Release 162 (Safari 16.4, WebKit 18615.1.18.2) on MacOS Ventura. 

Is there a way to test this on iOS?

Thank you, Ricky!!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1929384</commentid>
    <comment_count>14</comment_count>
    <who name="Ricky Mondello">rmondello</who>
    <bug_when>2023-01-30 07:10:36 -0800</bug_when>
    <thetext>&gt; Is there a way to test this on iOS?

Not at this time. I’ll try to bump this bug once the fix is testable in an iOS beta.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1939486</commentid>
    <comment_count>15</comment_count>
    <who name="Steve">mnicpt</who>
    <bug_when>2023-03-07 09:51:47 -0800</bug_when>
    <thetext>Ricky,
How long does it usually take for the fix in Safari Technology Preview to show up in Safari?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1939499</commentid>
    <comment_count>16</comment_count>
    <who name="Ricky Mondello">rmondello</who>
    <bug_when>2023-03-07 10:43:35 -0800</bug_when>
    <thetext>macOS Ventura 13.3, iOS 16.4, and iPadOS 16.4 contain this fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1942824</commentid>
    <comment_count>17</comment_count>
    <who name="Sunny Patel">spatel2</who>
    <bug_when>2023-03-21 07:30:18 -0700</bug_when>
    <thetext>Ricky, thank you so much for this fix!

We noticed when building nested web components each with their own shadowDOM trees, that autofill still doesn&apos;t work.  Have you tested for this use case? It occurs quite often if you&apos;re building a web components using something like Lit or StencilJS</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1942897</commentid>
    <comment_count>18</comment_count>
    <who name="Ricky Mondello">rmondello</who>
    <bug_when>2023-03-21 12:24:07 -0700</bug_when>
    <thetext>Thanks Sunny!

&gt; We noticed when building nested web components each with their own shadowDOM trees, that autofill still doesn&apos;t work.  Have you tested for this use case? It occurs quite often if you&apos;re building a web components using something like Lit or StencilJS

I’m very motivated to get this fixed. Do you think you could create some kind of reduced test case, ideally a single HTML file, and attach it to this bug? That way, I’ll have something that represents exactly what you’d like to see work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1943090</commentid>
    <comment_count>19</comment_count>
    <who name="Sunny Patel">spatel2</who>
    <bug_when>2023-03-22 07:27:19 -0700</bug_when>
    <thetext>Ricky, 

My apologies looks like it is fixed as well. 

Here&apos;s the test is used: https://9tmy5w-3333.csb.app

Worked fine in technology preview version, Release 165 (Safari 16.4, WebKit 18616.1.4.4). 

Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1943100</commentid>
    <comment_count>20</comment_count>
    <who name="Ricky Mondello">rmondello</who>
    <bug_when>2023-03-22 08:29:14 -0700</bug_when>
    <thetext>I’m so happy to hear that!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1957894</commentid>
    <comment_count>21</comment_count>
    <who name="maxwell.benton@mastercard.com">maxwell.benton</who>
    <bug_when>2023-05-25 06:53:55 -0700</bug_when>
    <thetext>Hello Ricky,

I can open a separate ticket if you prefer, but one-time-code autofill in the shadow DOM still appears to not be fully working after testing on Safari 16.4 and now 16.5.

Here is an example with a minimal shadow DOM component alongside a regular HTML input for comparison: https://playcode.io/1482887

As of iOS 16.4, the code autofill suggestion now appears for the shadow DOM input, but clicking on the suggestion does not populate the element with the code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1957911</commentid>
    <comment_count>22</comment_count>
    <who name="Ricky Mondello">rmondello</who>
    <bug_when>2023-05-25 08:56:36 -0700</bug_when>
    <thetext>Hi Maxwell.

You’ll find that this is fixed in the betas of Safari Version 16.6, as well as in Safari Technology Preview.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1961577</commentid>
    <comment_count>23</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2023-06-14 10:19:38 -0700</bug_when>
    <thetext>*** Bug 257804 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>460859</attachid>
            <date>2022-07-13 08:53:31 -0700</date>
            <delta_ts>2022-07-13 08:53:31 -0700</delta_ts>
            <desc>Code reproduction</desc>
            <filename>index.html</filename>
            <type>text/html</type>
            <size>2553</size>
            <attacher name="Liam DeBeasi">ldebeasi</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgogIDxo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l
OiAxNnB4OwogICAgICAgICAgICAgIH0KICAgICAgICAgICAgPC9zdHlsZT4KICAgICAgICAgICAg
PGlucHV0IHR5cGU9IiR7Z2V0VHlwZSgpfSIgbmFtZT0iJHtnZXROYW1lKCl9IiBwbGFjZWhvbGRl
cj0iJHtnZXRQbGFjZWhvbGRlcigpfSIgLz4KICAgICAgICAgIGAKICAgICAgICB9CiAgICAgIH0K
ICAgICAgCiAgICAgIHdpbmRvdy5jdXN0b21FbGVtZW50cy5kZWZpbmUoJ2FwcC1pbnB1dCcsIEFw
cElucHV0KTsKICAgICAgCiAgICAgIGNsYXNzIEFwcElucHV0TGlnaHQgZXh0ZW5kcyBIVE1MRWxl
bWVudCB7CiAgICAgICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgICBzdXBlcigpOwogICAgICAg
ICAgCiAgICAgICAgICBjb25zdCBnZXRUeXBlID0gKCkgPT4gewogICAgICAgICAgICByZXR1cm4g
dGhpcy5nZXRBdHRyaWJ1dGUoJ3R5cGUnKTsKICAgICAgICAgIH0KICAgICAgICAgIGNvbnN0IGdl
dFBsYWNlaG9sZGVyID0gKCkgPT4gewogICAgICAgICAgICByZXR1cm4gdGhpcy5nZXRBdHRyaWJ1
dGUoJ3BsYWNlaG9sZGVyJyk7CiAgICAgICAgICB9CiAgICAgICAgICBjb25zdCBnZXROYW1lID0g
KCkgPT4gewogICAgICAgICAgICByZXR1cm4gdGhpcy5nZXRBdHRyaWJ1dGUoJ25hbWUnKTsKICAg
ICAgICAgIH0KICAgICAgICAgIHRoaXMuaW5uZXJIVE1MID0gYAogICAgICAgICAgICA8aW5wdXQg
dHlwZT0iJHtnZXRUeXBlKCl9IiBuYW1lPSIke2dldE5hbWUoKX0iIHBsYWNlaG9sZGVyPSIke2dl
dFBsYWNlaG9sZGVyKCl9IiAvPgogICAgICAgICAgYAogICAgICAgIH0KICAgICAgfQogICAgICAK
ICAgICAgd2luZG93LmN1c3RvbUVsZW1lbnRzLmRlZmluZSgnYXBwLWlucHV0LWxpZ2h0JywgQXBw
SW5wdXRMaWdodCk7CiAgICA8L3NjcmlwdD4KICA8L2JvZHk+CjwvaHRtbD4K
</data>

          </attachment>
      

    </bug>

</bugzilla>