Compose a semantics review board ensuring HTML semantics, ARIA roles, and accessible…
- User
Compose a semantics review board ensuring HTML semantics, ARIA roles, and accessible name computation stay compliant.
Assistant
1. Analyze the Request: * Goal: Compose a "Semantics Review Board". * Focus Areas: HTML Semantics, ARIA Roles, Accessible Name Computation. * Constraint: Ensure compliance (meaning the board should provide a structured way to check/guarantee compliance).
-
Determine the Format:
- A "Review Board" implies a structured process, a checklist, or a panel discussion simulation.
- Given the prompt asks to compose one, it could mean creating a persona-based board (like a meeting transcript) or a functional tool (like a checklist/rubric).
- Decision: A functional checklist/rubric format is most useful for developers and auditors. However, framing it as a "Board" suggests a set of criteria or "members" representing different aspects of accessibility.
- Refined Decision: Let's create a structured Semantics Compliance Checklist & Decision Matrix. It acts as the "Board" that the code must pass before deployment. I will organize it by the three specific pillars requested: HTML Semantics, ARIA Roles, and Accessible Name Computation.
-
Drafting the Content - Pillar 1: HTML Semantics (The Foundation)
- Concept: Does the tag match the content?
- Key Checks:
- Native elements first (e.g.,
<button>vs<div onclick>). - Document structure (
<header>,<main>,<nav>,<footer>). - Headings hierarchy (h1-h6).
- Lists and tables.
- Native elements first (e.g.,
- Question for the "Board": "Is the element using the most semantic native HTML tag available before resorting to divs/spans?"
-
Drafting the Content - Pillar 2: ARIA Roles (The Enhancement)
- Concept: If HTML isn't enough, does ARIA fill the gap correctly? (First Rule of ARIA: Don't use ARIA if you don't need to).
- Key Checks:
- Role validity (Is it a valid WAI-ARIA role?).
- Required attributes (e.g.,
role="checkbox"needsaria-checked). - Role conflict (e.g., presenting a generic inside an interactive).
- Focus management (interactive elements must be focusable).
- Question for the "Board": "Does the ARIA role correctly describe the behavior, and are all required states and properties present?"
-
Drafting the Content - Pillar 3: Accessible Name Computation (The Identity)
- Concept: How does a screen reader actually announce this element?
- Key Checks:
- Naming methods (aria-label, aria-labelledby, visible text content, alt text).
- Priority order (Labelledby > Label > Title > Placeholder/etc).
- Redundancy (Don't include the role in the name, e.g., "Submit Button Button").
- Empty names on focusable elements (Critical failure).
- Question for the "Board": "Does the element have a discernible, unique, and non-redundant accessible name?"
-
Structuring the "Board" Output:
- To make it distinct, I'll frame this as a formal Audit Protocol.
- I will create a "Scorecard" style.
- I will add specific "Verdict" criteria (Pass, Fail, Critical Fail).
-
Refining the details (Self-Correction/Polishing):
- Tone: Professional, technical, and authoritative.
- Example: Provide concrete examples of good vs. bad code for clarity.
- Mechanism: How does the "Board" decide? It uses the W3C specs (WAI-ARIA 1.2, HTML-AAM).
-
Finalizing the Output Structure:
- Header: Mission Statement.
- Section 1: The Native Semantic Review (HTML).
- Section 2: The Role & State Review (ARIA).
- Section 3: The Naming & Description Review (ACCNAME).
- Section 4: The Interaction Test.
- Appendix: Quick Reference Matrix.
-
Writing the content: (Mental Draft)
- HTML: Check for
button,a, landmarks. - ARIA: Check for
role="dialog",aria-modal. - Name: Check
aria-labelledbypointing to ID that exists.
- HTML: Check for
-
Review against Prompt:
- HTML Semantics included? Yes.
- ARIA Roles included? Yes.
- Accessible Name Computation included? Yes.
- Compliant? Yes, strictly based on W3C.
-
Final Polish: Use formatting (bolding, lists, code blocks) to make it readable as a dashboard/report. (Proceed to generate output).
The Semantics Review Board
Protocol: W3C Compliance & Accessibility Integrity
This document outlines the operational checklist for the Semantics Review Board. It serves as a rigorous audit framework to ensure that web interfaces adhere to HTML living standards, WAI-ARIA specifications, and the Accessible Name Computation algorithm.
Board Mission Statement
To verify that all interactive and structural elements possess unambiguous machine-readable semantics, ensuring that User Agents (browsers) and Assistive Technologies (AT) can accurately determine the Role, State, Property, and Name of every node in the accessibility tree.
Phase 1: The Native Semantics Audit
Goal: Ensure structural integrity using native HTML elements before resorting to ARIA.
Checklist
- The "First Rule" Test: Is a native HTML element available for the desired semantics?
- Compliance Check: If a
<button>,<a>,<input>, or<select>can be used, ARIA attributes MUST NOT be used to replicate it on a<div>or<span>.
- Compliance Check: If a
- Landmark Verification: Are semantic landmarks (
<header>,<nav>,<main>,<footer>,<aside>) present and unique?- Compliance Check: No more than one
<main>element per page. If multiple<nav>or<aside>elements exist, they must be distinguished viaaria-labeloraria-labelledby.
- Compliance Check: No more than one
- Heading Hierarchy: Do heading tags (
h1–h6) follow a logical sequence without skipping levels? - Interactive Element Separation: Are interactive elements (links, buttons) structurally separated from non-interactive elements to prevent "double click" or "nested interactive" errors?
Phase 2: The ARIA Role & State Review
Goal: Validate that custom widgets expose correct roles and maintain state synchronization.
Checklist
- Role Validity: Does the
roleattribute match the intended behavior pattern (e.g.,role="dialog",role="tablist")?- Compliance Check: Ensure the role is valid within its parent context (e.g.,
tabmust be inside atablist).
- Compliance Check: Ensure the role is valid within its parent context (e.g.,
- Required Owned Elements: Does the parent container contain the required children?
- Example: A
gridrequiresrowelements, which requiregridcellelements.
- Example: A
- State & Property Synchronization: Are dynamic states updated immediately upon user interaction?
- Compliance Check:
aria-expanded: Must toggletrue/falsewhen a submenu/dropdown opens.aria-selected: Must toggletrue/falseinsidetablistorlistbox.aria-pressed: Must toggle for toggle buttons.aria-disabled: Used instead of the HTMLdisabledattribute when an element needs to remain focusable but inactive.
- Compliance Check:
- Live Region Behavior: Are
aria-liveregions used correctly for dynamic content updates?- Compliance Check:
aria-live="polite"for non-critical updates;aria-live="assertive"only for immediate danger or critical alerts.
- Compliance Check:
Phase 3: Accessible Name Computation (ANC)
Goal: Determine how an Assistive Technology announces the element. This follows the Accessible Name and Description Computation specification.
Priority Hierarchy (Descending Order)
The Board verifies that the name is derived from the highest-priority source available in this list:
aria-labelledby:- Check: Does the ID reference exist in the DOM?
- Check: Does the referenced element contain visible text?
- Constraint: If present, this overrides all other naming methods.
aria-label:- Check: Is the string meaningful? (e.g., "Close Menu" vs. "X").
- Constraint: Should not be used on elements that have no visible text support if the user is voice-inputting commands (Voice Control users need to see the label to speak it).
- Native Host Language Text:
- Check: Inner text (e.g.,
<button>Submit</button>). - Check: Alt text for images (
<img alt="Company Logo">). - Check:
<label>tags associated with form inputs viaforattribute.
- Check: Inner text (e.g.,
titleAttribute:- Usage: Used as a fallback if
aria-labeland visible text are missing. Not recommended for primary naming due to discoverability issues.
- Usage: Used as a fallback if
The "Name From Content" Test
Does the element allow name from content?
- Pass: Buttons, Links, Checkboxes, Tabs, Menu Items.
- Fail: Text inputs, Sliders, Progress Bars (These usually require
labeloraria-label, as their visible text is often descriptive, not the name itself).
Phase 4: Common Violations Registry (The "Stop Work" List)
Any component triggering the following violations is immediately rejected.
Violation ID Description Impact V-101 Div with onclickbut norole="button"AT sees it as generic text; it is invisible to screen readers. V-102 Generic Link ( <a>) withouthrefTreated as a placeholder; not focusable via keyboard. V-103 Role Reversal Using role="presentation"orrole="hidden"on a focusable element (focus remains, semantics disappear = "Ghost Focus").V-104 Redundant Naming aria-label="Search"on an input that already has a visible label<label>Search</label>causing double announcement.V-105 Empty Names on Interaction An icon-only button lacking aria-labelortooltiptext mapping.
Summary Verdict Form
Component ID:
[Insert ID]Auditor:[Name]- Native Semantics: [ ] Pass [ ] Fail
- ARIA Roles: [ ] Pass [ ] Fail
- State Management: [ ] Pass [ ] Fail
- Accessible Name: [ ] Pass [ ] Fail
Notes:
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.