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 title in 2D to alt #10

Open
jnurthen opened this issue Apr 5, 2018 · 8 comments
Open

Change title in 2D to alt #10

jnurthen opened this issue Apr 5, 2018 · 8 comments
Milestone

Comments

@jnurthen
Copy link
Member

jnurthen commented Apr 5, 2018

2D States

Otherwise, if the current node's native markup provides an attribute (e.g. title) or element (e.g. HTML label) that defines a text alternative, return that alternative in the form of a flat string as defined by the host language, unless the element is marked as presentational (role="presentation" or role="none").

Comment:
For example, in HTML, the img element's alt attribute defines a text alternative string, and the label element provides text for the referenced form element. In SVG2, the desc and title elements provide a description of their parent element.

The first line's use of title is confusing as title normally falls into 2I (tooltip attribute). I suggest changing title in the first line to alt as alt is the very definition of a native alternative.

@devarshipant
Copy link

The phrase "...provides an attribute (e.g. title)" could be unclear to some readers.
Does a placeholder attribute value qualify to be the flat string (accessible name) when no other element (like, label) is present? What happens when both placeholder and title are present?

  1. For example, what would be the accessible name in the example below with only placeholder?
<input type="text" placeholder="User Name">
<input type="password" placeholder="Password">
  1. With title + placeholder?
<input type="text" placeholder="User Name" title="Email is username">

@jnurthen jnurthen added this to the 1.2 milestone May 29, 2018
@accdc
Copy link
Contributor

accdc commented May 30, 2018

At present in 1.1, the fields with only placeholder would have no accessible name because placeholder isn't listed as a valid labeling mechanism, but those with a title attribute would have the accessible name set to the title attribute because no prior mechanism is available.

For 1.2, it seems logical to me that placeholder would be treated like a title and be set as a name as a last resort, but only after title, and if both are present like above, then title would be set to the name and placeholder set to the description.

@jnurthen
Copy link
Member Author

This could be related to #11 HTML-AAM should define what happens in these examples per https://w3c.github.io/html-aam/#input-type-text-input-type-password-input-type-search-input-type-tel-input-type-url-and-textarea-element

@accdc
Copy link
Contributor

accdc commented May 30, 2018

We will also need to map the same thing to aria-placeholder.

@mraccess77
Copy link

In the HTML AAM title is listed as the last naming mechanism for input type text and anchor. For anchor it comes after the sub-tree. The approach from the AAM seems correct -- so how can that be worked into the name calculation algorithm? It seems like title should only be used when no other mechanism is available. I personally don't think placeholder should be used at all for the accessible name calculation but would be fine with it for description.

@mcking65
Copy link

Why hoist placeholder into the description? Do AT have no way to access placeholder if they choose to render it? It seems to me that hearing a placeholder as a description just as often be confusing as helpful.

@mraccess77
Copy link

Fine be me if we want to separate out placeholder into something else. It just seems like there is a limited set of properties that map to platform accessibility APIs.

@stevefaulkner
Copy link

Note: the HTML-AAM no longer defines the use of placeholder as a fallback description refer to the change log.

21-Nov-2016: Removed placeholder attribute from accessible description computation for various input elements.

This was changed some while ago after discussion and the introduction of aria-placeholder. The original definition was due to there being no unique defined mapping for placeholder, which as of aria 1.1 is no longer the case.

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

No branches or pull requests

6 participants