[whatwg] <comment> and <ad> elements

Jukka K. Korpela jkorpela at cs.tut.fi
Sun Sep 4 13:45:05 PDT 2011

4.9.2011 23:27, Odin wrote:

> We already have a comment tag. It's listed in the article-element
> section of the spec. Article within article is suggested to be a
> comment:

Suggested, not defined.

>> When article elements are nested, the inner article elements represent
>> articles that are in principle related to the contents of the outer article.

That's the definition of the meaning of nesting article elements: "in 
principle related to".

>> For instance, a blog entry on a site that accepts user-submitted
>> comments could represent the comments as article elements nested
>> within the article element for the blog entry.

That's an example. "Could represent".

If we assume that authors use elements as per the spec as currently 
worded, you _cannot_ decide that an article inside an article is a 
comment. Just as it might be. It could be anything "in principle related 
to" the contents of the outer article.

Besides, while many principal entries in a blog are relatively 
self-contained and might be suitable for syndication, I don't think most 
blog _comments_ share that property. A comment is _typically_ strongly 
dependent on the context and seldom suitable for syndication. So making 
authors and systems use <article> for blog comments would be bad for the 
very idea of <article>.

If we think that comments need markup of their own, then I guess 
<comment> would be OK, on the grounds already presented, and the natural 
way to create useful semantic associations would be to allow (and 
recommend) <comment> elements to have an attribute, say for=..., that 
refers (by id) to the element that it comments on - maybe with the added 
semantics that if the referred element is a link (<a href>), then the 
comment is about the linked resource, not the link as such.

This would make it possible to marku up some content as a comment to 
some _external_ document too, such as a different page in the same 
system, in a discussion forum view where each entry is displayed as a 
separate HTML document, just linked to others in the thread.

And in the rare cases where a comment constitutes syndicatable content, 
it could of course contain an <article> element.

Yucca, http://www.cs.tut.fi/~jkorpela/

More information about the whatwg mailing list