aom
aom copied to clipboard
`Element` or `AccessibleNode` references for relationships?
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).
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.
What if virtual nodes inherited from Node
? Document
is already something of a "virtual node".