diff --git a/index.bs b/index.bs index 0f8fed14..74ea80f2 100644 --- a/index.bs +++ b/index.bs @@ -80,6 +80,7 @@ spec: WEBDRIVER; urlPrefix: https://w3c.github.io/webdriver/ text: input cancel list; url: dfn-input-cancel-list text: intermediary node; url: dfn-intermediary-node 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 @@ -185,9 +186,12 @@ spec: HTML; urlPrefix: https://html.spec.whatwg.org/multipage/ text: active document; for: browsing context; url: document-sequences.html#active-document text: active window; url: document-sequences.html#active-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: window-object.html#close-a-browsing-context 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 @@ -421,7 +425,8 @@ CommandData = ( NetworkCommand // ScriptCommand // SessionCommand // - StorageCommand + StorageCommand // + AutofillCommand ) EmptyParams = { @@ -636,6 +641,7 @@ with the following additional codes:
 ErrorCode = "invalid argument" /
             "invalid selector" /
+            "invalid element state" /
             "invalid session id" /
             "move target out of bounds" /
             "no such alert" /
@@ -10696,6 +10702,107 @@ The [=remote end steps=] given |session| and |command parameters| are:
 
 
 
+## The autofill Module ## {#module-autofill}
+
+The autofill module contains functionality for triggering autofill.
+
+### Definition ### {#module-autofill-definition}
+
+[=remote end definition=]
+
+
+
+AutofillCommand = (
+  autofill.trigger
+)
+
+ +### Commands ### {#module-autofill-commands} + +#### The autofill.trigger Command #### {#command-autofill-trigger} + +The autofill.trigger command triggers autofill +on a particular form field using the provided fields. + +
+
Command Type
+
+
+      autofill.trigger = (
+        method: "autofill.trigger",
+        params: autofill.TriggerParameters
+      )
+
+      autofill.TriggerParameters = {
+        context: browsingContext.BrowsingContext,
+        element: script.SharedReference,
+        fields: [*autofill.Field]
+      }
+
+      autofill.Field = (
+        name: autofill.FieldName,
+        value: text
+      )
+    
+
+
Return Type
+
+
+     EmptyResult
+    
+
+
+ +
+ +The [=remote end steps=] with |session| and |command parameters| are: + +1. Let |context id| be the value of the context field of + |command parameters|. + +1. Let |context| be the result of [=trying=] to [=get a browsing context=] + with |context id|. + +1. Let |document| be |context|'s [=active document=]. + +1. Let |environment settings| be the [=environment settings object=] whose + [=relevant global object=]'s associated Document is + |document|. + +1. Let |realm| be |environment settings|' [=realm execution context=]'s + Realm component. + +1. Let |element id| be the value of the element field of + |command parameters|. + +1. Let |element| be the result of [=trying=] to [=deserialize remote reference=] + with the |element id|, |realm|, and |session|. + +1. Let |fields| be the value of the fields field of |command + parameters|. + +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. If user agent cannot autofill |fields|, return an [=error=] with + [=error code=] [=unsupported operation=]. + +1. The user agent should [=autofill=] |element| and |element|'s [=form + owner=], while taking into account the contents of |fields|. + +1. Return [=success=] with data null. + +
+ +#### The autofill.FieldName Type #### {#type-autofill-FieldName} + +
+   autofill.FieldName = text;
+
+ +The autofill.FieldName is a token. Valid token values are defined in +[=autofill detail tokens=]. + # Patches to Other Specifications # {#patches} This specification requires some changes to external specifications to provide the necessary