*/
$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.
*/
*/
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}" );
if ( $wgHtml5 ) {
$ret .= "<!DOCTYPE html>\n";
- $ret .= "<html lang=\"$wgContLanguageCode\" dir=\"$dir\">\n";
+ $ret .= "<html lang=\"$wgContLanguageCode\" dir=\"$dir\" ";
+ if ($wgHtml5Version) $ret .= " version=\"$wgHtml5Version\" ";
+ $ret .= ">\n";
} else {
$ret .= "<!DOCTYPE html PUBLIC \"$wgDocType\" \"$wgDTD\">\n";
$ret .= "<html xmlns=\"{$wgXhtmlDefaultNamespace}\" ";
$wgHiddenPrefs[] = 'skin';
}
+if ( !$wgHtml5Version && $wgHtml5 && $wgAllowRdfaAttributes ) {
+ # see http://www.w3.org/TR/rdfa-in-html/#document-conformance
+ if ( $wgMimeType == 'application/xhtml+xml' ) $wgHtml5Version = 'XHTML+RDFa 1.0';
+ else $wgHtml5Version = 'HTML+RDFa 1.0';
+}
+
+
wfProfileOut( $fname.'-misc1' );
wfProfileIn( $fname.'-memcached' );
global $wgArticle, $wgUser, $wgLang, $wgContLang;
global $wgScript, $wgStylePath, $wgContLanguageCode;
global $wgMimeType, $wgJsMimeType, $wgOutputEncoding, $wgRequest;
- global $wgXhtmlDefaultNamespace, $wgXhtmlNamespaces;
+ global $wgXhtmlDefaultNamespace, $wgXhtmlNamespaces, $wgHtml5Version;
global $wgDisableCounters, $wgLogo, $wgHideInterlanguageLinks;
global $wgMaxCredits, $wgShowCreditsIfMax;
global $wgPageShowWatchingUsers;
$tpl->setRef( 'xhtmldefaultnamespace', $wgXhtmlDefaultNamespace );
$tpl->set( 'xhtmlnamespaces', $wgXhtmlNamespaces );
+ $tpl->set( 'html5version', $wgHtml5Version );
$tpl->set( 'headlinks', $out->getHeadLinks() );
$tpl->set( 'csslinks', $out->buildCssLinks() );