Skip to content

Conversation

@jcsteh
Copy link
Contributor

@jcsteh jcsteh commented Oct 31, 2025

Closes web-platform-tests/interop-accessibility#211

  1. Implement get_element_accessible_properties and get_accessible_properties in wptrunner and TestDriver. For wptrunner, this is currently only supported in executormarionette (Gecko), as there is no implementation yet in any other browser to support.
  2. Add AriaUtils.verifyPropertiesBySelector to test multiple properties using a JSON data-expected attribute on the test elements.
  3. Add AriaUtils.verifyAccessibilitySubtree for simpler tree verification using a simple JS object.
  4. Add simple WPT tests exercising and demonstrating these new methods.

…nd role.

1. Implement get_element_accessible_node and get_accessible_node in wptrunner and TestDriver.
    For wptrunner, this is currently only supported in executormarionette (Gecko), as there is no implementation yet in any other browser to support.
2. Add AriaUtils.verifyAccessibilityTree for simpler tree verification using a simple JS object.
3. Add simple WPT tests exercising and demonstrating these new methods.
@jcsteh
Copy link
Contributor Author

jcsteh commented Oct 31, 2025

There are a number of blocking details to sort out here, but I figured it was worth posting this to get things moving and get some initial feedback.

  1. There is ongoing, unresolved discussion in Tentative testdriver methods rfcs#226 as to whether these TestDriver methods need to be prefixed with tentative_. In short, RFC 127 just says "an existing WebDriver endpoint", which isn't explicit about a formal spec or where it needs to be specified. If an explainer is sufficient, we have Explainer: WebDriver Extension for Accessible Nodes, etc. (potential solution for #197) WICG/aom#203.
  2. In https://github.com/web-platform-tests/rfcs/pull/226/files#r2411669032, @cookiecrook questioned whether we should be removing accessible children/parent ids from this first pass in order to unblock it sooner. I feel this is a fundamental detail we need to sort out because it is a primary goal of the work here. However, pragmatism is important, so I'm happy to go with the consensus here. I guess that would also involve removing verifyAccessibilityTree from this first pass.
  3. executormarionette being the only implementation in this PR is a bit odd. On the other hand, it's difficult to implement (and verify the implementation of) this in executorwebdriver because we don't have a browser implementation yet to use.

@zcorpan
Copy link
Member

zcorpan commented Dec 2, 2025

From our last meeting I think we can omit "tentative" prefixes in the API names and instead assert that the methods are only used in tentative tests. I've implemented that in this PR.

Copy link
Contributor

@alice alice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's so good to see this progressing!

@cookiecrook cookiecrook dismissed their stale review December 6, 2025 00:57

substantive feedback in first review has been or is being addressed.

…rifyAccessibilitySubtree take either an Element or a selector.
…basic" tests intended purely to test that the accessible_properties methods are working vs actual tests for specific properties.
],
});
*/
verifyAccessibilitySubtree: function(subtreeRoot, expectedTree) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment asking if I like this is buried somewhere in an old revision, but yes, I like this :)

Copy link
Contributor

@cookiecrook cookiecrook Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@twilco and I were discussing, and have some reservations that AI-slop tests might get auto-submitted with an expectation of structure reliant on implementation details in one vendor's tree. Given that some of these pre-autosubmission reviews happen outside the public GitHub repo, this could result in much more effort to remove the invalid assumptions than to generate them.

Copy link
Contributor

@cookiecrook cookiecrook Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently this is using assertTestIsTentative() which is a good start, but this one may need more consideration... I'm thinking maybe this one should not go in aria-utils.js yet... What about a separate JS file (filename also using the substring tentative) where we include some more comments about the pitfalls of assuming a standardized tree where no standard exists?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ultimately, I'll do whatever needs to be done to get this over the line. However, I'd counter-argue that AI-slop tests aren't just a risk for subtree tests. Tree structure isn't the only place where we don't have 100% specified interop. If AI-slop tests are a massive risk, it feels like this needs a broader solution. Moving a utility (granted one with a somewhat higher risk of interop mismatch) into a different file isn't going to solve it.

I think it's reasonable to add a note to the functions' header comment, but personally, I'd rather not move this into a different file unless that's a blocking concern.

@alice
Copy link
Contributor

alice commented Dec 12, 2025

(All my comments should be considered optional suggestions! I think this is fine already.)

For example:
<div data-testname="div[role=button][aria-pressed=mixed]"
role="button" aria-pressed="mixed"
data-expected='{ "role": "button", "label": "foo", "pressed": "mixed" }'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JSON requires property names to be quoted, as well as double quotes rather than single quotes. It'd be nice to use the more permissive JS syntax - e.g. data-expected="{ role: 'button' }" - but doing that would require us to use eval instead of JSON.parse. eval is usually frowned upon, though I can make that change if folks are happy with it and it's not blocked by the CSP.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine either way - whatever gets it done and others are happy with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infra testdriver.js wai-aria wg-wai_pf wptrunner The automated test runner, commonly called through ./wpt run

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracker: Support for additional accessibility properties beyond name and role

5 participants