Re: [whatwg] Conformance checking of missing alternative content for images

On Fri, Sep 7, 2012 at 6:12 AM, Ian Hickson <ian@hixie.ch> wrote:
> On Sun, 26 Aug 2012, Benjamin Hawkes-Lewis wrote:
>> >>
>> >> It would help catch the not uncommon antipattern where the "content"
>> >> of a link or button is provided only by a background image.
>> >>
>> >>    <a href="somewhere"></a>
>> >>    <a href="somewhere-else"></a>
>> >>
>> >>    <button class="delete"></button>
>> >
>> > This is should-level non-conforming and has no reason to be
>> > conforming, as far as I can tell ("elements whose content model allows
>> > any flow content or phrasing content SHOULD have at least one child
>> > node that is palpable content and that does not have the hidden
>> > attribute specified").
>> >
>> > The only reason it's not entirely non-conforming ("must" rather than
>> > "should") is that there are some edge cases where it makes sense, e.g.
>> > when you have an empty paragraph that you're going to fill in later.
>> >
>> > But maybe we should tighten this up again, e.g. for interactive
>> > content?
>>
>> I cannot imagine a good reason to include an unnamed control, so yes.
>>
>> Note that this would need to take into account that fields might be
>> labelled by a <label> or a table header cell.
>
> Hm, that's a good point. I don't think there's a good way to
> programmatically detect whether there's a label or not, so I'll just leave
> it as a SHOULD for now.

That doesn't make any sense to me.

For browsers to expose an accessible name for a field or control, they
must compute it from the DOM.

If it is possible for browsers to compute it from the DOM, then it is
possible for a linter to compute it from markup.

If the linter computes an empty/whitespace string, that (should be) an error.

The algorithm for computing names from the DOM can be fully defined.
If it's not defined, and author conformance requirements are not
aligned with that definition, that's a failure of specification.

That the algorithm for computing names is not *entirely* trivial does
not mean we cannot define it or have MUST-level conformance
requirements around it (q.v. HTML parsing, image alternate text,
etc.).

--
Benjamin Hawkes-Lewis

Received on Friday, 7 September 2012 07:35:47 UTC