Need more tests for nested label edge cases

Abierto
#201 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
html

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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?

Lenguaje dominante
Sin datos de lenguaje
Estrellas
57
Forks
5
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de web-platform-tests/interop-accessibility

Todos los issues de web-platform-tests/interop-accessibility

Issues similares

Más issues de Accessibility

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.