Requests for comment/Drop XHTML 1.0
|Drop XHTML 1.0|
XHTML 1.x is practically dead (and XHTML 2 never had a foot to stand on), HTML5 is used by default in MediaWiki and it's enabled on Wikimedia wikis. XHTML 1.0 support in MediaWiki is basically a mode where MediaWiki outputs tag soup by ancient rules that don't even follow what browsers do, disables enhancements like search placeholders, and helpful form input types, disables optional support for RDFa or Microdata, won't parse markup used by editors like
<mark>, and disables
data-* support which is used by a number of MediaWiki features (mw-collapse, data-sort-value, jquery.localize, etc...) effectively disabling support for or limiting use of those features.
For those obsessed with the XML notion of XHTML we may as well slightly improve XHTML5 support in MediaWiki when a user sets
$wgMimeType to a mime type which HTML5 defines as triggering XHTML5. For the most part this will only be a change in the region where the DOCTYPE and opening <html> tag are output. As
$wgWellFormedXml already takes care of making sure output is well formed enough for XHTML.
$wgHtml5use throughout core can be removed as this variable will become irrelevant. Paths of code that only apply when false can be deleted.
$wgDTDwill become irrelevant and will be removed.
- There is no reason to modify the XHTML5 xmlns and hence
$wgXhtmlDefaultNamespacecan be removed.
- For posterity we might as well update
Html::isXmlMimeTypeto follow HTML5's rules and consider all +xml subtypes as XHTML instead of only
- For XHTML5 support we can tweak what we output when
Html::isXmlMimeType( $wgMimeType )is true:
- Output an
<?xml version="1.0" encoding="UTF-8" ?>.
- XHTML5 doesn't need a DOCTYPE so we might as well leave it out.
- Output a fixed
- Output an
- Implemented in Gerrit change 63106.