Need more tests for nested label edge cases

オープン
#201 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
html

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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?

主要言語
言語のデータがありません
スター
57
フォーク
5
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

web-platform-tests/interop-accessibility のほかの issue

web-platform-tests/interop-accessibility の issue をすべて見る

似ている issue

Accessibility の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。