W3C home > Mailing lists > Public > public-wcag2ict-tf@w3.org > July 2012

Came across this in HTML 5 draft

From: Gregg Vanderheiden <gv@trace.wisc.edu>
Date: Thu, 19 Jul 2012 14:34:43 -0500
To: public-wcag2ict-tf@w3.org
Message-id: <77086BAB-DA89-4C43-BCA6-01C22047E833@trace.wisc.edu>
Interesting 

G







Authors are also encouraged to explicitly wrap sections in elements of sectioning content, instead of relying on the implicit sections generated by having multiple headings in one element of sectioning content.

For example, the following is correct:

<body>
   <h4>Apples</h4>
   <p>Apples are fruit.</p>
   <section>
      <h2>Taste</h2>
      <p>They taste lovely.</p>
      <h6>Sweet</h6>
      <p>Red apples are sweeter than green ones.</p>
      <h1>Color</h1>
      <p>Apples come in various colors.</p>
   </section>
</body>
However, the same document would be more clearly expressed as:

<body>
   <h1>Apples</h1>
   <p>Apples are fruit.</p>
   <section>
      <h2>Taste</h2>
      <p>They taste lovely.</p>
      <section>
         <h3>Sweet</h3>
         <p>Red apples are sweeter than green ones.</p>
      </section>
   </section>
   <section>
      <h2>Color</h2>
      <p>Apples come in various colors.</p>
   </section>
</body>
Both of the documents above are semantically identical and would produce the same outline in compliant user agents.

This third example is also semantically identical, and might be easier to maintain (e.g. if sections are often moved around in editing):

<body>
   <h1>Apples</h1>
   <p>Apples are fruit.</p>
   <section>
     <h1>Taste</h1>
     <p>They taste lovely.</p>
     <section>
        <h1>Sweet</h1>
        <p>Red apples are sweeter than green ones.</p>
     </section>
   </section>
   <section>
     <h1>Color</h1>
     <p>Apples come in various colors.</p>
   </section>
</body>
This final example would need explicit style rules to be rendered well in legacy browsers. Legacy browsers without CSS support would render all the headings as top-level headings.





Gregg
--------------------------------------------------------
Gregg Vanderheiden Ph.D.
Director Trace R&D Center
Professor Industrial & Systems Engineering
and Biomedical Engineering
University of Wisconsin-Madison

Co-Director, Raising the Floor - International
and the Global Public Inclusive Infrastructure Project
http://Raisingthefloor.org   ---   http://GPII.net











Received on Thursday, 19 July 2012 19:35:13 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 19 July 2012 19:35:14 GMT