Intent to Ship: Autofill in ShadowDOM

948 views
Skip to first unread message

Joey Arhar

unread,
Feb 14, 2022, 11:52:42 AM2/14/22
to blink-dev

Contact emails

jar...@chromium.org

Explainer

None

Specification

https://github.com/whatwg/html/pull/2149

Summary

This feature allows autofill to look into ShadowDOM when collecting form controls within a form element. With the adoption of web components, it is common to wrap form controls like input elements in ShadowDOM. When autofill traverses the children of form elements to collect form controls, it currently skips ShadowDOM, and makes these form controls never get autofilled. This feature will make autofill also traverse into ShadowDOM when collecting form controls.


This has been a highly requested feature: https://bugs.chromium.org/p/chromium/issues/detail?id=649162


Here is a gif that shows the difference on this website:

AutofillShadowDOM.gif




Blink component

Blink>DOM>ShadowDOM

TAG review

None

TAG review status

Not applicable

Risks



Interoperability and Compatibility

I believe there is low compat risk. As far as I know, much autofill behavior already diverges between browsers.

Gecko: No signal

WebKit: No signal

Web developers:
There has been a lot of anticipation from web developers in this bug: https://bugs.chromium.org/p/chromium/issues/detail?id=649162

Other signals:


Debuggability



Is this feature fully tested by web-platform-tests?

No. Autofill is not testable in WPT, as far as I know. In order to test this feature, I had to make C++ browser tests.

Flag name

--enable-blink-features=AutofillShadowDOM

Requires code in //chrome?

False

Tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=649162

Launch bug

https://bugs.chromium.org/p/chromium/issues/detail?id=1295760

Estimated milestones

M99



Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5769419581030400

This intent message was generated by Chrome Platform Status.

Joey Arhar

unread,
Feb 15, 2022, 1:02:11 PM2/15/22
to blink-dev
Some additional context: I've been working on this feature for almost a year and it is currently enabled at 50% via finch on beta, and I'd like to go to 1% stable shortly. In retrospect I'm not sure if this is a web exposed feature that should have an I2S or a simple bug fix for a browser feature. API owners, WDYT?

TAMURA, Kent

unread,
Feb 15, 2022, 6:27:49 PM2/15/22
to Joey Arhar, blink-dev
IMO, it's just a bug fix and doesn't need an I2S.

LGTM1 just in case.


--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAK6btwKqys0L3x%2BV5ZKtc83o0qYCnF-EHaWToGnedhsegDj0JA%40mail.gmail.com.


--
TAMURA Kent
Software Engineer, Google


Mike Taylor

unread,
Feb 15, 2022, 6:39:50 PM2/15/22
to TAMURA, Kent, blink-dev, Joey Arhar

Manuel Rego Casasnovas

unread,
Feb 16, 2022, 4:39:33 AM2/16/22
to Mike Taylor, TAMURA, Kent, blink-dev, Joey Arhar
LGTM3.

Some comments inline.

On 16/02/2022 00:39, Mike Taylor wrote:
>> Interoperability and Compatibility
>>
>> I believe there is low compat risk. As far as I know, much
>> autofill behavior already diverges between browsers.
>>
>> Gecko: No signal
>>
>> WebKit: No signal

Does this works in other browsers? Have we reported bugs if it doesn't?

>> Is this feature fully tested by web-platform-tests
>> <https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_platform_tests.md>?
>>
>> No. Autofill is not testable in WPT, as far as I know. In
>> order to test this feature, I had to make C++ browser tests.

Yeah, and there's already an issue about that:
https://github.com/web-platform-tests/wpt/issues/27118

Cheers,
Rego

Joey Arhar

unread,
Feb 16, 2022, 1:30:31 PM2/16/22
to Manuel Rego Casasnovas, Mike Taylor, TAMURA, Kent, blink-dev
> Yeah, and there's already an issue about that:
https://github.com/web-platform-tests/wpt/issues/27118

Thanks! I'll watch this in case I can ever add WPTs for this.

> Does this works in other browsers? Have we reported bugs if it doesn't?

I don't think other browsers do this, but I couldn't get autofill to even fill the non-ShadowDOM input on my test page on firefox or safari...

Joey Arhar

unread,
Feb 17, 2022, 3:21:45 PM2/17/22
to Changhao Han, blink-dev, mike...@chromium.org, Kent Tamura, Manuel Rego
> The required “Debuggability” section was left empty. Per the guide at https://goo.gle/devtools-checklist, we need to ensure that DevTools supports basic display and editing of new HTML features — which would likely work out-of-the-box anyhow. Please follow this guide and elaborate on how developers would inspect & debug this new feature please. Thanks!

Apologies for leaving this empty. As far as I know, there is unfortunately no existing debuggability of autofill in DevTools in general.
I'm not sure what autofill debugging would look like, but if that ever happens, I'd be happy to add in any logic for this feature if needed.

On Thu, Feb 17, 2022 at 3:20 AM Changhao Han <chang...@google.com> wrote:
The required “Debuggability” section was left empty. Per the guide at https://goo.gle/devtools-checklist, we need to ensure that DevTools supports basic display and editing of new HTML features — which would likely work out-of-the-box anyhow. Please follow this guide and elaborate on how developers would inspect & debug this new feature please. Thanks!

Changhao Han

unread,
Feb 17, 2022, 11:55:48 PM2/17/22
to blink-dev, Joey Arhar, mike...@chromium.org, Kent Tamura, blink-dev, Manuel Rego
The required “Debuggability” section was left empty. Per the guide at https://goo.gle/devtools-checklist, we need to ensure that DevTools supports basic display and editing of new HTML features — which would likely work out-of-the-box anyhow. Please follow this guide and elaborate on how developers would inspect & debug this new feature please. Thanks!

On Wednesday, February 16, 2022 at 7:30:31 PM UTC+1 Joey Arhar wrote:

Joey Arhar

unread,
Feb 22, 2022, 12:12:28 PM2/22/22
to Changhao Han, blink-dev, mike...@chromium.org, Kent Tamura, Manuel Rego
> Does this works in other browsers? Have we reported bugs if it doesn't?

I just found this WebKit bug someone else reported: https://bugs.webkit.org/show_bug.cgi?id=172567
I'm guessing this means it doesn't work in WebKit, at least.

prerana wankhade

unread,
Mar 8, 2022, 11:48:54 AM3/8/22
to blink-dev, Joey Arhar, blink-dev
Hello Team,

Do we have any update on the ongoing "Autofill in ShadowDOM" issue, is there a solution in place, if not then when can we expect the release/live?

Thanks in Advance,
Prerana

Joey Arhar

unread,
Mar 8, 2022, 12:37:56 PM3/8/22
to prerana wankhade, blink-dev
I am currently moving the feature through chrome's experimentation channels. I will update the tracking bug when it is enabled by default: https://bugs.chromium.org/p/chromium/issues/detail?id=649162
Reply all
Reply to author
Forward
0 new messages