W3C home > Mailing lists > Public > whatwg@whatwg.org > January 2006

[whatwg] Presentational elements in Web Applications 1.0

From: Matthew Paul Thomas <mpt@myrealbox.com>
Date: Sun, 15 Jan 2006 01:39:29 +1300
Message-ID: <bad9bf6cf10ee0fe49aab004d5eed27c@myrealbox.com>
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/
Received on Saturday, 14 January 2006 04:39:29 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:25 UTC