Re: Placeholder attribute an accessible name?

Hi Patrick,

> E. 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").


> where placeholder is "an attribute ... that defines a text alternative".

And this is where I am both confused and disagree with the
interpretation: @placeholder is *not* defining a text alternative, and in
fact the HTML 5 spec is explicit that it is only providing a "hint"
(whatever that is) and is NOT an "HTML label". But, I also understand the
priority of constituents (users over authors over implementers over code
purity) - but it sure does feel like a sideways definition of a "text
alternative".

> It also seems that currently browsers don't fully agree yet on whether or
not placeholder should be exposed as an accName of last resort
(from memory, Chrome and Webkit do expose it, while Firefox doesn't).

To which I personally believe that Firefox (like you, from memory) has the
correct implementation, but I also refer back to the priority of
constituents. Nonetheless, with uneven support and the other known issues
with @placeholder, I maintain that using it for labeling the input is
'incorrect', and should be avoided.

JF

On Wed, Oct 19, 2022 at 2:53 PM Patrick H. Lauke <redux@splintered.co.uk>
wrote:

> On 19/10/2022 19:42, John Foliot wrote:
>
> > I was curious about that: the HTML 5 spec is quite clear, and the ARIA
> > spec around accessible name calculation is non-specific about that
> > particular attribute (the calculation is less clear than it used to be,
> > when it specifically listed the attributes in the recursive loop - but I
> > still don't see @placeholder mentioned anywhere). I do understand
> > however that screen readers are doing this calculation out of necessity,
> > but is it standard behavior, or more just due to precedent?
>
> I believe in the accessible name calculation algorithm, this falls under
>
> E. 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").
>
> where placeholder is "an attribute ... that defines a text alternative".
>
> It also seems that currently browsers don't fully agree yet on whether
> or not placeholder should be exposed as an accName of last resort (from
> memory, Chrome and Webkit do expose it, while Firefox doesn't).
>
> P
> --
> Patrick H. Lauke
>
> https://www.splintered.co.uk/ | https://github.com/patrickhlauke
> https://flickr.com/photos/redux/ | https://www.deviantart.com/redux
> twitter: @patrick_h_lauke | skype: patrick_h_lauke
>
>
>

-- 
*John Foliot* |
Senior Industry Specialist, Digital Accessibility |
W3C Accessibility Standards Contributor |

"I made this so long because I did not have time to make it shorter." -
Pascal "links go places, buttons do things"

Received on Wednesday, 19 October 2022 19:37:30 UTC