Need more tests for nested label edge cases

Aperta
#201 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
html

Direzione di ricerca

Start with the nested-label markup in the issue and reproduce its accessible-name output in Safari, Chrome, and Firefox, including the variant using the for attribute. Compare the results with the stated label-association behavior and determine what expected behavior or test coverage should be specified; no test file or entry point is named.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

2025-investigation-candidate 2026-investigation-candidate

@twilco asked in another thread:

Given this markup:

<label id="label-1">
    One
    <label id="label-2"> Two <input type="checkbox"></label>
    <label> Three <input type="checkbox"></label>
</label>

When focusing the first checkbox, macOS VoiceOver reads:

  • Safari: "One Two Three Two"
  • Chrome: "One Two Three"
  • Firefox: "Two"

This is a simplification of real markup […]

Following the letter of the spec, all labels associated with a control must be concatenated together. And if you call HTMLLabelElement.control’ on #label-1 and #label-2, they will both return the first checkbox. So by this definition, Chrome is most correct, and Safari follows the same algorithm as Chrome but duplicated part of the string. But in this case, Firefox's technically non-spec compliant behavior is the best.

If you use the for attribute, Firefox will output "One Two Three Two" (seems like a bug, like with Safari)? Seems like Firefox's behavior is that when finding labels to concatenate, it only references the nearest-ancestor label, plus the label of any number of explicit relationships with for.

Which browser seems right? If Firefox, maybe the spec needs to be clarified?

Lingua principale
Nessun dato sulla lingua
Stelle
57
Fork
5
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di web-platform-tests/interop-accessibility

Tutte le issue di web-platform-tests/interop-accessibility

Issue simili

Altre issue su Accessibility

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.