accname icon indicating copy to clipboard operation
accname copied to clipboard

Change title in 2D to alt

Open jnurthen opened this issue 7 years ago • 8 comments

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.

jnurthen avatar Apr 05 '18 20:04 jnurthen

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">

devarshipant avatar Apr 25 '18 01:04 devarshipant

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.

accdc avatar May 30 '18 18:05 accdc

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

jnurthen avatar May 30 '18 18:05 jnurthen

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

accdc avatar May 30 '18 19:05 accdc

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.

mraccess77 avatar May 30 '18 19:05 mraccess77

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.

mcking65 avatar May 31 '18 13:05 mcking65

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.

mraccess77 avatar May 31 '18 13:05 mraccess77

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.

stevefaulkner avatar May 31 '18 14:05 stevefaulkner