Skip to content

update / expand input value mappings - #396

Closed
scottaohara wants to merge 3 commits into
gh-pagesfrom
issue_314
Closed

scottaohara wants to merge 3 commits into
gh-pagesfrom
issue_314

Conversation

@scottaohara

@scottaohara scottaohara commented Apr 15, 2022 •

Copy link
Copy Markdown
Member

This PR closes #314 and clarifies the value attribute mappings for other input types.
note: the value attribute only represents the initial value for the input elements that expose the attribute's value. If a user updates a form control the value attribute's value does not mutate to reflect the updated entry. The updates I provided for these inputs attempts to specifically call this out. if this is not clear, please suggest alternate wording.

Note that the input type=color value is far more complex than the other inputs and I would appreciate specific feedback on what would need to be updated here, if anything.

Additionally, the input type=color seems to make a strong case for allowing aria-valuetext on a button element – where the button should be named via a label or an aria-label/labelledby, but still needs to expose it's displayed value (subtree of the button element).

NOTE: due to the still broken table/details/summary script with respec, to view the updated table in the preview, you can add this style via devtools:

#html-attribute-state-and-property-mappings .table-container {
  display: block !important;
}

or find the .table-container that has the display: none on it, and turn that off.

fun...


Preview | Diff

This PR closes #314 and clarifies the `value` attribute mappings for other input types.
note: the `value` attribute only represents *the initial value* for the input elements that expose the attribute's value.  If a user updates a form control the `value` attribute's value does not mutate to reflect the updated entry.  The updates I provided for these inputs attempts to specifically call this out.  if this is not clear, please suggest alternate wording.

Note that the `input type=color` `value` is far more complex than the other inputs and I would appreciate specific feedback on what would need to be updated here, if anything.

Additionally, the `input type=color` seems to make a strong case for allowing `aria-valuetext` on a `button` element – where the button should be named via a `label` or an `aria-label/labelledby`, but still needs to expose it's displayed value (subtree of the button element).

@spectranaut spectranaut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Still trying to catch up and get all the context for this change, i have a few questions to start!

Comment thread index.html Resolved
Comment thread index.html Resolved
Comment thread index.html
<td class="atk">See comments</td>
<td class="ax">See comments</td>
<td class="comments">
If specified, expose the value of the attribute as the initial value entry of the `input` element.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Specifically, what is the "value entry of the input element"?

Do we have the following specified somewhere: if, in one of these inputs, a user has entered text, how that text surfaced in the different accessibility APIs? If so we should link to it if not we should add it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As we discussed, let's use the same language here as in the HTML spec: https://html.spec.whatwg.org/multipage/input.html#attr-input-value

which I think would be (but check my work):

If specified, expose the content value attribute as the default value entry of the `input` element.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we not say what these mappings are though? Do we know how the accessibility API for the different platforms surface the value of a input [type="email"] etc? Like AXValue for Mac?

Comment thread index.html
<td class="ax">Use WAI-ARIA mapping</td>
<td class="comments">
<p>
If specified, expose the value of the attribute as the initial value of the `input`. User Agents MUST expose the modified value of the input to the <a class="termref">accessibility tree</a>. User Agents MAY expose the initial or modified value as a human readable text alternative. E.g., `#ff0000` as a localized text alternative of "Red".

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do these user agents MUSTs apply to the other inputs as well?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

After discussing, I think we agreed that "If specified, expose the value of the attribute as the initial value of the input. User Agents MUST expose the modified value of the input to the accessibility tree." belongs in it's own section about all inputs that have attributes (like value or checked) who's default value is set by the content attribute. See the spec: https://html.spec.whatwg.org/multipage/input.html#attr-input-value

This can happen here or in a follow up.

@spectranaut spectranaut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

From our conversation!

Comment thread index.html
<td class="atk">See comments</td>
<td class="ax">See comments</td>
<td class="comments">
If specified, expose the value of the attribute as the initial value entry of the `input` element.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As we discussed, let's use the same language here as in the HTML spec: https://html.spec.whatwg.org/multipage/input.html#attr-input-value

which I think would be (but check my work):

If specified, expose the content value attribute as the default value entry of the `input` element.

Comment thread index.html
<td class="ax">Use WAI-ARIA mapping</td>
<td class="comments">
<p>
If specified, expose the value of the attribute as the initial value of the `input`. User Agents MUST expose the modified value of the input to the <a class="termref">accessibility tree</a>. User Agents MAY expose the initial or modified value as a human readable text alternative. E.g., `#ff0000` as a localized text alternative of "Red".

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

After discussing, I think we agreed that "If specified, expose the value of the attribute as the initial value of the input. User Agents MUST expose the modified value of the input to the accessibility tree." belongs in it's own section about all inputs that have attributes (like value or checked) who's default value is set by the content attribute. See the spec: https://html.spec.whatwg.org/multipage/input.html#attr-input-value

This can happen here or in a follow up.

Comment thread index.html
<td class="atk">See comments</td>
<td class="ax">See comments</td>
<td class="comments">
If specified, expose the value of the attribute as the initial value entry of the `input` element.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we not say what these mappings are though? Do we know how the accessibility API for the different platforms surface the value of a input [type="email"] etc? Like AXValue for Mac?

Comment thread index.html
Comment on lines +5365 to +5366
Either contributes to the <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a>, the
<a data-cite="accname-1.2/#dfn-accessible-description">accessible description</a>, or is not mapped (see comments).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Editorial: I think this is phrased ambiguously:

Intention: "either it's:

  • mapped (to name or description) or
  • not mapped."

As phrased with the 3-part serial comma: "either it's mapped to:

  • name,
  • description, or
  • not mapped" (seems like ~"mapped to not mapped")

@cookiecrook cookiecrook Apr 27, 2022 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Substantive: I think there are scenarios where implementations may still wish to map it even if it's not used by name or description. Leaving that follow-on mapping optional before the final "is not mapped."

For example, I think once aria-description is implemented, browsers would still want to expose the title here as AXHelp in AX API.

<button aria-label="foo" aria-description="bar" title="bop">bif</button>

@pkra pkra mentioned this pull request May 28, 2024
21 tasks done
@rahimabdi

Copy link
Copy Markdown
Contributor

@scottaohara I tried to migrate this one but it is indeed complex; it looks like there are several changes that have already been made in spec (e.g., specifying reset, button for type) so parts of this PR may no longer be needed. The spec formatting has also changed since 2022 so I was unsure if you wanted to keep what we currently have in spec (e.g., input type=reset, type=submit as separate items) vs. this original PR where all of these would be contained in a single table.

If it's OK, I'll leave this one to you to determine what actually needs to be migrated to the mono repo.

scottaohara added a commit to w3c/aria that referenced this pull request Nov 8, 2024
this covers some editorial fixes that were originally part of w3c/html-aam#396 - but don't need to be.
scottaohara added a commit to w3c/aria that referenced this pull request Nov 8, 2024
@scottaohara

Copy link
Copy Markdown
Member Author

migrated to w3c/aria#2373. closing this pr

@scottaohara scottaohara closed this Nov 8, 2024
daniel-montalvo pushed a commit to w3c/aria that referenced this pull request Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

value should map to aria-valuenow for input[type=range]

4 participants