UCDL Accessibility Use Case Definition Language
Contents

Accessibility Use Case Definition Language (UCDL) and Runner

15. Accessibility-First Design

This section is normative; rationale is informative.

The following constraints on the language are deliberate, normative, and not to be relaxed by extensions:

  1. Targets MUST be expressed as role + accessible name (or as one of the explicit id/data-* escape hatches). CSS selectors and XPath are NOT part of the surface language.
  2. locate asserts visibility in the accessibility tree for every role token: the role query excludes elements hidden from assistive technology, so a visually present but accessibility-hidden element MUST cause locate to fail. The field, text, id and data-* tokens do not consult the tree (§5.4), and locate on them asserts CSS visibility only.
  3. focus asserts the element actually receives focus. Calling focus() without verification is non-conforming. Receiving programmatic focus is not the same as being reachable by keyboard; that is asserted with keyboard and verify: focus (§5.6.2).
  4. verify: alert checks role="alert". Visual-only error display does not pass.
  5. verify: field_error checks BOTH aria-invalid="true" AND a non-empty aria-describedby or aria-errormessage referencing a visible message. Either alone is insufficient.
  6. verify: live_region checks a real ARIA live region — a live-region role (status, alert, log, marquee, timer) or an explicit aria-live declaration — examining every one on the page rather than one chosen by role priority. Narrowing is by role or by politeness; politeness is the only one that can name a region declared by the attribute alone. Polling a visual element by class is non-conforming; the aria-live attribute is the semantic itself, not a visual hook.

The rationale: a use case is an accessibility test. If a target cannot be addressed by role and name, the test failure is the finding. If focus() is called but the document's active element does not become the target — it is hidden, inert, disabled, or not focusable — the test failure is the finding. The language is shaped so that the easy thing to write is also the right thing to assert.