Skip to content

An unnamed <form> is announced as "form" #253

Closed

Description

@Elizabeth1979

Markup

<main><form><input aria-label="q"></form></main>

Virtual Screen Reader says (0.32.1 and 0.33.0):

main, form, textbox, q, end of form, end of main

Expected: no form / end of form. HTML-AAM maps a form element to the form role only when it has an accessible name; an unnamed form gets no corresponding role (generic), so it is not a landmark and screen readers do not announce it. A named form (<form aria-label="Checkout">) is correctly announced as form, Checkout.

Environment: the browser bundle (@guidepup/virtual-screen-reader/browser.js) in Chromium 151 via Playwright 1.63, started with virtual.start({ container: document.body }), stepped with virtual.next().

Activity

  1. cmorten commented on Oct 17, 2026

    @cmorten
    Contributor

    Hmm, I'm not 100% on this...

    1. HTML-AAM 1.0 lists the role of a form element as form without any conditions
    2. CORE-AAM 1.2 appears to concur (and defers to the native host mapping, i.e. HTML related specs)
    3. HTML-ARIA appears to concur

    What all specs mention / agree on is:

    A form is not exposed as a landmark region unless it has been provided an accessible name.

    Which I understand to mean we definitely shouldn't be exposing a <form> with no accessible name/label as a landmark, but does that also mean not to expose it as a form role?

    If it does mean it has a computed role of form but isn't a landmark, I'm not sure how that fits with the WAI-ARIA 1.2 spec listing the superclass of form as landmark

    Interestingly in WAI-ARIA 1.3 the wording relating to forms softens:

    Authors SHOULD give each element with role form a brief label that describes the purpose of the form.
    ...
    User agents SHOULD treat elements with role form and an accessible name as navigational landmarks.
    ...

    Changed from MUST like wording in 1.2, perhaps to reflect that other specs appear to accept that a form can be nameless?


    Digging around spec issues I believe form elements act as follows:

    1. Unnamed form elements have role="form" but are not exposed as a landmark
    2. Named form elements have role="form" and are exposed as a landmark

    REF:

    A pertinent quote from Scott O'Hara:

    "... a form landmark needs a name, but unnamed the form role may still be exposed, but not as a landmark"

  2. cmorten commented on Oct 17, 2026

    @cmorten
    Contributor

    Thus, I think the announced speech in the OP example is correct, but we will need to adjust any logic relating to form landmarks, e.g. landmark quick navigation logic (REF: https://github.com/guidepup/virtual-screen-reader/blob/main/src/commands/index.ts#L49) and maybe some other bits.

  3. added theissue type on Oct 17, 2026
  4. cmorten commented on Oct 23, 2026

    @cmorten
    Contributor

    Given #267 is merged I think this is now complete (unless contest my notes r.e. the form role!)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions