WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: search result highlighting and accessibility


From: Jared Smith
Date: Apr 21, 2010 10:33AM

On Wed, Apr 21, 2010 at 8:48 AM, Andrew Johns < <EMAIL REMOVED> > wrote:
> Based on the requirement not to rely solely on colour when presenting
> information, I wondered if anyone had any thoughts on how to mark up search
> results and keywords or phrases using more than just colour.

This introduces some interesting and difficult questions.
Unfortunately there is not a <highlight> or similar element in HTML,
though screen readers still barely support <strong> and <em>, so it's
unlikely this would result in any better accessibility anyway.

Marking up the highlighted text with <strong> or <em> in addition to
the color background would provide *something* other than color alone
to identify the difference. This would mostly address the low vision
and color deficiency concerns. I think this is probably the best
option despite the poor screen reader support for these most basic of
semantic elements. (Yes, I understand that JAWS will read these
differently if you turn on a very obscure setting that hardly anybody
knows exists.)

Anything beyond this becomes more complex. You could inject hidden
text of "Begin highlight." and "End highlight." before and after each
instance, but the overhead of this is pretty significant. It could
easily be argued that this would make the content *LESS* accessible,
not more.

I suppose one could argue that the highlighting is for visual purposes
only. One could also justify that the presence of the word itself
("oranges") provides the non-color designator (i.e., if I search for
"oranges" I can still identify the instances of the word "oranges"
without seeing the color highlight). I can certainly see how this
might pass both 1.3.1 and 1.4.1 in WCAG 2.0, though I think this would
only apply to highlighting of words that the user would reasonably
expect to be highlighted. The "Find" feature of the user agent allows
someone that cannot discern the visual highlighting to find the
instances throughout the page. While these all seem to remove the
burden of presenting the highlighted information in some other way,
they still don't seem equivalent to me.

In short, I don't know if there is a perfect solution.