From 8500fd8005a8b35b25d0638f5065e821adb78e70 Mon Sep 17 00:00:00 2001 From: Daniel Kinzler Date: Fri, 13 Nov 2009 21:58:39 +0000 Subject: [PATCH] add a version attribute to the tag if RDFa is used with HTML5 --- includes/DefaultSettings.php | 6 ++++++ includes/OutputPage.php | 6 ++++-- includes/Setup.php | 7 +++++++ includes/SkinTemplate.php | 3 ++- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index d7b3a7ccc4..80b9a89da7 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -914,6 +914,12 @@ $wgXhtmlDefaultNamespace = 'http://www.w3.org/1999/xhtml'; */ $wgHtml5 = true; +/** + * Defines the value of the version attribute in the <html> tag, if any. + * Will be initialized later if not set explicitly. + */ +$wgHtml5Version = null; + /** * Enabled RDFa attributes for use in wikitext. */ diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 47e785d7ca..de43865db9 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -1769,7 +1769,7 @@ class OutputPage { */ public function headElement( Skin $sk, $includeStyle = true ) { global $wgDocType, $wgDTD, $wgContLanguageCode, $wgOutputEncoding, $wgMimeType; - global $wgXhtmlDefaultNamespace, $wgXhtmlNamespaces; + global $wgXhtmlDefaultNamespace, $wgXhtmlNamespaces, $wgHtml5Version; global $wgContLang, $wgUseTrackbacks, $wgStyleVersion, $wgEnableScriptLoader, $wgHtml5; $this->addMeta( "http:Content-Type", "$wgMimeType; charset={$wgOutputEncoding}" ); @@ -1792,7 +1792,9 @@ class OutputPage { if ( $wgHtml5 ) { $ret .= "\n"; - $ret .= "\n"; + $ret .= "\n"; $ret .= "setRef( 'xhtmldefaultnamespace', $wgXhtmlDefaultNamespace ); $tpl->set( 'xhtmlnamespaces', $wgXhtmlNamespaces ); + $tpl->set( 'html5version', $wgHtml5Version ); $tpl->set( 'headlinks', $out->getHeadLinks() ); $tpl->set( 'csslinks', $out->buildCssLinks() ); -- 2.20.1