From e7ac6347ac3184290f9045610935aae090120ac6 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sun, 6 Dec 2009 18:35:14 +0000 Subject: [PATCH] #493030 follow-up by scor and effulgentsia: Add rdf-meta class to empty spans to help identify their purpose. --- modules/rdf/rdf.module | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/modules/rdf/rdf.module b/modules/rdf/rdf.module index fcde0effebf..2da297a1d94 100644 --- a/modules/rdf/rdf.module +++ b/modules/rdf/rdf.module @@ -637,8 +637,8 @@ function theme_rdf_template_variable_wrapper($variables) { * Sometimes it is useful to export data which is not semantically present in * the HTML output. For example, a hierarchy of comments is visible for a human * but not for machines because this hiearchy is not present in the DOM tree. - * We can express it in RDFa via empty span tags. These won't be visible and - * will give machines extra information about the content and its structure. + * We can express it in RDFa via empty span tags. These aren't visible and give + * machines extra information about the content and its structure. * * @param $variables * An associative array containing: @@ -647,13 +647,7 @@ function theme_rdf_template_variable_wrapper($variables) { * element. * * @return - * A string of HTML containing markup that can be understood by an RDF parser. - * - * Tip for themers: while this default implementation results in valid markup - * for the XHTML+RDFa doctype, you may need to override this in your theme to be - * valid for doctypes that don't support empty spans. Or, if empty spans create - * visual problems in your theme, you may want to override this to set a - * class on them, and apply a CSS rule of display:none for that class. + * A string of HTML containing markup that can be understood by RDFa parsers. * * @see rdf_process() * @@ -662,7 +656,14 @@ function theme_rdf_template_variable_wrapper($variables) { function theme_rdf_metadata($variables) { $output = ''; foreach ($variables['metadata'] as $attributes) { - $output .= ''; + // Add a class, so developers viewing html source have a reference for why + // there are empty spans in the document. Also can be used to set a CSS + // display:none rule in a theme where empty spans affect display. + $attributes['class'][] = 'rdf-meta'; + // XHTML+RDFa doctype allows either or , but for + // maximum browser compatibility, W3C recommends the former when serving + // pages using the text/html media type: http://www.w3.org/TR/xhtml1/#C_3. + $output .= ''; } return $output; }