E-mail List Archives

for

From: Benjamin Hawkes-Lewis
Date: Jun 16, 2009 12:40AM


On 15/6/09 20:16, Jared Smith wrote:
> Neither HTML nor WCAG prohibit empty headings (headings that contain
> no text)

Hmm. Not sure about that. Granted HTML 4.01 does not contain a direct
prohibition, but it does say "A heading element briefly describes the
topic of the section it introduces."

It seems to me an empty string isn't a "heading" and can't describe the
topic of section it introduces.

So I'd say "<h1></h1>" would be a valid, but not a conforming use.

(I don't think it's possible to enforce this conformance requirement
with a DTD and so make it a matter of validity. You probably could with
another schema language like Relax NG.)

Similarly, WCAG 2.0 says: "2.4.6 Headings and Labels: Headings and
labels describe topic or purpose. (Level AA)"

Again, an empty string doesn't describe topic or purpose, so I think it
fails that guideline, much as "Click here" fails the "Link Purpose"
guideline:

http://www.w3.org/TR/2008/NOTE-WCAG20-TECHS-20081211/F84

Interestingly, the current draft of HTML5 explicitly makes
non-whitespace text content descendants of heading elements a SHOULD
requirement:

*
http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements

*
http://www.whatwg.org/specs/web-apps/current-work/multipage/dom.html#phrasing-content-0

--
Benjamin Hawkes-Lewis