[whatwg] Linters should complain about missing accessible names for controls [Was: Re: alt="" and the <meta name=generator> exception]

Henri Sivonen hsivonen at iki.fi
Sun Aug 5 06:14:32 PDT 2012


On Sat, Aug 4, 2012 at 10:32 PM, Benjamin Hawkes-Lewis
<bhawkeslewis at googlemail.com> wrote:
> Would it be possible to combine this with the linter complaining about
> all controls (links, buttons, form fields) have markup that yield a
> non-empty "accessible name" without invoking repair techniques such as
> reading filenames without img @src attributes?

Given a well-defined algorithm for finding the accessible name for
links, buttons and form fields, I think it would make sense for a
validator to be able to complain when the algorithm results in an
empty accessible name. Whether that should be a validity constraint or
an optional additional check is a bit tricky, for the same reason why
we allow empty paragraphs and empty lists: to let markup editors
simultaneously guarantee the validity of their output and to allow the
user to save the document at any stage of editing.

(Again, there's tension between different uses of validity: the sort
of validity constraints you want to hold before and after each
discrete editing operation and constraints you want to hold when the
document is "done".)

> http://www.w3.org/WAI.new/PF/aria/roles#namecalculation

Spec writing that puts a point starting with "Authors MAY" under "The
text alternative for a given node is computed as follows:" is
sad-making. :-(

> I realise the author requirements in the HTML spec seem to have
> gradually become very forgiving here, not really sure why. :(

To avoid e.g. the insertion of an   in each newly-created <p></p>
in an editor to avoid violating a ban on empty paragraphs. Validity
constraints have unintended consequences.

> The cases where markup generators cannot provide a better control name
> than _nothing_ seem to me much rarer than the cases where markup
> generators cannot provide better text alternatives for photos etc -
> maybe even non-existent - and when hand-authoring describing a control
> is even easier than coming up with a text equivalent for a graphic.

Yeah. In this case, the problem isn't non-interactive generators but
interactive editors.

-- 
Henri Sivonen
hsivonen at iki.fi
http://hsivonen.iki.fi/



More information about the whatwg mailing list