Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heading aria-labelledby Computation Behavior #2287

Open
WilcoFiers opened this issue Feb 7, 2025 · 0 comments
Open

Heading aria-labelledby Computation Behavior #2287

WilcoFiers opened this issue Feb 7, 2025 · 0 comments
Labels
accessibility support Accessibility support testing and tracking

Comments

@WilcoFiers
Copy link
Member

Accessibility support

The accessible name and description computation specification suggests that if an aria-labelledby attribute refers to an existing but empty element, the computation should stop and return an empty name without defaulting to the next steps. However, several user agents and assistive technologies choose to use the next step in the computation in this case (ultimately defaulting to the content).

ACT Rules

Test cases

Test case 1

Testing aria-labelledby computation behavior

<!-- Heading with empty aria-labelledby reference -->
<span id="empty-label"></span>
<h1 aria-labelledby="empty-label">Important Content</h1>

<!-- Heading with whitespace-only aria-labelledby reference -->
<span id="space-label"> </span>
<h1 aria-labelledby="space-label">Contact Information</h1>

<!-- Heading with multiple references, first one empty -->
<span id="first-label"></span>
<span id="second-label">Section</span>
<h1 aria-labelledby="first-label second-label">About Us</h1>

<!-- Heading with non-existent reference -->
<h1 aria-labelledby="missing-label">Our Services</h1>

<!-- Heading with mixed content and empty reference -->
<span id="mixed-label"></span>
<h1 aria-labelledby="mixed-label">
	<img src="icon.png" alt="" />
	News Updates
</h1>

Test case

Test instructions

  1. Load the test case in different browsers
  2. Test with different screen reader combinations
  3. For each heading, check:
    • If an accessible name is computed
    • What name is announced by screen readers
    • If the computation falls back to element content
    • How whitespace-only references are handled
  4. Expected results:
    • According to spec: Empty references should result in empty names
    • In practice: Many UAs fall back to element content
    • Whitespace handling should be consistent
    • Multiple references should work as expected

External links

Test results

Please report test results in a comment below. Please use the following format:

## Test case 1

- Date: ...
- Operating system: ..., version ...
- Browser: ..., version ...
- Screen reader: ..., version ...
- Results for each heading:
  1. Empty reference: ... (empty name/falls back to content)
  2. Whitespace reference: ... (empty name/falls back to content)
  3. Multiple references: ... (behavior description)
  4. Missing reference: ... (behavior description)
  5. Mixed content: ... (behavior description)
- Computation behavior: ... (follows spec/falls back)
- Test result: Passed / Failed (if failed, how was it different from expected?)
@WilcoFiers WilcoFiers added the accessibility support Accessibility support testing and tracking label Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility support Accessibility support testing and tracking
Projects
None yet
Development

No branches or pull requests

1 participant