Open alice opened 7 years ago
Total strawman proposal just to get some gut reactions to these choices:
AccessibleNode
- maybe ComputedAccessibleNode
(naming things is hard 😞)let computedAXNode = await document.activeElement.accessibleNode.requestComputedNode();
// no need for label/labelledby etc, just get the computed name and description
console.log(computedAXNode.name, computedAXNode.description);
// finally we can get the computed role!
console.log(computedAXNode.roleName);
// do we want a type taxonomy like DOM objects?
if (computedAXNode instanceof AccessibilitySlider) {
console.log(computedAXNode.minValue);
// do some tree walking
let parent = computedAXNode.parent;
while (parent.parent)
parent = parent.parent;
let rootAXNode = parent;
// get all the more obscure relations -
// maybe this is a list of strings, maybe this is a dictionary?
var relations = computedAXNode.accessibleRelations;
https://github.com/WICG/aom/issues/6 talks about use cases
// no need for label/labelledby etc, just get the computed name and description console.log(computedAXNode.name, computedAXNode.description);
+1
// do we want a type taxonomy like DOM objects? if (computedAXNode instanceof AccessibilitySlider) { console.log(computedAXNode.minValue);
I vote no. If minValue doesn't apply to that role it should return undefined.
// do some tree walking let parent = computedAXNode.parent;
How about: let parent = await computedAXNode.requestParent()?
That way the implementation can be super lazy. For performance reasons we can try to return synchronously whenever possible, but we won't guarantee we will.
If we don't do that, what happens if you modify the accessibility tree and try to access the computed node's relationships synchronously - does it answer based on the previous snapshot, or does it block?
Example WebDriver APIs which aren't available on the open web: https://www.w3.org/TR/webdriver/#pointer-actions https://www.w3.org/TR/webdriver/#dismiss-alert https://www.w3.org/TR/webdriver/#take-screenshot
Would ComputedAccessibleNode
be live?
Some top of my head thoughts/questions: