[Pmwiki-users] Heading Button and Semantic Structure / Accessibility

Patrick R. Michaud pmichaud
Tue Jan 11 09:18:28 CST 2005


On Tue, Jan 11, 2005 at 01:54:06AM -0700, H. Fox wrote:
> First:  The new graphical button bar is a fantastic feature!

Thanks!

> I notice that the Heading button generates a level 3 heading.  That 
> didn't seem right, so I did some searching on the subject of headings.

Well, I'll start by noting that I also don't entirely agree with
starting with a level 3 heading.  However, so far it seems the least
of the evils... read on

> It appears that starting with heading level 3 qualifies as "header 
> misuse" according to the w3C's /Web Content Accessibility Guidelines/.
> W3C> Do not use headings to create font effects. Instead, use CSS
> W3C> to change font styles. See CSS fonts for more information.

I agree, but I don't see the "!!!" as being used solely to create
a font effect -- in PmWiki it really does semantically mean "heading".

> The oversized, bold "A" on the heading button suggests that the button 
> has something to do with fonts.  (Admittedly I can't immediately think 
> of a better multi-lingual graphical representation of a heading.)

Join the club (which includes me).  Everyone I've shared the button bar
with has said that the oversized "A" doesn't indicate heading, and they've
also said they can't come up with anything better.  Believe me, as soon
as we come up with a better image (multi-lingual or not) I'll change it.


> Would it be better for the button to generate a single-bang (H1) 
> heading?  If so, the stylesheet could use CSS to present H1 headings a 
> at a non-ugly size.  This would encourage using headings to denote a 
> section's importance rather than to create font effects.
> [...]
> At the risk of piling on, I'll point out that the XHTML 2.0 
> specification (Working Draft) also says "The practice of skipping 
> heading levels is considered to be bad practice."

While the 2.0 specification says that the practice of skipping
heading levels (in the sense of going from <h1> to <h3>, or <h2> to <h4>) 
is bad practice, it doesn't really say anywhere that one cannot
start at a lower level, although that could be reasonably inferred.

However, all of this just brings up another of my beefs about W3C's
recommendations -- they recommend how things ought to work semantically,
but then code up the actual standards such that they do the wrong
thing by default.  In this instance, they say (or imply) that headers
should always be <h1> before <h2>, <h2> before <h3>, etc., but they've
also defined the default size of <h1> elements as being 2em, which is
a really bad default for headings inside a page.  It makes more sense
for this size to be used as the page's *title* at the top of the page.  
In fact, this is what PmWiki used to do -- it used <h1> for page titles 
and then <h2>, <h3>, etc. could be used inside of pages.

Indeed, in looking at

> http://www.w3.org/TR/xhtml2/mod-structural.html#sec_8.5.

I notice that W3C does exactly the same thing -- they use <h1>
exactly once at the top of the page for the page's title, and all 
of the headings within the page are <h2> or lower.  

> [...] but it seems like the heading 
> button should encourage WikiUsers to use H1 first, then the other 
> heading levels in order.

Indeed, this goes against what Tim Berners-Lee is reported to have said:

    Always use heading levels in order, with *one* heading level 1
    at the top of the document, and if necessary several level 2 headings,
    and then if necessary several level 3 headings under each level 2
    heading. 
       - http://www-sul.stanford.edu/tools/tutorials/html2.0/devicein.html

and in 

> WebAIM.org: Semantic Structure
> http://www.webaim.org/techniques/structure/#correctly

it also says 

    Pages should be structured in a hierarchical manner, with 1st 
    degree headings (H1) being the most important (usually page titles 
    or heading) ...

and this particular theme (<h1> as page title) is reprised throughout
much of the mailing list discussion of the WAI group.  

All of this indicates to me that wiki authors should almost never be using
'!' (<h1>) in the wiki markup, and should start sections with '!!' (<h2>)
or something lower.  

Certainly "author-friendliness" dictates that we should make the GUI 
buttons correspond with what the author will use or need most often.  
Given that W3C themselves tend to use <h2> within pages far more often
than <h1>, I think there's a good case to be made that having the gui
button default to <h3> (or maybe <h2>) is in fact the correct thing for 
PmWiki to do, especially if a skin decides it wants to use <h1> and <h2> for
page titles (also considered good practice) rather than the headings 
within a page.

Pm

P.S.:  From a very practical perspective -- while we could try to "fix" 
the default CSS stylings for <h1>, <h2>, etc., into something more reasonable,
I think that doing so assumes we know exactly how headings will always
be applied, and it certainly would break a lot of existing sites
and expectations.  




More information about the pmwiki-users mailing list