[whatwg] Presentational elements in Web Applications 1.0

Matthew Paul Thomas mpt at myrealbox.com
Sat Jan 14 04:39:29 PST 2006


On 14 Jan, 2006, at 1:24 PM, Lachlan Hunt wrote:
>
> Eugene T.S. Wong wrote:
>>
>> I'd like to recommend that the WHATWG bring back <CENTER> because it 
>> provides an excellent way of saying "this is a centered <DIV>".  
>> <DIV> is no more semantic that <I>, <B>, or <CENTER>, yet they have 
>> their uses.
>
> No, center is presentational, div is not.

<div> is presentational: it means "present this as a block". That is 
what it will mean in HTML 5 documents as well, regardless of how it is 
eventually defined in the specification, because author momentum will 
be too great to usefully narrow its meaning. And that's okay: there is 
no evidence that any deity kills a kitten when someone uses <div>.

> Authors should not use presentational markup, regardless of how much 
> easier it seems.
> ...

Authors should use presentational markup whenever there is no available 
semantic markup for the relevant meaning, or when they are providing 
authoring facilities for people who cannot be expected to think about 
semantic markup (e.g. people using Webmail, or people posting comments 
on the author's Weblog). If authors -- or specifications -- try too 
hard to use a semantic element, or to force other people to use it, it 
will be misused so much that UAs can no longer trust the element to 
have any particular meaning, so it will become de facto presentational.

The semantics of an element come partly from its specification, and 
mostly from the people who use it. If the current definitions of 
elements in the Web Applications 1.0 draft remain as they are, and HTML 
5 becomes widely used, HTML 5 documents will feature nine 
presentational elements.

<div>
     This was defined in HTML 3.0 and 3.2 to mean about the same as
     <section> means in Web Applications 1.0, but was soon repurposed by
     Web authors for any block for which the author could not think of a
     better element. It will continue to be used that way in HTML 5,
     because even if replacement elements like <cartoonpanel>, <login>,
     <nav>, <order>, <search>, <sidebar>, <signup>, and <sudokupuzzle>
     were introduced in an attempt to narrow the use of <div>, authors
     would hardly ever bother using such specialized elements, since
     they'd get no benefit from doing so. (But <aside> and <menu> will
     reduce the use of <div> by a small amount, because they have
     distinct and useful default presentations.)

<dl>, <dt>, <dd>
     These elements were semantic until HTML 4.0, which belied their
     supposed meaning both in an example in the spec, and in the markup
     of the spec itself. They remain presentational in the current Web
     Applications 1.0 draft, because use for both "terms and
     definitions" and "name-value data" is still too broad to have a
     coherent meaning. (For example, from the markup alone, a search
     engine will not be able to tell whether "Ian Hickson, Google,
     ian at hixie.ch" is the answer to "Who is the editor of Web
     Applications 1.0?", or a definition of the word "editor" itself.)

<i>
     This has always been presentational, and will continue to be so in
     the majority of HTML 5 documents. Most authors will assume it has
     the same purpose as it did in previous versions of HTML; and many
     of the authors who actually read that part of the spec will giggle
     at the "instance of a term" frippery and disregard it.

<p>
     This has been semantic until now, meaning a paragraph. But the
     current Web Applications 1.0 draft pretends that the English word
     "paragraph" means something much broader than it really does, so
     broad that it will have no semantics at all. (For example, someone
     instructed to write a ten-paragraph essay will get incorrect
     results from a paragraph count if, as suggested by Web Apps 1.0,
     they use <p> for the essay's byline.) As a result, <p> will come to
     mean "present this as a block with extra vertical margins".

<section>
     This is semantic in the Web Apps 1.0 draft, but whether it remains
     so in the real world will depend on who is faster: UA vendors
     distributing software that prominently takes advantage of the
     structure <section> is supposed to provide, or eager tech Weblog
     authors misguidedly replacing all the occurrences of <div> with
     <section> in their templates in an attempt to be "more semantic".
     My money, regretfully, is on the Weblog authors.

<strong> or <b>
     If <b> is retained, it will remain a presentational element for
     making text bold ad hoc, regardless of how the spec defines it. If
     <b> is dropped, <strong> will become a de facto presentational
     element for making text bold ad hoc, regardless of how the spec
     defines it. (To a small extent this has already happened, thanks to
     those people who have given the impression that <b> is naughty.)

<style>
     This has always been presentational; it exists for no other reason
     than to specify presentation.

-- 
Matthew Paul Thomas
http://mpt.net.nz/




More information about the whatwg mailing list