Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Label element with role presentation and accname Host Language Label #167

Open
giacomo-petri opened this issue Jan 9, 2025 · 0 comments · May be fixed by web-platform-tests/wpt#50002
Open

Comments

@giacomo-petri
Copy link

There is some ambiguity in Point E: Host Language Label of the accname specification.

It states:

Host Language Label: Otherwise, if the current node's native markup provides an attribute (e.g., alt) or element (e.g., HTML label or SVG title) that defines a text alternative, return that alternative in the form of a flat string as defined by the host language, unless the element is marked as presentational (role="presentation" or role="none").

However, when applied to examples like these:

<label role="presentation" for="test">First Name</label>
<input id="test" type="text">
<label role="presentation">
    <span>First Name</span>
    <input type="text">
</label>

the expected behavior is not entirely clear. To address this, I created PR 2405, which aims to clarify the specification (assuming the intent is to assign the input the accessible name provided by its label, regardless of the role="presentation" attribute set on the label element).

I plan to create a WPT test to cover this scenario and ensure consistent interpretation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant