1 The `html5` option was added in 2010 and marked as "not experimental" in 2011
2 but is not the default.
4 According to <http://caniuse.com/#feat=html5semantic>, current versions of
5 all recent versions of all major browsers - even IE (9+) - support the HTML5
6 semantic elements (`<section>` etc.), except for `<main>` which IkiWiki
7 doesn't use anyway. However, IE 8 is not a current version, but has ~ 4%
8 market share and doesn't support `<section>` and friends; so there's still
9 a compatibility concern there.
11 In particular, non-HTML5 mode uses `<!DOCTYPE html PUBLIC
12 "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">`
13 which doesn't allow newer markup like the `role` attribute, so we can't close
14 [[todo/add_aria_landmarks_to_make_ikiwiki_websites_more_accessible]] while
15 remaining XHTML 1.0 Strict. The recommended pseudo-doctype for HTML5, and for
16 HTML with ARIA markup, is `<!DOCTYPE html>`.
18 (I do think we should continue to use `<xml-compatible-tags />` and output
19 well-formed XML so people who want to do XSLT tricks with IkiWiki's output
22 In practice, real browsers have never actually implemented a strict XHTML mode:
23 they've always parsed `text/html` as "tag soup", because they need a tag-soup
24 parser anyway, and nobody wants to maintain two parsers.
26 Kai also wants a HTML5 doctype for [[bugs/more mobile friendly default themes]].
30 * set html5 to 1 by default but retain the dual-mode templates,
31 breaking IE 8 by default
33 * remove the option and always behave as if it had been 1, simplifying
34 the templates and breaking IE 8 unconditionally
36 * either of the above and include
37 [html5shiv](https://code.google.com/p/html5shiv/) to de-break IE 8
39 * change the doctype to `<!DOCTYPE html>`
40 unconditionally, stop trying to limit ourselves to XHTML 1.0 Strict
41 (use HTML5 features that degrade gracefully, like
42 [[ARIA roles|todo/add aria landmarks to make ikiwiki websites more accessible]]),
43 but avoid using the new elements like `<section>` that require specific
44 browser support unless `html5` is set to 1. That would get rid of the
45 backwards-compatibility concerns while keeping the ability to use
46 post-2000 markup; we can use `html5` to mean "be more enthusiastic about
47 HTML5 features even if they might fail on older browsers".
49 Using the HTML5 doctype does mean we lose the ability to validate the output
50 against a DTD (as `wdg-html-validator` does), but DTDs have very little to
51 do with practical browser compatibility in any case.
53 [[!template id=gitbranch branch=smcv/ready/html5
54 author="[[Simon McVittie|smcv]]"
55 browse=http://git.pseudorandom.co.uk/smcv/ikiwiki.git/shortlog/refs/heads/ready/html5]]
56 [[!tag patch users/smcv/ready]]
58 At the moment my preferred option is the last, for which see my `ready/html5`
59 branch. I'll apply this at some point if there are no objections.
63 > [[merged|done]] --[[smcv]]