W3C home > Mailing lists > Public > w3c-wai-ig@w3.org > April to June 2013

RE: Validation errors in "Techniques for providing useful text alternatives" page

From: Andy Keyworth <akeyworth@tbase.com>
Date: Thu, 11 Apr 2013 10:12:30 -0400
To: "'Rabab Gomaa'" <Rabab.Gomaa@inspection.gc.ca>, "'Jonathan Avila'" <jon.avila@ssbbartgroup.com>, "'WAI Interest Group list'" <w3c-wai-ig@w3.org>
Message-ID: <001701ce36be$9a866c30$cf934490$@tbase.com>
My best guess is it's a Validator bug; the sample code from
"http://www.w3.org/TR/html-alt-techniques/#hbh" doesn't pass the Validator
either. 

Going to a simplified code sample:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>test</title>
</head>
<body>
<figure role="group">   
<img src="webcam1.jpg" alt="Sopwith house weather cam. Taken on the 21/04/10
at 11:51 and 34 seconds." />  
<figcaption>View from the top of Sopwith house, looking towards north
Kingston. In the foreground of the image are the safety rails on the flat
part of the roof. Nearby there are low rise industrial buildings, beyond are
blocks of flats. In the distance there's a church steeple.</figcaption>
<p>This image is updated every hour.</p>
</figure>
</body>
</html>

causes the Validator to declare the same error about "element p not allowed
as a child of element figure in this context"; while 

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>test</title>
</head>
<body>
<figure role="group">   
<img src="webcam1.jpg" alt="Sopwith house weather cam. Taken on the 21/04/10
at 11:51 and 34 seconds." />  
<p>This image is updated every hour.</p>
<figcaption>View from the top of Sopwith house, looking towards north
Kingston. In the foreground of the image are the safety rails on the flat
part of the roof. Nearby there are low rise industrial buildings, beyond are
blocks of flats. In the distance there's a church steeple.</figcaption>
</figure>
</body>
</html>

does not, even though according to the description on the page above, both
element orderings are valid. 

Andy Keyworth
Senior Web Accessibility Specialist |  <http://www.tbase.com/> T-Base
Communications Inc.
19 Main Street | Ottawa, ON | K1S 1A9
Phone. 613. 236. 0866 Ext. 256 | Fax. 613. 236. 0484 | Toll free: 1. 800.
563. 0668 

 

www.tbase.com <http://www.tbase.com/>  | In Sight. In Sound. In Touch with
your Customers TM 

 

We'd LOVE to know how you heard about us! Please complete this 3 minute
survey
<http://survey.constantcontact.com/survey/a07e75yhdkkhe1kvmyr/a003he5pr3q7/g
reeting>  for your chance to win FREE braille business cards. 

   

Opt-in to stay-up-to-date! Subscribe to T-Base updates
<http://www.tbase.com/webform/stay-informed>    

 

This e-mail message (including attachments, if any) is intended for the use
of the individual or entity to which it is addressed and may contain
information that is privileged, proprietary, or confidential. If you are not
the intended recipient, you are notified that any dissemination,
distribution, or copy of this communication is strictly prohibited. If you
have received this communication in error, please notify the sender and
erase this e-mail message immediately.

 

From: Rabab Gomaa [mailto:Rabab.Gomaa@inspection.gc.ca] 
Sent: April-11-13 7:52 AM
To: Jonathan Avila; 'WAI Interest Group list'
Subject: Re: Validation errors in "Techniques for providing useful text
alternatives" page

 

My doctype is well defined. The code below can be used to see the role and
figcaption errors on W3C validation service http://validator.w3.org .

 

Notice the <p> before the figcaption is causing the second error; the figure
element does not allow "flow content" followed by "one figcaption" then
"flow content". 

However, sometimes there is information like this <p> in the code below
related to the figure. Other example can be <p> about the source of the
figure data OR hint to click on image to enlarge.  Do you think it ok to add
such information in the figcaption? 

It doesn't seem to me a figcaption (by definition in HTML 5 - caption or
legend for the rest of the contents...) for the figure.

 

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>test</title>
</head>
<body>
<figure role="group">
<p>Note: The data presented is based relative to the size.</p>
<figcaption>The Regulation of Plants</figcaption>
<img src="images/pntchae.gif" alt="Flowchart - The Regulation of Plants.
Details in text following the image"
width="450" height="358">
<details>
<summary>Description for image</summary>
<p>Here you put the long description content</p>
</details>
</figure>
</body>
</html>



>>> Jonathan Avila <jon.avila@ssbbartgroup.com> 4/10/2013 8:43 pm >>>

Did you define the doctyoe as HTML indicating HTML5?  Those sound like a
doctyoe declaration issue. 

 

Jon


On Apr 10, 2013, at 7:58 PM, "Rabab Gomaa" <Rabab.Gomaa@inspection.gc.ca>
wrote:

Hello, 

 

I used some techniques from "Techniques for providing useful text
alternatives" page however the W3C validation service shows the following
errors: 

 

- Error 1: Attribute role not allowed on element figure at this point.

<figure role="group">

-- Role is a solution to provide a programmatically determinable
relationship between the image and its description until:
http://www.w3.org/TR/html-alt-techniques/#haee

Also upon the page http://www.w3.org/TR/wai-aria/roles#group Authors SHOULD
use a group to form logical collection of items in a widget
<http://www.w3.org/TR/wai-aria/terms#def_widget>  such as children in a tree
widget forming a collection of siblings in a hierarchy, or a collection of
items having the same container in a directory. 

Is role supported or not for the figure element?

 

- Error 2: Element p not allowed as child of element figure in this context.
(Suppressing further errors from this subtree.)

<figure role="group">

<img src="webcam1.jpg" alt="Sopwith house weather cam.">
<figcaption>View from the top of Sopwith house </figcaption>
<p>This image is updated every hour.</p>
</figure>

-- Sometimes there is a note <p> or table and it is not always usable to
have them all with the image before or after the <figcaption> 

so what to do? A similar example exists on
http://www.w3.org/TR/html-alt-techniques/#hbh

 

Thank you,

Rabab
Received on Thursday, 11 April 2013 14:13:21 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 13 October 2015 16:21:48 UTC