Skip to content

Commit

Permalink
Feedback: ...traversible with user attention, indentation, newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
schwering committed May 25, 2023
1 parent 5551bf8 commit 632e059
Showing 1 changed file with 41 additions and 38 deletions.
79 changes: 41 additions & 38 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -44572,10 +44572,12 @@ interface <dfn interface>HTMLTableCellElement</dfn> : <span>HTMLElement</span> {
&lt;p>&lt;button>Submit order&lt;/button>&lt;/p>
&lt;/form></code></pre>


<p class="note">User agents are not limited to the form controls of a specific <code>form</code>
in their automatic filling. In particular, they might consider fields from different documents
as explained in the <span>eligible for autofill</span> section.</p>


<h5>Improving the user experience on mobile devices</h5>

<!-- NON-NORMATIVE SECTION -->
Expand Down Expand Up @@ -55580,70 +55582,70 @@ form.method === input; // => true</code></pre>
multiple controls at once.</p>

<div class="example">
<p>A user agent might offer the user to automatically fill their address in a form like the
following.</p>

<pre><code class="html">&lt;form method=post action="https://pizza.exampe.com/order.cgi">
&lt;label> Name: &lt;input>&lt;/textarea> &lt;/label>
&lt;label> Address: &lt;input>&lt;/textarea> &lt;/label>
&lt;label> City: &lt;input> &lt;/label>
&lt;label> Postal Code: &lt;input> &lt;/label>
&lt;label> Country: &lt;select>...&lt;/select> &lt;/label>
<p>A user agent might offer the user to automatically fill their address in a form like the
following.</p>

<pre><code class="html">&lt;form method=post action="https://pizza.exampe.com/order.cgi">
&lt;label> Name: &lt;input>&lt;/textarea> &lt;/label>
&lt;label> Address: &lt;input>&lt;/textarea> &lt;/label>
&lt;label> City: &lt;input> &lt;/label>
&lt;label> Postal Code: &lt;input> &lt;/label>
&lt;label> Country: &lt;select>...&lt;/select> &lt;/label>
&lt;/form></code></pre>

<p>For example, the user agent could suggest values to fill when the user focuses or types in
one of the controls.</p>
<p>For example, the user agent could suggest values to fill when the user focuses or types in
one of the controls.</p>
</div>

<p>The user agent may fill multiple controls at once even if they have different
<span data-x="form owner">form owners</span>, <span>root</span> elements, or even
<span data-x="node document">node documents</span>. However, the user agent should not fill in a
field if that field is not <span>eligible for autofill</span>.</p>
<span data-x="node document">node documents</span>. However, the user agent should only fill in
controls that are <span>eligible for autofill</span>.</p>

<h6>Eligibility for autofill</h6>

<p>A form control <var>control</var> is <dfn>eligible for autofill</dfn> if <var>control</var>'s
<span>node document</span> <var>document</var> is <span>fully active</span> and one of the
following is true:</p>
<span>node document</span> <var>document</var> is a <span>fully active descendant of a top-level
traversible with user attention</span> and one of the following is true:</p>

<ul>
<li><p>Some element is <span>focused</span> and its <span>node document</span>'s
<span data-x="concept-document-origin">origin</span> is the <span>same origin</span> as
<var>document</var>'s <span data-x="concept-document-origin">origin</span>.</p></li>
<li><p>Some element is <span>focused</span> and its <span>node document</span>'s
<span data-x="concept-document-origin">origin</span> is the <span>same origin</span> as
<var>document</var>'s <span data-x="concept-document-origin">origin</span>.</p></li>

<li><p>The <code data-x="shared-autofill-feature">shared-autofill</code> feature is enabled in
<var>document</var> for <var>document</var>'s
<span data-x="concept-document-origin">origin</span>.</p></li>
<li><p>The <code data-x="shared-autofill-feature">shared-autofill</code> feature is enabled in
<var>document</var> for <var>document</var>'s
<span data-x="concept-document-origin">origin</span>.</p></li>
</ul>

<div class="example">
<p>Consider the following page <code data-x="">https://pizza.example.com/</code>:</p>
<p>Consider the following page <code data-x="">https://pizza.example.com/</code>:</p>

<pre><code class="html">&lt;form method=post>
&lt;p> Cardholder name: &lt;input>
&lt;p> Credit card number: &lt;iframe src="https://pay.example.com/number.html" allow=shared-autofill>&lt;/iframe>
&lt;p> Expiration date: &lt;input>
&lt;p> CVC: &lt;iframe src="https://pay.example.com/cvc.html" allow=shared-autofill>&lt;/iframe>
<pre><code class="html">&lt;form method=post>
&lt;p> Cardholder name: &lt;input>
&lt;p> Credit card number: &lt;iframe src="https://pay.example.com/number.html" allow=shared-autofill>&lt;/iframe>
&lt;p> Expiration date: &lt;input>
&lt;p> CVC: &lt;iframe src="https://pay.example.com/cvc.html" allow=shared-autofill>&lt;/iframe>
&lt;/form>
&lt;iframe src="https://ads.example.com/ad.html">&lt;/iframe></code></pre>

<p>Let <code data-x="">number.html</code> and <code data-x="">cvc.html</code> each contain an
<code>input</code>:</p>
<p>Let <code data-x="">number.html</code> and <code data-x="">cvc.html</code> each contain an
<code>input</code>:</p>

<pre><code class="html">&lt;!doctype html>
<pre><code class="html">&lt;!doctype html>
&lt;html>
&lt;body>
&lt;input>
&lt;/html></code></pre>

<p>Suppose the user starts filling the cardholder name and the user agent offers to fill the
entire credit card form. The cardholder name and expiration date controls are eligible by means
of their origin, and the controls in <code data-x="">number.html</code> and
<code data-x="">cvc.html</code> are eligible due to the
<code data-x="shared-autofill-feature">shared-autofill</code> feature.
By contrast, none of the controls in <code data-x="">ad.html</code> is eligible because of the
distinct origins and the absent <code data-x="shared-autofill-feature">shared-autofill</code>
feature; this prevents leaking to the ad server.</p>
<p>Suppose the user starts filling the cardholder name and the user agent offers to fill the
entire credit card form. The cardholder name and expiration date controls are eligible by means
of their origin, and the controls in <code data-x="">number.html</code> and
<code data-x="">cvc.html</code> are eligible due to the
<code data-x="shared-autofill-feature">shared-autofill</code> feature.
By contrast, none of the controls in <code data-x="">ad.html</code> are eligible because of the
distinct origins and the absent <code data-x="shared-autofill-feature">shared-autofill</code>
feature; this prevents leaking information to the ad server.</p>
</div>


Expand Down Expand Up @@ -109008,6 +109010,7 @@ function showLogout() {
</div>



<h2 split-filename="workers" id="workers" dfn data-lt="web worker" export>Web workers</h2>

<h3>Introduction</h3>
Expand Down

0 comments on commit 632e059

Please sign in to comment.