[whatwg] article/section/details naming/definition problems

Jeremy Keith jeremy at adactio.com
Wed Sep 16 07:27:18 PDT 2009

So after a lot of chat on IRC [1], here's what I've been able to  
establish about <section> and <article>:

* An <article> is a specialised kind of <section>.
* All <article>s are <section>s but not all <section>s are <article>s  
(in the same way that all <acronym>s are <abbr>s but not all <abbr>s  
are <acronym>s).
* A <section> is a chunk of related content whereas an <article> is an  
*independent* chunk of related content.
* The interpretation of what qualifies as "independent" varies widely.

Some use cases are very clear. Blog posts, for example, are clearly  
independent sections.

Other use cases are less clear. Various guidelines were proposed to  
try to figure out when a section is independent e.g. would it have a  
permalink? or would you distribute it? but these weren't robust enough.

Here are some ambiguous use cases:

An FAQ question and answer:
This content stands alone. It is independent. It has a header. It has  
a permalink.
But some people rejected using <article> for this case because the  
content wouldn't be syndicated (even though syndication is a suggested  
*guideline* not a *criteria* for using <article>).

A author bio:
This content stands alone. It is independent. It can be reused or even  
distributed (for example, if the person were speaking at conferences).
Currently it uses <section>. Should it be an <article>?

A widget.
Although the spec specifically mentions widgets that can be reused, I  
haven't been able to find any use cases of this yet. I don't that  
<article> is an element name that readily springs to mind for  
developers publishing widgets.

A blog comment.
The spec specifically recommends using <article> for blog comments but  
this would seem to violate the criteria of independence. Blog comments  
don't make sense outside of the context of their blog post.  
Nonetheless, blog comments are often syndicated in a feed. But, as  
already stated, syndication alone is not enough of a reason to use  
<article> — the content must be independent.

Hixie outlined three reasons for having a separate <article> element:

> replacing <div class="post"> so that you don't need to use classes  
> for marking up blog posts
> enabling trivial conversion of html to atom for syndication
> and making it easier to navigate a page that has multiple articles  
> when using accessibility tools

The third use case is already solved with <section>.

The second use case can be handled with an attribute on <section> or  
simply by looking for the presence of a <time> element with a @pubdate  
attribute within a <section>.

The first use case is a valid point but as Hixie himself said when  
discussing <cite>:

> Why not
> <color> for marking up colours, <price> for marking up prices,
> <mortgagerate> for marking up mortgage rates, <postaladdress> for
> addresses, <boardgame> for names of board games, <vat> for the cost of
> sales tax in advertising...

Throwing in a new element (<article>) when there is an existing  
element that shares 99% of its DNA (<section>) seems like overkill.

Further discussion on IRC showed a belief that authors would find it  
easier to style an element such as <article> (using the CSS element  
selector) than an element with an attribute  such as <section  
article=""> (using the CSS attribute selector) or a class such as  
<section class="article"> (using the CSS class selector).

I understand that concern, but then how are authors supposed to style  
blog comments differently from a blog post? After all, they're both  
supposed to use the same element: <article>.

After all that discussion, my conclusions are:

* <section> and <article> are so similar, I'm not convinced that two  
separate elements are needed.
* If <article> stays, there needs to be a good testable criteria to  
determine when a <section> should be an <article>.
* The current recommendation to mark up blog comments using the  
<article> element contradicts the criteria of independence.
* The use case of marking up application widgets with <article>  
stretches the definition and makes it hard to come up with a good  
criteria for <article>.

In short, if you're writing a blog, it's completely clear when you  
should use <article> (although blog comments aren't nearly as clear- 
cut as the spec would suggest). If you are writing any other kind of  
content, it is very hard to tell when to use <article> and when to use  

Changing the name of the <article> element wouldn't really solve  
anything, as far as I can tell. All the discussion around suggested  
name changes have revolved around blog posts ...the one use case that  
is unambiguous.

[1] http://krijnhoetmer.nl/irc-logs/whatwg/20090916
Jeremy Keith

a d a c t i o


More information about the whatwg mailing list