aom icon indicating copy to clipboard operation
aom copied to clipboard

`Element` or `AccessibleNode` references for relationships?

Open alice opened this issue 7 years ago • 2 comments

For example, for el.accessibleNode.activeDescendant, what should we be setting this value to?

// Element
el.accessibleNode.activeDescendant = el.querySelector(".active");

// or

// AccessibleNode
el.accessibleNode.activeDescendant = el.querySelector(".active").accessibleNode;

Element

  • Closer relationship to ARIA which refers to an element in the page via IDREF.

AccessibleNode

  • May work better when we have virtual nodes, if virtual nodes inherit from AccessibleNode.
  • However, seems weird to pass a configuration object instead of an actual node (DOM or otherwise).

alice avatar Mar 31 '17 02:03 alice

My preference is AccessibleNode. It just makes more sense once we have virtual nodes.

If virtual nodes don't inherit from AccessibleNode, then they should both inherit from a common interface, and that's the type we should use.

Allowing elements in addition to AccessibleNodes would be okay as some sort of shorthand. That might just make the API simpler.

But allowing virtual AccessibleNodes or real Elements, but not AccessibleNodes from Elements, that sounds the most inconsistent to me.

minorninth avatar Mar 31 '17 03:03 minorninth

What if virtual nodes inherited from Node? Document is already something of a "virtual node".

alice avatar Mar 31 '17 03:03 alice