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

Consider adding more normative requirements for authors on the textbox role #1493

Closed
joanmarie opened this issue May 31, 2021 · 1 comment · Fixed by #1830
Closed

Consider adding more normative requirements for authors on the textbox role #1493

joanmarie opened this issue May 31, 2021 · 1 comment · Fixed by #1830
Assignees
Labels
clarification clarifying or correcting language that is either confusing, misleading or under-specified
Projects
Milestone

Comments

@joanmarie
Copy link
Contributor

joanmarie commented May 31, 2021

The ARIA spec says the following for the textbox role:

A type of input that allows free-form text as its value.

If the aria-multiline attribute is true, the widget accepts line breaks within the input, as in an HTML textarea. Otherwise, this is a simple text box. The intended use is for languages that do not have a text input element, or cases in which an element with different semantics is repurposed as a text field.

After that there is a (non-normative) note and the characteristics table. That's it. That suggests the following is, officially, a valid "simple text box":

<div role="textbox" aria-label="good luck!">
  <button>ok</button>
  <a href="#">link</a>
  <label>name: <input></label>
</div>

Some observations:

  1. I don't think that's a "simple text box"

  2. contenteditable isn't set but the default/implicit value of aria-readonly is false. According to the ARIA spec's State and Property Attribute Processing:

    When WAI-ARIA roles are used, supported states and properties that are not present in the DOM are treated according to their default value.

    So we have to trust that the author is using some non-contenteditable means to make that div editable.

  3. aria-readonly is false as described above. aria-disabled is also false for the same reason, but this textbox is also not focusable, which brings me to the next item:

  4. Should this really be exposed as a textbox to ATs?

I'm currently working on fixing a Chromium bug related to authoring like the above which breaks the screen-reader user experience because those focusable children get pruned from the accessibility tree unless contenteditable is set on the div with the textbox role. Why are they getting pruned? Simple text boxes don't have children. (Right??)

Fixing the not-in-the-accessibility-tree bug is not hard. But I think authors need to be stopped from doing the above. And depending on the normative statements we add for authors, we might want to consider handling-author-errors content so that user agents can provide a more consistent implementation and user experience given such authoring.

@JAWS-test
Copy link
Contributor

Since an HTML textbox cannot have child elements, I would have expected role=textbox to have "Children Presentational: True".
If a match is to be created between HTML input/textarea and role=textbox, I think it would make sense to add "Children Presentational: True". (But then contenteditable would be something other than a textbox, for which we might need a new ARIA role. )

Your example would then be nothing more than <input type=text tabindex=-1 value="ok link name:"> with an event handler that prevents text input. This would be quite wrong, but I think it should still be submitted to the Accessibility API as an input field. I'm not a fan of too many repair mechanisms in the browser, but rather for clearly explaining in the ARIA spec how an element may be used.

@jnurthen jnurthen added this to the ARIA 1.3 milestone Jun 3, 2021
@spectranaut spectranaut added this to Joanie in ARIA 1.3 Jun 7, 2022
@joanmarie joanmarie removed their assignment Aug 15, 2022
@chlane chlane self-assigned this Sep 2, 2022
chlane added a commit to chlane/aria that referenced this issue Sep 2, 2022
Adding verbiage to allow only presentational elements in textboxes w3c#1493
@spectranaut spectranaut added the clarification clarifying or correcting language that is either confusing, misleading or under-specified label Sep 12, 2022
@spectranaut spectranaut moved this from Unassigned to Chris Lane in ARIA 1.3 Sep 12, 2022
chlane added a commit to chlane/aria that referenced this issue Oct 7, 2022
Fix for aria w3c#1493. Removed parenthetical examples of old web development techniques and replaced them with current examples.
chlane added a commit to chlane/aria that referenced this issue Oct 7, 2022
Fix for w3c#1493. Updated examples to be more current.
chlane added a commit to chlane/aria that referenced this issue Oct 10, 2022
Removing changes unrelated to w3c#1493 for w3c#1827
chlane added a commit to chlane/aria that referenced this issue Oct 10, 2022
Providing more current examples of presentational elements in textboxes for w3c#1493
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification clarifying or correcting language that is either confusing, misleading or under-specified
Projects
ARIA 1.3
Chris Lane
5 participants