WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: hide decorative characters from screen readers

for

From: James Nurthen
Date: Aug 12, 2011 1:42PM


On Fri, Aug 12, 2011 at 11:57, John Foliot < <EMAIL REMOVED> > wrote:
> Yes, I agree that screen readers (NVDA has the same behavior) shouldn't
> real aloud :before or :after pseudo-selector characters. We have a
> precedent here in that you cannot copy and paste those same characters
> from the browser screen (they are treated like background images) and
> screen readers should treat them the same way as well, IMHO.
>
> Anyone disagree, and if so why (please)?

John, This is how it used to work - but WAI-ARIA introduces the following
into the accessible name calculation (
http://www.w3.org/TR/wai-aria/roles#textalternativecomputation )

3. Text nodes are often visited because they are children of an element that
> uses rule 2C to collect text from its children. However, because it is
> possible to specify or alter textual content using CSS rules, it is
> necessary for user agents to combine such content, as appropriate, with the
> text referenced by the text nodes to produce a complete text alternative. An
> example is the use of CSS :before and :after pseudo-elements, where the user
> agent combines the textual content specified in the style sheet with that
> given in the DOM.
>
>
> - When an image replaces text, then the UA should use the original
> text, since that text is presumably the equivalent.
> - When text replaces an image, then the UA should provide that text.
> - When new text replaces old, then the UA should include the new
> text, since that is what is rendered on screen.
>
>
>
>