[whatwg] Conformance checking of missing alternative content for images

Ian Hickson ian at hixie.ch
Fri Dec 14 15:56:39 PST 2012


On Fri, 7 Sep 2012, Benjamin Hawkes-Lewis wrote:
> On Fri, Sep 7, 2012 at 6:12 AM, Ian Hickson <ian at 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.

Yes, but they might not always be able to expose one without it being a 
problem. For example, consider a "Battleships"-style game where the board 
is a grid of cells where each cell is labeled with a row and column name 
("column B, row 5", etc). The buttons don't have to have explicit labels 
for the buttons to legitimately be said to have labels. Yet we have to 
distinguish this case from a cell that has an unlabeled "edit" button that 
isn't related to the cell headings. I don't see how you'd do that 
programatically.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'


More information about the whatwg mailing list