[whatwg] <comment> element

Nikhilesh Jasuja nikhilesh at gmail.com
Tue Dec 13 20:37:43 PST 2011


Hi,

I wanted to see if WHATWG had had any discussions on a semantic element for
user-generated comments. It's an idea I wanted to propose myself. Found this
thread<http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-September/033083.html>that
Shaun Moss started and this
one<http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-December/029459.html>
exactly
1 year ago. Has there been further discussion on this after September 6?

My takeaway from these discussions has been:

   1. Semantically, user comments are indeed a different type of content.
   At least as much as <footer>, if not more so.
   2. IE < 9 treats <comment> as an HTML comment. So the new element will
   have to be called something else. <cmnt> was proposed.
   3. Two new elements may be required:
      1. to denote a single comment e.g. <cmnt>
      2. to denote a collection of comments, perhaps also including the
      chrome and widgets used for commenting e.g. <commentsarea>
   4. Use cases for the new element(s) include
      1. Users being able to hide comments and comment areas. (I'd like to t
      2. Easier syndication of both the comments and the parent <article>
      (because parent is now unencumbered/uncorrupted by user comments)
      3. A signal to search engines analogous to rel=nofollow ("Yes this
      content is on my website but I can't attest to its quality")
      4. Screen readers can navigate comments more easily..or skip them
      altogether
   5. The problems with using nested <article>s for comments are:
      1. A nested <article> does not necessarily mean a user-generated
      comment. So it's ambiguous.
      2. For threaded conversations, there would be a lot of nesting.
      Nesting in and of itself is not a bad thing but when trying to syndicate
      the original (parent) <article>, this becomes difficult. A <cmnt
      for="thearticle"> is more elegant.
      3. A webmaster may want to structure markup in a way that makes
      nesting difficult. e.g. <article id="thearticle">..</article><div
      class="advert">..</div><div
      id="relatedcontent">..</div><commentsarea><form><textarea>your opinions
      here</textarea><button>Submit</button></form><cmnt
      for="thearticle">BS!!</cmnt></commentsarea>. In such cases, forcing the
      comments to be nested <article>s would require unnecessary CSS
calisthenics
      to make it look right.
   6. Alternatives:
      1. Use <article type=comment>
      2. A new attribute "in-reply-to" can be used. e.g. <article
      id="themainarticle">Moms rock</article><article id="comment1"
      in-reply-to="themainarticle">you bet</article>
   7. More suggestions for the name of the elements:
      1. <usercomment>, <opinion>, <opin>, <publiccomment>, <ucomment> (U
      for user), <feedback>, <response>
      2. <commentsarea>, <opinionsarea>, <commentset>, <discussion>

What's the process for introducing new elements into the spec? It must be
non-trivial ..a new element is a pretty big deal. Do people discuss on the
mailing list, agree it must be done and then some people volunteer to write
the spec? I want to help (if the more knowledgeable minds in the group
agree these new elements are a good idea).

Nikhilesh Jasuja
---
www.diffen.com
Diffen. Discern. Decide.


More information about the whatwg mailing list