[whatwg] <comment> and <ad> elements
Shaun Moss
shaun at astromultimedia.com
Sun Sep 4 14:56:07 PDT 2011
Thanks, Jukka :)
I like your thinking about the possibility of a comment being about
another web page, or about an item on that web page. It could have 3
basic forms:
<comment for="#id"> to refer to an item on the same page, e.g. an
article or blog post.
<comment for="url"> to refer to another web page.
<comment for="url#id"> to refer to an item (article or similar) on
another web page.
With regard to the use of <article> for comments, the spec for article
doesn't fit user-submitted comments:
"The|article
<http://www.whatwg.org/specs/web-apps/current-work/multipage/sections.html#the-article-element>|elementrepresents
<http://www.whatwg.org/specs/web-apps/current-work/multipage/rendering.html#represents>a
self-contained composition in a document, page, application, or site and
that is, in principle, independently distributable or reusable, e.g. in
syndication. This could be a forum post, a magazine or newspaper
article, a blog entry, a user-submitted comment, an interactive widget
or gadget, or any other independent item of content."
User-submitted comments are not independently distributable or reusable,
e.g. in syndication. Neither, for that matter, are forum posts,
generally speaking, although the initial post may be equivalent to an
article. Forum posts would be better marked up with <comment>, since
they're user-contributed content.
"When|article
<http://www.whatwg.org/specs/web-apps/current-work/multipage/sections.html#the-article-element>|elements
are nested, the inner|article
<http://www.whatwg.org/specs/web-apps/current-work/multipage/sections.html#the-article-element>|elements
represent articles that are in principle related to the contents of the
outer article. For instance, a blog entry on a site that accepts
user-submitted comments could represent the comments as|article
<http://www.whatwg.org/specs/web-apps/current-work/multipage/sections.html#the-article-element>|elements
nested within the|article
<http://www.whatwg.org/specs/web-apps/current-work/multipage/sections.html#the-article-element>|element
for the blog entry."
This is a kludge because comments could be related to things other than
articles, and hence not appear nested in an <article> tag. Also, more
importantly: user-submitted comments aren't articles!
"Author information associated with an|article
<http://www.whatwg.org/specs/web-apps/current-work/multipage/sections.html#the-article-element>|element
(q.v. the|address
<http://www.whatwg.org/specs/web-apps/current-work/multipage/sections.html#the-address-element>|element)
does not apply to nested|article
<http://www.whatwg.org/specs/web-apps/current-work/multipage/sections.html#the-article-element>|elements."
Fair enough, but note that comments often contain author information,
i.e. the person who submitted the comment and when. Hence, if we insist
on using the semantically incongruous tag <address> for author
information, it should also be permissible inside <comment> elements.
Have a great day!
Shaun
On 2011-09-05 6:45 AM, Jukka K. Korpela wrote:
> 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.
>
More information about the whatwg
mailing list