Index: trunk/phase3/includes/Setup.php |
— | — | @@ -230,6 +230,13 @@ |
231 | 231 | $wgHiddenPrefs[] = 'skin'; |
232 | 232 | } |
233 | 233 | |
| 234 | +if ( !$wgHtml5Version && $wgHtml5 && $wgAllowRdfaAttributes ) { |
| 235 | + # see http://www.w3.org/TR/rdfa-in-html/#document-conformance |
| 236 | + if ( $wgMimeType == 'application/xhtml+xml' ) $wgHtml5Version = 'XHTML+RDFa 1.0'; |
| 237 | + else $wgHtml5Version = 'HTML+RDFa 1.0'; |
| 238 | +} |
| 239 | + |
| 240 | + |
234 | 241 | wfProfileOut( $fname.'-misc1' ); |
235 | 242 | wfProfileIn( $fname.'-memcached' ); |
236 | 243 | |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -1769,7 +1769,7 @@ |
1770 | 1770 | */ |
1771 | 1771 | public function headElement( Skin $sk, $includeStyle = true ) { |
1772 | 1772 | global $wgDocType, $wgDTD, $wgContLanguageCode, $wgOutputEncoding, $wgMimeType; |
1773 | | - global $wgXhtmlDefaultNamespace, $wgXhtmlNamespaces; |
| 1773 | + global $wgXhtmlDefaultNamespace, $wgXhtmlNamespaces, $wgHtml5Version; |
1774 | 1774 | global $wgContLang, $wgUseTrackbacks, $wgStyleVersion, $wgEnableScriptLoader, $wgHtml5; |
1775 | 1775 | |
1776 | 1776 | $this->addMeta( "http:Content-Type", "$wgMimeType; charset={$wgOutputEncoding}" ); |
— | — | @@ -1792,7 +1792,9 @@ |
1793 | 1793 | |
1794 | 1794 | if ( $wgHtml5 ) { |
1795 | 1795 | $ret .= "<!DOCTYPE html>\n"; |
1796 | | - $ret .= "<html lang=\"$wgContLanguageCode\" dir=\"$dir\">\n"; |
| 1796 | + $ret .= "<html lang=\"$wgContLanguageCode\" dir=\"$dir\" "; |
| 1797 | + if ($wgHtml5Version) $ret .= " version=\"$wgHtml5Version\" "; |
| 1798 | + $ret .= ">\n"; |
1797 | 1799 | } else { |
1798 | 1800 | $ret .= "<!DOCTYPE html PUBLIC \"$wgDocType\" \"$wgDTD\">\n"; |
1799 | 1801 | $ret .= "<html xmlns=\"{$wgXhtmlDefaultNamespace}\" "; |
Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -129,7 +129,7 @@ |
130 | 130 | global $wgArticle, $wgUser, $wgLang, $wgContLang; |
131 | 131 | global $wgScript, $wgStylePath, $wgContLanguageCode; |
132 | 132 | global $wgMimeType, $wgJsMimeType, $wgOutputEncoding, $wgRequest; |
133 | | - global $wgXhtmlDefaultNamespace, $wgXhtmlNamespaces; |
| 133 | + global $wgXhtmlDefaultNamespace, $wgXhtmlNamespaces, $wgHtml5Version; |
134 | 134 | global $wgDisableCounters, $wgLogo, $wgHideInterlanguageLinks; |
135 | 135 | global $wgMaxCredits, $wgShowCreditsIfMax; |
136 | 136 | global $wgPageShowWatchingUsers; |
— | — | @@ -208,6 +208,7 @@ |
209 | 209 | |
210 | 210 | $tpl->setRef( 'xhtmldefaultnamespace', $wgXhtmlDefaultNamespace ); |
211 | 211 | $tpl->set( 'xhtmlnamespaces', $wgXhtmlNamespaces ); |
| 212 | + $tpl->set( 'html5version', $wgHtml5Version ); |
212 | 213 | $tpl->set( 'headlinks', $out->getHeadLinks() ); |
213 | 214 | $tpl->set( 'csslinks', $out->buildCssLinks() ); |
214 | 215 | |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -915,6 +915,12 @@ |
916 | 916 | $wgHtml5 = true; |
917 | 917 | |
918 | 918 | /** |
| 919 | + * Defines the value of the version attribute in the <html> tag, if any. |
| 920 | + * Will be initialized later if not set explicitly. |
| 921 | + */ |
| 922 | +$wgHtml5Version = null; |
| 923 | + |
| 924 | +/** |
919 | 925 | * Enabled RDFa attributes for use in wikitext. |
920 | 926 | */ |
921 | 927 | $wgAllowRdfaAttributes = true; |