W3C home > Mailing lists > Public > w3c-wai-gl@w3.org > July to September 2008

RE: Question on <pre> and <code> - violation of 1.3.1?

From: Andrew LaHart <andrew.lahart@us.ibm.com>
Date: Fri, 5 Sep 2008 10:34:32 -0400
To: "David MacDonald" <befree@magma.ca>, WCAG <w3c-wai-gl@w3.org>
Cc: Brian Cragun <cragun@us.ibm.com>
Message-ID: <OF389D0E92.59D15FF9-ON852574BB.004EAC94-852574BB.005014B4@us.ibm.com>
Thanks David,

I agree. In most places where we are showing blocks of code, there are cues
that indicate the presence of a code sample.

But what about when we have only one word, and that word is inside the
<code> element?  For example, here is a line taken from the the ARIA1
technique (note I typed out the <code> tags to show where we use them. On
the rendered page those tags wouldn't be visible of course).:

"This example uses scripting to add the <code>describedby</code> property
to user interface controls on the page"

Is the use of <code> in this fashion a failure?

Here is another example from the Javadocs:

"String concatenation is implemented through the <code>StringBuffer</code>
class and its <code>append</code> method. String conversions are
implemented through the method <code>toString</code>, defined by
<code>Object</code> and inherited by all classes in Java."

Perhaps the use of the word "method", or "class", or "property" after the
code is enough of an indicator that the previous word was a code sample,
this making these examples not violations?

Thanks again,
Andrew LaHart
IBM Human Ability and Accessibility Center

             "David MacDonald"                                             
             Sent by:                                                   To 
             w3c-wai-gl-reques         Andrew LaHart/Fairfax/IBM@IBMUS,    
             t@w3.org                  "'WCAG'" <w3c-wai-gl@w3.org>        
                                       Brian Cragun/Rochester/IBM@IBMUS    
             09/05/2008 10:15                                      Subject 
             AM                        RE: Question on <pre> and <code> -  
                                       violation of 1.3.1?                 

I believe we generally present code examples by saying something like “in
the following example…”
also most code samples open with the <head> element or the doc type
statement which is also a clear indication that it is code.

But if it’s a concern perhaps we need to check all the techniques to make
sure that is evident to screen readers that we are providing a code
example. Either by explicitly announcing it, or by opening examples with a
common element like the doctype statement.

David MacDonald

access empowers people...
        ...barriers disable them...

From: w3c-wai-gl-request@w3.org [mailto:w3c-wai-gl-request@w3.org] On
Behalf Of Andrew LaHart
Sent: Friday, September 05, 2008 9:56 AM
Cc: Brian Cragun
Subject: Question on <pre> and <code> - violation of 1.3.1?

Good morning,
Is the use of <pre> and <code> to distinguish code samples a violation of
1.3.1 in WCAG 2? The argument can be made that information is conveyed by
variations in presentation of text.

For example, in the Techniques document, we use <code> inline in many
places without any other mechanism to determine that a code sample is
present. Any of the techniques pages can be used as an example of this, but
here is one in particular that wraps the describedby property in <code>

Screen reader users don't have access to this information, so should the
use of <pre> and <code> be cited as failures of G117 or H49?

Any thoughts from the group would be most appreciated.
Thank you!

Andrew LaHart
IBM Human Ability and Accessibility Center

(image/gif attachment: graycol.gif)

(image/gif attachment: pic02851.gif)

(image/gif attachment: ecblank.gif)

Received on Friday, 5 September 2008 14:35:23 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 20:32:39 UTC