Skip to content

Commit

Permalink
Add autofill endpoints and processing model
Browse files Browse the repository at this point in the history
  • Loading branch information
yoavweiss committed Feb 23, 2024
1 parent a04dbf7 commit ece5132
Showing 1 changed file with 102 additions and 0 deletions.
102 changes: 102 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,18 @@ <h3>Endpoints</h3>
<td>/session/{<var>session id</var>}/print</td>
<td><a>Print Page</a></td>
</tr>

<tr>
<td>POST</td>
<td>/session/{<var>session id</var>}/autofill/save</td>
<td><a>Save autofill values</a></td>
</tr>

<tr>
<td>POST</td>
<td>/session/{<var>session id</var>}/autofill/trigger</td>
<td><a>Trigger autofill</a></td>
</tr>
</table>
</section> <!-- /Endpoints -->

Expand Down Expand Up @@ -10782,6 +10794,96 @@ <h3><dfn>Print Page</dfn></h3>
</section> <!-- /Print Page -->
</section> <!-- /Print -->

<section>
<h2>Autofill</h2>

<p>This chapter describes testing methods for the browser's autofill
functionality to enable web developers to automatically test their HTML
content for expected autofill behavior, against multiple browser
implementations.</p>

<p>These methods would allow saving of test autofill data and then
triggering the autofill functionality on particular form field.</p>

<dfn>Autofill configuration</dfn> is a record containing a "fields" property,
an <a>ordered map</a> whose [=map/keys=] are <a
data-cite="HTML#autofill-field-name">autofill field names</a>
and <a>values</a> are the field values.

A <a>browsing context</a> has a <dfn>autofill store for testing</dfn>, an
<a>ordered map</a>.

<section>
<h3><dfn>Save autofill values</dfn></h3>

<table class="simple jsoncommand">
<tr>
<th>HTTP Method
<th>URI Template
</tr>
<tr>
<td>POST
<td>/session/{<var>session id</var>}/autofill/save
</tr>
</table>

<p>The <a>remote end steps</a> are:

<ol>
<li><p>If the <a>current top-level browsing context</a> is <a>no longer open</a>,
return <a>error</a> with <a>error code</a> <a>no such window</a>.
<li><p>Let <var>store</var> be the <a>current top-level browsing context</a>'s
<a>autofill store for testing</a>.
<li><p>Let <var>configuration</var> be the result of <a>trying</a> to
<a>JSON deserialize</a> the request’s <var>body</var> as an <a>autofill configuration</a>.
<li><p>Let <var>fields</var> be the "fields" property of <var>configuration</var>.
<li><p>[=map/For each=] <var>key</var>=><var>value</var> of <var>fields</var>, <a>set</a>
<var>store</var>[<var>key</var>] to <var>value</var>.

<aside class=example>
<p>To save autofill data in <a>current top-level browsing context</a>
of the <a>session</a> with ID <i>1</i> to a <code>name</code> of "Jane Doe" and a
<code>country</code> of "US", the <a>local end</a> would POST to
<i>/session/1/autofill/save/</i> with the body:

<pre><code>
{
"fields": {
"name": "Jane Doe",
"country": "US"
}
}
</code></pre>
</aside>
</section> <!-- /Save autofill values -->

<h3><dfn>Trigger autofill</dfn></h3>
<table class="simple jsoncommand">
<tr>
<th>HTTP Method
<th>URI Template
</tr>
<tr>
<td>POST
<td>/session/{<var>session id</var>}/autofill/trigger
</tr>
</table>

<p>The <a>remote end steps</a> are:

<ol>
<li><p>If the <a>current top-level browsing context</a> is <a>no longer open</a>,
return <a>error</a> with <a>error code</a> <a>no such window</a>.
<li><p>Let <var>element</var> be the result of <a>trying</a> to
<a>deserialize a web element</a> given request body.
<li><p>The <a>user agent</a> should <a data-cite="HTML#concept-fe-autofill">autofill</a>
<var>element<var> and <var>element</var>'s <a data-cite="HTML#form-owner">form owner</a>,
while taking into account the contents of the <a>current top-level browsing context</a>'s
<a>autofill store for testing</a>.

</section> <!-- /Trigger autofill -->

</section> <!-- /Autofill -->

<section class=appendix>
<h2>Privacy</h2>
Expand Down

0 comments on commit ece5132

Please sign in to comment.