Label element with role presentation and accname Host Language Label #167
Description
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.