Skip to content
Open
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
eda8a81
Add an autofill module
yoavweiss May 6, 2024
6b787ce
Fixed up some bikeshed defs
yoavweiss May 6, 2024
01be87a
Fix two more linking issues
yoavweiss May 7, 2024
309dd38
Fix up cddl
yoavweiss May 7, 2024
1db9aa0
remove autofill.save, describe autofill store explicitly for each test
martinlechner May 28, 2024
1c6e76d
Remove the context autofill store and fix linking
yoavweiss May 30, 2024
2485d7f
upper/lowercase fixes
martinlechner Jun 5, 2024
1821ed6
specify valid autofill field names, add handling of unsupported values.
martinlechner Jun 5, 2024
45f5b4b
Remove user agent linking
yoavweiss Jun 14, 2024
b9c0ff3
Fix bikeshed error by dropping |fields| reference
yoavweiss Jun 14, 2024
c648b82
style
yoavweiss Jun 14, 2024
e200834
Fix cddl error
yoavweiss Jun 14, 2024
0115db1
Update browser context to navigable
theindra Mar 18, 2025
92b99fb
Remove parts that cause build errors
theindra Mar 18, 2025
a29e2c1
Change to single field for trigger function
theindra Mar 18, 2025
18b152c
Revert "Remove parts that cause build errors"
theindra Mar 18, 2025
3d6fc48
Remove broken spec code
theindra Mar 18, 2025
0016aca
Add setAddress
yoavweiss Mar 20, 2025
4207b82
Fix autofill type generation
theindra Mar 20, 2025
f9f4dba
Remove useless ref
yoavweiss Aug 29, 2025
8313e42
Fix up spec build
yoavweiss Aug 29, 2025
c73f6fd
Rebase and align to the latest proposal
yoavweiss Aug 29, 2025
8c3d1b1
Fix up remote end definition
yoavweiss Aug 29, 2025
5b1a397
Tighten up dfns
yoavweiss Aug 29, 2025
d4ce738
Clean ups
yoavweiss Aug 29, 2025
97ffef9
Remove field
yoavweiss Aug 29, 2025
28c25de
Add processing for address/card
yoavweiss Sep 2, 2025
bec6136
s/navigable/context/
yoavweiss Sep 2, 2025
556cf8e
Update index.bs
yoavweiss Sep 9, 2025
6b5310a
Update index.bs
yoavweiss Sep 9, 2025
77d464e
Update index.bs
yoavweiss Sep 9, 2025
d75e784
Update index.bs
yoavweiss Sep 9, 2025
19be917
Define the autofillToken values
yoavweiss Sep 10, 2025
d4c2429
style
yoavweiss Sep 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
192 changes: 191 additions & 1 deletion index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ spec: WEBDRIVER; urlPrefix: https://w3c.github.io/webdriver/
text: input cancel list; url: dfn-input-cancel-list
text: intermediary node; url: dfn-intermediary-nodes
text: invalid argument; url: dfn-invalid-argument
text: invalid element state; url: dfn-invalid-element-state
text: invalid selector; url: dfn-invalid-selector
text: invalid session id; url: dfn-invalid-session-id
text: is element origin; url: dfn-is-element-origin
Expand Down Expand Up @@ -215,9 +216,12 @@ spec: HTML; urlPrefix: https://html.spec.whatwg.org/multipage/
text: activation notification; url: interaction.html#activation-notification
text: active window; url: document-sequences.html#nav-window
text: alert; url: timers-and-user-prompts.html#dom-alert
text: autofill; url: form-control-infrastructure.html#autofill
text: autofill detail tokens; url: form-control-infrastructure.html#autofill-detail-tokens
text: close; url: document-sequences.html#close-a-top-level-traversable
text: disabled; url: form-control-infrastructure.html#concept-fe-disabled
text: File Upload state; url: input.html#file-upload-state-(type=file)
text: form-associated element; url: forms.html#form-associated-element
text: confirm; url: timers-and-user-prompts.html#dom-confirm
text: context mode; url: /canvas.html#offscreencanvas-context-mode
text: create a classic script; url: webappapis.html#creating-a-classic-script
Expand Down Expand Up @@ -263,6 +267,7 @@ spec: HTML; urlPrefix: https://html.spec.whatwg.org/multipage/
spec: INFRA; urlPrefix: https://infra.spec.whatwg.org/
type: dfn
text: convert a JSON-derived JavaScript value to an Infra value; url: convert-a-json-derived-javascript-value-to-an-infra-value
text: values
spec: RESOURCE-TIMING; urlPrefix: https://w3c.github.io/resource-timing/
type: dfn
text: convert fetch timestamp; url: dfn-convert-fetch-timestamp
Expand Down Expand Up @@ -455,7 +460,8 @@ CommandData = (
ScriptCommand //
SessionCommand //
StorageCommand //
WebExtensionCommand
WebExtensionCommand //
AutofillCommand
)

EmptyParams = {
Expand Down Expand Up @@ -691,6 +697,7 @@ with the following additional codes:
<pre class="cddl" data-cddl-module="local-cddl">
ErrorCode = "invalid argument" /
"invalid selector" /
"invalid element state" /
"invalid session id" /
"invalid web extension" /
"move target out of bounds" /
Expand Down Expand Up @@ -13616,6 +13623,189 @@ The [=remote end steps=] given |session| and |command parameters| are:

</div>

## The autofill Module ## {#module-autofill}

The <dfn export for=modules>autofill module</dfn> contains functionality for triggering autofill.

### Definition ### {#module-autofill-definition}

{^remote end definition^}

<pre class="cddl" data-cddl-module="remote-cddl">

AutofillCommand = (
autofill.Trigger
)
</pre>

### Commands ### {#module-autofill-commands}

#### The autofill.trigger Command #### {#command-autofill-trigger}

The <dfn export for=commands>autofill.trigger</dfn> command triggers autofill
on a particular form field using the provided fields.

<dl>
<dt>Command Type</dt>
<dd>
<pre class="cddl" data-cddl-module="remote-cddl">
autofill.Trigger = (
method: "autofill.trigger",
params: autofill.TriggerParameters
)

autofill.TriggerParameters = {
context: browsingContext.BrowsingContext,
element: script.SharedReference,
? card: autofill.Card,
? address: autofill.Address
}

autofill.Field = {
name: autofill.FieldName,
value: text
}

autofill.Card = {
number: text,
name: text,
expiryMonth: text,
expiryYear: text,
cvc: text
}

autofill.Address = {
fields: [* autofill.Field]
}

</pre>
</dd>
<dt>Return Type</dt>
<dd>
<code>
EmptyResult
</code>
</dd>
</dl>

<div algorithm="remote end steps for autofill.Trigger">

The [=remote end steps=] with |session| and |command parameters| are:

1. Let |navigable id| be the value of the <code>context</code> field of
|command parameters|.

1. Let |navigable| be the result of [=trying=] to [=get a navigable=]
with |navigable id|.

1. Let |document| be |navigable|'s [=active document=].

1. Let |environment settings| be the [=environment settings object=] whose
[=relevant global object=]'s <a>associated <code>Document</code></a> is
|document|.

1. Let |realm| be |environment settings|' [=realm execution context=]'s
Realm component.

1. Let |element id| be the value of the <code>element</code> field of
|command parameters|.

1. Let |element| be the result of [=trying=] to [=deserialize remote reference=]
with the |element id|, |realm|, and |session|.

1. If |element| is not a [=form-associated element=] or |element|'s [=form owner=] is
null, return an [=error=] with [=error code=] [=invalid element state=].

1. Let |card| be the value of the <code>card</code> field of |command parameters| if present, or null otherwise.

1. Let |address| be the value of the <code>address</code> field of |command parameters| if present, or null otherwise.

1. If, for any reason, the remote end is unable to [=autofill=], return error with
[=error code=] [=unsupported operation=].

1. If both |card| and |address| are not null, return error with [=error code=]
[=invalid argument=].

1. If both |card| and |address| are null, return error with [=error code=]
[=invalid argument=].

1. Let |parsed card| be the result of parsing |card| as an <code>autofill.Card</code>.

1. Let |parsed address| be the result of parsing |card| as an <code>autofill.Address</code>.

1. The [=/user agent=] should [=autofill=] |element| and |element|'s [=form
owner=], while taking into account the contents of |parsed card| and |parsed address|.

1. Return [=success=] with data null.

</div>

#### The autofill.FieldName Type #### {#type-autofill-FieldName}

<pre class="cddl" data-cddl-module="local-cddl">
AutofillToken = "name" /
"honorific-prefix" /
"given-name" /
"additional-name" /
"family-name" /
"honorific-suffix" /
"nickname" /
"username" /
"new-password" /
"current-password" /
"one-time-code" /
"organization-title" /
"organization" /
"street-address" /
"address-line1" /
"address-line2" /
"address-line3" /
"address-level4" /
"address-level3" /
"address-level2" /
"address-level1" /
"country" /
"country-name" /
"postal-code" /
"cc-name" /
"cc-given-name" /
"cc-additional-name" /
"cc-family-name" /
"cc-number" /
"cc-exp" /
"cc-exp-month" /
"cc-exp-year" /
"cc-csc" /
"cc-type" /
"transaction-currency" /
"transaction-amount" /
"language" /
"bday" /
"bday-day" /
"bday-month" /
"bday-year" /
"sex" /
"url" /
"photo" /
"tel" /
"tel-country-code" /
"tel-national" /
"tel-area-code" /
"tel-local" /
"tel-local-prefix" /
"tel-local-suffix" /
"tel-extension" /
"email" /
"impp"
</pre>

<pre class="cddl" data-cddl-module="remote-cddl,local-cddl">
autofill.FieldName = AutofillToken;
</pre>

The <code>autofill.FieldName</code> is an <code>AutofillToken</code>. Valid token
values are defined in [=autofill detail tokens=].

### Events ### {#module-input-events}

#### The input.fileDialogOpened Event #### {#event-input-fileDialogOpened}
Expand Down