Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.569
diff -u -p -r1.569 theme.inc
--- includes/theme.inc	13 Jan 2010 05:40:03 -0000	1.569
+++ includes/theme.inc	13 Jan 2010 17:48:46 -0000
@@ -2180,10 +2180,19 @@ function template_preprocess(&$variables
   $variables['id'] = $count[$hook]++;
 
   // Tell all templates where they are located.
-  $variables['directory'] = path_to_theme();
+  // Functions located anywhere other than in theme.inc should call
+  // path_to_theme() to get the theme path, instead of accessing the global
+  // variable directly. However, because this function resides within theme.inc,
+  // and therefore can be easily updated if the implementation of
+  // path_to_theme() changes, and because this function is called very often,
+  // we cheat in order to save the overhead of an extra function call.
+  global $theme_path;
+  $variables['directory'] = $theme_path;
 
   // Initialize html class attribute for the current hook.
-  $variables['classes_array'] = array(drupal_html_class($hook));
+  // drupal_html_class() is too slow, and we can assume that $hook is already
+  // lowercase, and has '_' as the only non-alphanumeric character.
+  $variables['classes_array'] = array(strtr($hook, '_', '-'));
 
   // Merge in variables that don't depend on hook and don't change during a
   // single page request.
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.836
diff -u -p -r1.836 comment.module
--- modules/comment/comment.module	13 Jan 2010 14:25:59 -0000	1.836
+++ modules/comment/comment.module	13 Jan 2010 17:48:46 -0000
@@ -890,33 +890,6 @@ function comment_build_content($comment,
   entity_prepare_view('comment', array($comment->cid => $comment));
   $comment->content += field_attach_view('comment', $comment, $view_mode);
 
-  // Prior to Drupal 7, the comment body was a simple text variable, but with
-  // Drupal 7, it has been upgraded to a field. However, using theme('field') to
-  // render the comment body results in a noticeable performance degradation for
-  // pages with many comments. By unsetting #theme, we avoid the overhead of
-  // theme('field') and instead settle for simply rendering the formatted field
-  // value that exists as a child element of the 'comment_body' render array,
-  // which results in equivalent markup and rendering speed as if the comment
-  // body had not been upgraded to a field. Modules that require the comment
-  // body to be rendered as a full field (and are willing to accept the
-  // corresponding performance impact) can restore #theme to 'field' within a
-  // hook_comment_view() or hook_comment_view_alter() implementation.
-  // @todo Bypassing theme('field') is not ideal, because:
-  //   - The field label is not displayed, even if its setting is to be
-  //     displayed.
-  //   - hook_preprocess_field() functions do not run, and therefore, attributes
-  //     added in those functions (for example, for RDF) are not output.
-  //   - The HTML markup that's within field.tpl.php is not output, so theme
-  //     developers must use different CSS rules for the comment body than for
-  //     all other fields.
-  //   The goal is for theme('field') to be sufficiently optimized prior to
-  //   Drupal 7 release, so that this code can be removed, and the comment body
-  //   can be rendered just like all other fields. Otherwise, another solution
-  //   to the above problems will be needed. @see http://drupal.org/node/659788.
-  if (isset($comment->content['comment_body']['#theme']) && ($comment->content['comment_body']['#theme'] === 'field')) {
-    unset($comment->content['comment_body']['#theme']);
-  }
-
   if (empty($comment->in_preview)) {
     $comment->content['links']['comment'] = array(
       '#theme' => 'links__comment',
@@ -2509,7 +2482,7 @@ function comment_rdf_mapping() {
       'type' => 'comment',
       'bundle' => RDF_DEFAULT_BUNDLE,
       'mapping' => array(
-        'rdftype' => array('sioc:Post'),
+        'rdftype' => array('sioc:Post', 'sioct:Comment'),
         'title' => array(
           'predicates' => array('dc:title'),
         ),
@@ -2523,7 +2496,7 @@ function comment_rdf_mapping() {
           'datatype' => 'xsd:dateTime',
           'callback' => 'date_iso8601',
         ),
-        'body' => array(
+        'comment_body' => array(
           'predicates' => array('content:encoded'),
         ),
         'pid' => array(
Index: modules/comment/comment.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.test,v
retrieving revision 1.63
diff -u -p -r1.63 comment.test
--- modules/comment/comment.test	11 Jan 2010 16:25:16 -0000	1.63
+++ modules/comment/comment.test	13 Jan 2010 17:48:46 -0000
@@ -1149,10 +1149,10 @@ class CommentRdfaTestCase extends Commen
     // Tests comment #2 as anonymous user.
     $this->_testBasicCommentRdfaMarkup($comment2, $anonymous_user);
     // Tests the RDFa markup for the homepage (specific to anonymous comments).
-    $comment_homepage = $this->xpath("//div[@typeof='sioc:Post']//span[@rel='sioc:has_creator']/a[contains(@class, 'username') and @typeof='sioc:User' and @property='foaf:name' and @href='http://example.org/' and contains(@rel, 'foaf:page')]");
+    $comment_homepage = $this->xpath("//div[contains(@class, 'comment') and contains(@typeof, 'sioct:Comment')]//span[@rel='sioc:has_creator']/a[contains(@class, 'username') and @typeof='sioc:User' and @property='foaf:name' and @href='http://example.org/' and contains(@rel, 'foaf:page')]");
     $this->assertTrue(!empty($comment_homepage), t('RDFa markup for the homepage of anonymous user found.'));
     // There should be no about attribute on anonymous comments.
-    $comment_homepage = $this->xpath("//div[@typeof='sioc:Post']//span[@rel='sioc:has_creator']/a[@about]");
+    $comment_homepage = $this->xpath("//div[contains(@class, 'comment') and contains(@typeof, 'sioct:Comment')]//span[@rel='sioc:has_creator']/a[@about]");
     $this->assertTrue(empty($comment_homepage), t('No about attribute is present on anonymous user comment.'));
 
     // Tests comment #2 as logged in user.
@@ -1160,10 +1160,10 @@ class CommentRdfaTestCase extends Commen
     $this->drupalGet('node/' . $this->node2->nid);
     $this->_testBasicCommentRdfaMarkup($comment2, $anonymous_user);
     // Tests the RDFa markup for the homepage (specific to anonymous comments).
-    $comment_homepage = $this->xpath("//div[@typeof='sioc:Post']//span[@rel='sioc:has_creator']/a[contains(@class, 'username') and @typeof='sioc:User' and @property='foaf:name' and @href='http://example.org/' and contains(@rel, 'foaf:page')]");
+    $comment_homepage = $this->xpath("//div[contains(@class, 'comment') and contains(@typeof, 'sioct:Comment')]//span[@rel='sioc:has_creator']/a[contains(@class, 'username') and @typeof='sioc:User' and @property='foaf:name' and @href='http://example.org/' and contains(@rel, 'foaf:page')]");
     $this->assertTrue(!empty($comment_homepage), t('RDFa markup for the homepage of anonymous user found.'));
     // There should be no about attribute on anonymous comments.
-    $comment_homepage = $this->xpath("//div[@typeof='sioc:Post']//span[@rel='sioc:has_creator']/a[@about]");
+    $comment_homepage = $this->xpath("//div[contains(@class, 'comment') and contains(@typeof, 'sioct:Comment')]//span[@rel='sioc:has_creator']/a[@about]");
     $this->assertTrue(empty($comment_homepage), t('No about attribute is present on anonymous user comment.'));
   }
 
@@ -1174,19 +1174,22 @@ class CommentRdfaTestCase extends Commen
    *
    * @param $comment
    *   Comment object.
-   * @param $acount
+   * @param $account
    *   An array containing information about an anonymous user.
    */
   function _testBasicCommentRdfaMarkup($comment, $account = array()) {
-    $comment_container = $this->xpath("//div[contains(@class, 'comment') and @typeof='sioc:Post']");
-    $this->assertTrue(!empty($comment_container));
-    $comment_title = $this->xpath("//div[@typeof='sioc:Post']//h3[@property='dc:title']");
-    $this->assertEqual((string)$comment_title[0]->a, $comment->subject);
-    $comment_date = $this->xpath("//div[@typeof='sioc:Post']//*[contains(@property, 'dc:date') and contains(@property, 'dc:created')]");
-    $this->assertTrue(!empty($comment_date));
+    $comment_container = $this->xpath("//div[contains(@class, 'comment') and contains(@typeof, 'sioct:Comment')]");
+    $this->assertTrue(!empty($comment_container), t('Comment RDF type for comment found.'));
+    $comment_title = $this->xpath("//div[contains(@class, 'comment') and contains(@typeof, 'sioct:Comment')]//h3[@property='dc:title']");
+    $this->assertEqual((string)$comment_title[0]->a, $comment->subject, t('RDFa markup for the comment title found.'));
+    $comment_date = $this->xpath("//div[contains(@class, 'comment') and contains(@typeof, 'sioct:Comment')]//*[contains(@property, 'dc:date') and contains(@property, 'dc:created')]");
+    $this->assertTrue(!empty($comment_date), t('RDFa markup for the date of the comment found.'));
     // The author tag can be either a or span
-    $comment_author = $this->xpath("//div[@typeof='sioc:Post']//span[@rel='sioc:has_creator']/*[contains(@class, 'username') and @typeof='sioc:User' and @property='foaf:name']");
+    $comment_author = $this->xpath("//div[contains(@class, 'comment') and contains(@typeof, 'sioct:Comment')]//span[@rel='sioc:has_creator']/*[contains(@class, 'username') and @typeof='sioc:User' and @property='foaf:name']");
     $name = empty($account['name']) ? $this->web_user->name : $account['name'] . ' (not verified)';
-    $this->assertEqual((string)$comment_author[0], $name);
+    $this->assertEqual((string)$comment_author[0], $name, t('RDFa markup for the comment author found.'));
+    $comment_body = $this->xpath("//div[contains(@class, 'comment') and contains(@typeof, 'sioct:Comment')]//div[@class='content']//div[contains(@class, 'field-item') and @property='content:encoded']");
+    //var_dump($comment_body);
+    $this->assertEqual((string)$comment_body[0]->p, $comment->comment, t('RDFa markup for the comment body found.'));
   }
 }
Index: modules/rdf/rdf.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/rdf/rdf.module,v
retrieving revision 1.18
diff -u -p -r1.18 rdf.module
--- modules/rdf/rdf.module	13 Jan 2010 05:00:25 -0000	1.18
+++ modules/rdf/rdf.module	13 Jan 2010 17:48:47 -0000
@@ -548,13 +548,6 @@ function rdf_preprocess_comment(&$variab
     $variables['title_attributes_array']['property'] = $comment->rdf_mapping['title']['predicates'];
     $variables['title_attributes_array']['datatype'] = '';
   }
-  if (!empty($comment->rdf_mapping['body'])) {
-    // We need a special case here since the comment body is not a field. Note
-    // that for that reason, fields attached to comment will be ignored by RDFa
-    // parsers since we set the property attribute here.
-    // @todo Use fields instead, see http://drupal.org/node/538164
-    $variables['content_attributes_array']['property'] = $comment->rdf_mapping['body']['predicates'];
-  }
 
   // Annotates the parent relationship between the current comment and the node
   // it belongs to. If available, the parent comment is also annotated.
