Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change auto directionality of hidden, password, and button controls #9689

Merged
merged 4 commits into from
Oct 24, 2023
Merged
Changes from 2 commits
Commits
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
56 changes: 33 additions & 23 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -13582,6 +13582,8 @@ Transport Protocol">HTTP&lt;/abbr> today.&lt;/p></code></pre> <!-- DO NOT REWRAP
data-x="attr-input-type">type</code> attribute is in the <span
data-x="attr-input-type-tel">Telephone</span> state, then return '<span
data-x="concept-ltr">ltr</span>'.</p></li>
<!-- This looks odd, but is very much deliberate:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=17835 -->

<li><p>Return the <span>parent directionality</span> of <var>element</var>.</p></li>
</ol>
Expand All @@ -13592,16 +13594,27 @@ Transport Protocol">HTTP&lt;/abbr> today.&lt;/p></code></pre> <!-- DO NOT REWRAP
<span>HTML elements</span>, it cannot be present on elements from other namespaces. Thus, elements
from other namespaces always end up using the <span>parent directionality</span>.</p>

<p>The <dfn>auto-directionality form-associated elements</dfn> are:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked into making this a proper subcategory of form-associated elements, but it's extremely awkward due to the type attribute constraints which categories mostly don't have. It's also very boilerplate heavy. Not sure if this even makes sense for form-associated custom elements, but I'd suggest we wait with an actual subcategory until then.


<ul>
<li><p><code>input</code> elements whose <code data-x="attr-input-type">type</code> attribute is
in the <span data-x="attr-input-type-text">Text</span>, <span
data-x="attr-input-type-search">Search</span>, <span
data-x="attr-input-type-tel">Telephone</span>, <span data-x="attr-input-type-url">URL</span>,
<span data-x="attr-input-type-email">Email</span>, <span
data-x="attr-input-type-password">Password</span>, <span data-x="attr-input-type-submit">Submit
Button</span>, <span data-x="attr-input-type-reset">Reset Button</span>, or <span
data-x="attr-input-type-button">Button</span> state, and</p></li>

<li><p><code>textarea</code> elements.</p></li>
</ul>

<p>To compute the <dfn>auto directionality</dfn> given an element <var>element</var>:</p>

<ol>
<li>
<p>If <var>element</var> is an <code>input</code> element whose <code
data-x="attr-input-type">type</code> attribute is in the <span
data-x="attr-input-type-text">Text</span>, <span data-x="attr-input-type-search">Search</span>,
<span data-x="attr-input-type-tel">Telephone</span>, <span
data-x="attr-input-type-url">URL</span>, or <span data-x="attr-input-type-email">Email</span>
state, or <var>element</var> is a <code>textarea</code> element, then:</p>
<p>If <var>element</var> is an <span data-x="auto-directionality form-associated
elements">auto-directionality form-associated element</span>:

<ol>
<li><p>If <var>element</var>'s <span data-x="concept-fe-value">value</span> contains a
Expand Down Expand Up @@ -46557,7 +46570,7 @@ interface <dfn interface>HTMLInputElement</dfn> : <span>HTMLElement</span> {
<!-- <td class="yes"> Yes Search -->
<td class="yes"> Yes <!-- Telephone, URL -->
<td class="yes"> Yes <!-- Email -->
<td class="no"> &middot; <!-- Password -->
<td class="yes"> Yes <!-- Password -->
<td class="no"> &middot; <!-- Date -->
<!-- <td class="no"> &middot; Month -->
<!-- <td class="no"> &middot; Week -->
Expand All @@ -46569,10 +46582,10 @@ interface <dfn interface>HTMLInputElement</dfn> : <span>HTMLElement</span> {
<td class="no"> &middot; <!-- Checkbox -->
<!-- <td class="no"> &middot; Radio Button -->
<td class="no"> &middot; <!-- File Upload -->
<td class="no"> &middot; <!-- Submit Button -->
<td class="yes"> Yes <!-- Submit Button -->
<td class="no"> &middot; <!-- Image Button -->
<td class="no"> &middot; <!-- Reset Button -->
<!-- <td class="no"> &middot; Button -->
<td class="yes"> Yes <!-- Reset Button -->
<!-- <td class="yes"> Yes Button -->

<tr>
<th> <code data-x="attr-fs-formaction">formaction</code>
Expand Down Expand Up @@ -48562,6 +48575,7 @@ ldh-str = &lt; as defined in <a href="https://www.rfc-editor.org/rfc/rfc10
<p>The following common <code>input</code> element content
attributes, IDL attributes, and methods <span data-x="concept-input-apply">apply</span> to the element:
<code data-x="attr-fe-autocomplete">autocomplete</code>,
<code data-x="attr-fe-dirname">dirname</code>,
<code data-x="attr-input-maxlength">maxlength</code>,
<code data-x="attr-input-minlength">minlength</code>,
<code data-x="attr-input-pattern">pattern</code>,
Expand All @@ -48588,7 +48602,6 @@ ldh-str = &lt; as defined in <a href="https://www.rfc-editor.org/rfc/rfc10
<code data-x="attr-input-accept">accept</code>,
<code data-x="attr-input-alt">alt</code>,
<code data-x="attr-input-checked">checked</code>,
<code data-x="attr-fe-dirname">dirname</code>,
<code data-x="attr-fs-formaction">formaction</code>,
<code data-x="attr-fs-formenctype">formenctype</code>,
<code data-x="attr-fs-formmethod">formmethod</code>,
Expand Down Expand Up @@ -50555,6 +50568,7 @@ ldh-str = &lt; as defined in <a href="https://www.rfc-editor.org/rfc/rfc10

<p>The following common <code>input</code> element content attributes and IDL attributes <span
data-x="concept-input-apply">apply</span> to the element:
<code data-x="attr-fe-dirname">dirname</code>,
<code data-x="attr-fs-formaction">formaction</code>,
<code data-x="attr-fs-formenctype">formenctype</code>,
<code data-x="attr-fs-formmethod">formmethod</code>,
Expand All @@ -50573,7 +50587,6 @@ ldh-str = &lt; as defined in <a href="https://www.rfc-editor.org/rfc/rfc10
<code data-x="attr-input-alt">alt</code>,
<code data-x="attr-fe-autocomplete">autocomplete</code>,
<code data-x="attr-input-checked">checked</code>,
<code data-x="attr-fe-dirname">dirname</code>,
<code data-x="attr-dim-height">height</code>,
<code data-x="attr-input-list">list</code>,
<code data-x="attr-input-max">max</code>,
Expand Down Expand Up @@ -50953,7 +50966,8 @@ ldh-str = &lt; as defined in <a href="https://www.rfc-editor.org/rfc/rfc10

<p>The following common <code>input</code> element content attributes <span
data-x="concept-input-apply">apply</span> to the element:
<code data-x="attr-popovertarget">popovertarget</code> and
<code data-x="attr-fe-dirname">dirname</code>,
<code data-x="attr-popovertarget">popovertarget</code>, and
<code data-x="attr-popovertargetaction">popovertargetaction</code>.</p>

<p>The following content attributes must not be specified and <span>do not apply</span> to the
Expand All @@ -50962,7 +50976,6 @@ ldh-str = &lt; as defined in <a href="https://www.rfc-editor.org/rfc/rfc10
<code data-x="attr-input-alt">alt</code>,
<code data-x="attr-fe-autocomplete">autocomplete</code>,
<code data-x="attr-input-checked">checked</code>,
<code data-x="attr-fe-dirname">dirname</code>,
<code data-x="attr-fs-formaction">formaction</code>,
<code data-x="attr-fs-formenctype">formenctype</code>,
<code data-x="attr-fs-formmethod">formmethod</code>,
Expand Down Expand Up @@ -51038,7 +51051,8 @@ ldh-str = &lt; as defined in <a href="https://www.rfc-editor.org/rfc/rfc10

<p>The following common <code>input</code> element content attributes <span
data-x="concept-input-apply">apply</span> to the element:
<code data-x="attr-popovertarget">popovertarget</code> and
<code data-x="attr-fe-dirname">dirname</code>,
<code data-x="attr-popovertarget">popovertarget</code>, and
<code data-x="attr-popovertargetaction">popovertargetaction</code>.</p>

<p>The following content attributes must not be specified and <span>do not apply</span> to the
Expand All @@ -51047,7 +51061,6 @@ ldh-str = &lt; as defined in <a href="https://www.rfc-editor.org/rfc/rfc10
<code data-x="attr-input-alt">alt</code>,
<code data-x="attr-fe-autocomplete">autocomplete</code>,
<code data-x="attr-input-checked">checked</code>,
<code data-x="attr-fe-dirname">dirname</code>,
<code data-x="attr-fs-formaction">formaction</code>,
<code data-x="attr-fs-formenctype">formenctype</code>,
<code data-x="attr-fs-formmethod">formmethod</code>,
Expand Down Expand Up @@ -59669,13 +59682,9 @@ fur

<li>
<p>If the element has a <code data-x="attr-fe-dirname">dirname</code> attribute, that
attribute's value is not the empty string, and the element is either a <code>textarea</code>
element or an <code>input</code> element whose <code data-x="attr-input-type">type</code>
attribute is in the <span data-x="attr-input-type-hidden">Hidden</span>,
<span data-x="attr-input-type-text">Text</span>, <span
data-x="attr-input-type-search">Search</span>, <span
data-x="attr-input-type-tel">Telephone</span>, <span data-x="attr-input-type-url">URL</span>,
or <span data-x="attr-input-type-email">Email</span> state, then:</p>
attribute's value is not the empty string, and the element is an <span
data-x="auto-directionality form-associated elements">auto-directionality form-associated
Copy link
Contributor

@fantasai fantasai Oct 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might consider calling this a "rendered-value input element" or something, since the distinction here is that we're rendering the contents of the value as visible content of the rendered element.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you consider Hidden inputs rendered? Maybe mostly-text-value? :-)

element</span>:
annevk marked this conversation as resolved.
Show resolved Hide resolved

<ol>
<li><p>Let <var>dirname</var> be the value of the element's <code
Expand Down Expand Up @@ -139937,6 +139946,7 @@ INSERT INTERFACES HERE
Jon Perlow,
Jonas Sicking,
Jonathan Cook,
Jonathan Kew,
Jonathan Neal,
Jonathan Oddy,
Jonathan Rees,
Expand Down