aom icon indicating copy to clipboard operation
aom copied to clipboard

`AccessibleNode` naming

Open alice opened this issue 8 years ago • 4 comments

Official brainstorm thread.


We have chosen the name AccessibleNode for the class representing one node in the accessibility tree as exposed by the Accessibility Object Model, and accessibleNode as the accessor for the accessible node from a DOM element.

In choosing this name, we have tried to pick a balance between brevity, clarity, and generality.

  • Brevity: The name should be as short as possible.
  • Clarity: The name should reflect the function of the API, without using opaque abbreviations or contractions - the purpose of the property on Element should be possible to guess if a developer encounters it while debugging.
  • Generality: The name should not be too narrow and limit the scope of the spec.

Below we've collected all of the serious names that have been proposed and a concise summary of the pros and cons of each.

Suggestions for alternate names or votes for one of the other names below are still welcome, but please try to carefully consider the existing suggestions and their cons first. Rough consensus has already been achieved and we'd rather work on shipping something we can all live with rather than trying to get the perfect name.

Proposed name Pros Cons
Aria Short; already associated with accessibility Confusing because ARIA is the name of a spec, not the name of one node in an accessibility tree.
AriaNode Short; already associated with accessibility Implies the AOM will only expose ARIA attributes, which is too limiting
A11ement Short; close to Element Hard to pronounce; contains numbers; not necessarily associated with an element; hard to understand meaning
A11y Very short; doesn't make assertions about DOM association Hard to pronounce; contains numbers; hard to understand meaning
Accessible One full word; not too hard to type Not a noun
AccessibleNode Very explicit; not too hard to read Long; possibly confusing (are other Nodes not accessible?)
AccessibleElement Very explicit Even longer; confusing (are other Elements not accessible?)
AccessibilityNode Very explicit Extremely long; nobody on the planet can type 'accessibility' correctly first try
AccessibilityElement Very explicit Ludicrously long; still requires typing 'accessibility'

alice avatar Mar 20 '17 23:03 alice

I personally think AccessibleNode is the best choice, as anything shorter is likely to have "a11y" or "ally" in it (which are even less clear).

Here are a few other random ideas, though, since there's a push to make it shorter.

  • AxsNode
  • AccessNode
  • ATNode
  • AXNode

marcysutton avatar Mar 20 '17 23:03 marcysutton

To go short, but in a different direction; I would suggest assist. Which can be both a noun and a verb, aligning more with the "Assistive" part of accessibility. And thus wouldn't require the 'Node' suffix. It's also slightly more broad than Accessible for the function of the API.

e.g. For the sake of brevity, this reads well to me.

customSlider.assist.addEventListener();

hexalys avatar Mar 21 '17 05:03 hexalys

We should keep the longer name for clarity. No modern DOM APIs use an abbreviated name. Even long names like document.getElementsBySelector() are usually just aliased in frameworks, e.g. $()

cookiecrook avatar Mar 21 '17 18:03 cookiecrook

As I said on Twitter a while back, I like AccessibleNode, does what it says on the tin.

el.AccessibleNode. modal = true; is still shorter than el.setAttribute('aria-modal', true);.

ZoeBijl avatar Apr 04 '17 08:04 ZoeBijl