enable hidden attribute
[ikiwiki] / doc / bugs / html5_support.mdwn
1 Some elements of
2 [HTML5](http://www.whatwg.org/specs/web-apps/current-work/multipage/) can be
3 safely supported by ikiwiki. There are [several differences between HTML4 and
4 HTML5](http://www.w3.org/TR/html5-diff/).
5
6 [[!template id=gitbranch branch=hendry/html5 author="[[Kai_Hendry|hendry]]"]]
7
8 * [HTML5 branch](http://git.webconverger.org/?p=ikiwiki;h=refs/heads/html5)
9 * [ikiwiki instance with HTML5 templates](http://natalian.org)
10 * [HTML5 outliner tool](http://gsnedders.html5.org/outliner/) -- to check you have the structure of your markup correct
11
12 > Kai, thanks enormously for working on this. I switched a page to 
13 > the html5 doctype today, and was rather pleasently suprised that it
14 > validated, except for the new Cache-Control meta tag. Now I see you're
15 > well ahead of me. --[[Joey]] 
16
17 > So, how should ikiwiki support html5? There are basically 3 approaches:
18
19 > 1. Allow users to add html5 tags to their existing xhtml pages.
20 >    What has been done so far, can be extended. Basically works 
21 >    in browsers, if you don't care about standards. A good prerequisite
22 >    for anything else, anyway.
23 > 2. Switch to html5 in eg, ikiwiki 4; users have to deal with
24 >    any custom markup on their pages/templates that breaks then.
25 > 3. Have both a html5 and a xhtml mode, allow user to select.
26 >
27 > The third option seems fairly tractable from what I see here and in 
28 > your branch. You made only relatively minor changes to 10 templates.
29 > It would probably not be too dreadful to put them in ifdefs.
30
31 > Some of your changes are obvious, like using the new `time` and
32 > and `article` elements. Others less so, and I'm particularly
33 > puzzled by these:
34
35 > * Removing the value="Submit" from the button on the 
36 >   commentmoderation form.
37 > * Removing feedlink.tmpl. What?!
38 > * Using a `h2` for the header of inlinepage.tmpl and page.tmpl, rather
39 >   than the styled span. Ikiwiki has
40 >   [[a_reason|todo/Option_to_make_title_an_h1?]] for not
41 >   using real `hN` for the header atop a page and here.
42 >   AFAICS, html5 does not invalidate that.
43 > * Removing Editurl from inlinepage.tmpl actions. I assume 
44 >   this is your own preference, needs to be removed from branch
45 >   before I can use it.
46 > * Removing the pageheader, content, and footer divs
47 >   which are all used by style.css.
48 >   Perhaps, the style sheet needs to be updated to use
49 >   the new elements, like the `footer` and `header`.
50 > * Removal of the favicon from page.tmpl. Surely html5 supports?
51 > * Removal of BASEURL from page.tmpl, apparently a mistake.
52 > * Removal of the `/` between wiki title and page title.
53 >   Personal preference.
54 > * Removal of `comments` div, which is there to be styled.
55 > * Why use a `p` rather than the `div` for `addcomments`?
56 > * Moving the action bar to the bottom of the page.
57 >   Personal preference.
58 > * Clearly searchquery.tmpl has no business using bad old `center`
59 >   tag, but something should still be done to replace it.
60
61 > (BTW, it would be helpful if you could re-merge master into your branch
62 > as it is a bit diverged now.) 
63
64 > Other ideas:
65
66 > * Add pubdate attribute to time elements as appropriate.
67 > * Use aside for the sidebar? Or for the [[templates/note]] template?
68 > * Use nav for the actionbar
69 > * Use placeholder in the search box. Allows closing
70 >   [[this_todo|Add_label_to_search_form_input_field]]
71 > * Use details tag instead of the javascript in the toggle plugin. 
72 >   (Need to wait on browser support probably.)
73 > --[[Joey]] 
74
75 # htmlscrubber.pm needs to not scrub new HTML5 elements
76
77 * [new elements](http://www.w3.org/TR/html5-diff/#new-elements)
78
79 > Many added now.
80 >
81 > Things I left out, too hard to understand today:
82 > Attributes contenteditable,
83 > data-\*, draggable, role, aria-\*.
84 > Tags command, keygen, output.
85
86 > Clearly unsafe: embed.
87
88 > Apparently cannot be used w/o javascript: menu.
89
90 > I have not added the new `ping` attribute, because parsing a
91 > space-separeated list of urls to avoid javascript injection is annoying, 
92 > and the attribute seems generally dubious.
93 >  --[[Joey]] 
94
95 # HTML5 Validation and t/html.t
96
97 [validator.nu](http://validator.nu/) is the authorative HTML5 validator,
98 however it is almost impossible to sanely introduce as a build dependency
99 because of its insane Java requirements. :( I test locally via
100 [cURL](http://wiki.whatwg.org/wiki/IDE), though Debian packages cannot be built
101 with a network dependency.
102
103 In the future, hopefully ikiwiki can test for valid HTML5 using [Relax NG
104 schema](http://syntax.whattf.org/) using a Debian package tool
105 [rnv](http://packages.qa.debian.org/r/rnv.html).
106
107 > Validation in the test suite is nice, but I am willing to lose those
108 > tests for a while. --[[Joey]] 
109
110 # HTML5 migration issues
111
112 # [article](http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#the-article-element) element
113
114 This element is poorly supported by browsers. As a workaround, `style.css` needs:
115
116         article {
117                 display: block;
118         }
119
120 Internet Explorer will display it as a block, though you can't seem to be able to further control the style.
121
122 ## Time element
123
124 The [time element](http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-time-element) ideally needs the datatime= attribute set by a template variable with what [HTML5 defines as a valid datetime string](http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#valid-global-date-and-time-string).
125
126 As a workaround:
127
128         au:~% grep timeformat natalian.setup
129         timeformat => '%Y-%m-%d',
130
131 > Also, the [[plugins/relativedate]] plugin needs to be updated to 
132 > support relatatizing the contents of time elements. --[[Joey]]