Skip to content

Should the Host Language Label be used if it's empty? #234

Open
w3c/aria
#2486
@dandclark

Description

@dandclark

The Host Language Label step E of the accname computation algorithm is unclear on whether the empty string should be used if that's what the native markup provides.

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

Going by a strict reading of the spec, I'd guess that an empty string should be used. However the img with tooltip label with empty alt subtest of accname/name/comp_tooltip.html suggests that an empty alt attribute should be ignored. Gecko and WebKit pass this test, while Blink fails.

If that test reflects the intended behavior, should the spec be updated to something like this?

E. 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 text alternative is an empty string or the element is marked as presentational (role="presentation" or role="none").

Also -- if the empty string is omitted, what about a whitespace-only string? (See #233).

Metadata

Metadata

Assignees

Type

No type

Projects

Status

High priority

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions