ChangeProposals/CorrectHidden/

From HTML WG Wiki
Jump to: navigation, search

Accessibility API Mappings

When aria-labelledby and aria-describedby reference an element that IS NOT hidden, the following things happen:

  1. An Accessible Object is created in the Accessibiltiy API tree for both the referencing and the referenced elements.
  2. In APIs that support such relationships, a relationship is created with bi-directional pointers between the objects. This can be used by AT products to find the referenced element and navigate to it.
  3. A DOM relationship is created between the referencing and referenced elements. DOM-based AT products, or browsers themselves, can use this to build UI that allows users to navigate to the description.
  4. The text of the referenced element is used in Name Calculation
  5. the AriaProperties or ObjectAttributes are populated with the string aria-describedby=IDREF or aria-labelledby=IDREF, where IDREF is the ID of the referenced element.

When aria-labelledby and aria-describedby reference an element that IS hidden, the following things happen:

  1. The text of the referenced element is used in Name Calculation
  2. the AriaProperties or ObjectAttributes are populated with the string aria-describedby=IDREF or aria-labelledby=IDREF, where IDREF is the ID of the referenced element.

Results Are: Plain String Text

Name calculation is what is at issue in this CP. It happens whether the referenced items are hidden or not. When the referenced items are hidden, then the relationships for navigation are not created. Again, this is already true for CSS display:none and visibility:hidden, and has been true in browser implementation for years.

The structure of the referenced element is flattened in name calculation because properties where it is placed are plain text strings. In MSAA, for example, each accessible object is a COM object with properties of type string for the name and description. For more information, see the MSDN documentation for IAccessible, the AccDescription property, and the AccName property.

Plain String Text By Design

These results are by design so that keyboard-only users do not lose their visible focus as they tab through hidden content.