This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 17963 - img elements with role="presentation" and without alt="" fail validation
Summary: img elements with role="presentation" and without alt="" fail validation
Status: RESOLVED WORKSFORME
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-18 07:24 UTC by contributor
Modified: 2012-07-23 04:30 UTC (History)
4 users (show)

See Also:


Attachments

Description contributor 2012-07-18 07:24:25 UTC
This was was cloned from bug 17629 as part of operation convergence.
Originally filed: 2012-06-28 10:26:00 +0000
Original reporter: Ian Yang <ian.html@gmail.com>

================================================================================
 #0   Ian Yang                                        2012-06-28 10:26:41 +0000 
--------------------------------------------------------------------------------
On the Presentation Role section of W3C ARIA Authoring Practices (
http://www.w3.org/WAI/PF/aria-practices/#presentation_role ), it states that
img elements can be validly without alt="" if they have role="presentation".
However, W3C markup validator currently treats that as invalid.

Is that because of one of the following reasons?

* The statement conflicts with HTML5 spec
* The statement is true and HTML5 spec has not been updated
* The markup validator has a bug
================================================================================
 #1   steve faulkner                                  2012-06-28 10:54:19 +0000 
--------------------------------------------------------------------------------
its the first:
* The statement conflicts with HTML5 spec

In HTML5 the only conforming instance where an img element can be without an alt attribute is if the img is contained with a figure element which has a non empty figcaption
http://dev.w3.org/html5/spec/the-img-element.html#guidance-for-conformance-checkers

<figure>
<img>
<figcaption>caption text</figcaption>
</figure>

note: conformance checkers are also currently allowed to suppress missing alt errors for pages that include a meta name=generator, but this is under review:
http://lists.w3.org/Archives/Public/public-html/2012Jun/0137.html
================================================================================
 #2   Ian Yang                                        2012-06-28 11:06:41 +0000 
--------------------------------------------------------------------------------
Hi Steve,

Thanks! Is W3C currently accept suggestions for such cases? If so, I would like to make a suggestion to add one more conforming instance where an img element can be without an alt attribute if the img's ARIA role is "presentation" (role="presentation").

Thanks,
Ian
================================================================================
 #3   steve faulkner                                  2012-06-28 11:25:45 +0000 
--------------------------------------------------------------------------------
Hi Ian, 

The idea has been dicusssed previously and rejected as the conformance requirements hor HTML5 should not be based on external specifications. 
You can of course refloat the idea
================================================================================
 #4   Ian Yang                                        2012-06-28 11:30:04 +0000 
--------------------------------------------------------------------------------
Hi Steve,

Thanks a lot. Since it has been discussed before, I will not refloat it.

Regards,
Ian
================================================================================
Comment 1 Ian 'Hixie' Hickson 2012-07-20 05:15:58 UTC
If you have a presentational image, then the only sensible value of the alt="" attribute is the empty string. The empty string _means_ "it's presentational, don't show it to the AT", exactly the same as role=presentation. So instead of saying role=presentation, do alt="". (You can do both, if you want to, but there's not much point.)
Comment 2 Ian Yang 2012-07-23 04:30:46 UTC
Thanks Hickson for the info that "empty alt value means the image is presentational and shouldn't be shown to the AT".