Add placeholder text in search form (in html5 mode only).
[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. Have both a html5 and a xhtml mode, allow user to select.
24 > 3. Switch to html5 in eg, ikiwiki 4; users have to deal with
25 >    any custom markup on their pages/templates that breaks then.
26
27 > The second 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. I've made a
30 > small start at doing that.
31
32 > Some of your changes are obvious, like using the new `time` and
33 > and `article` elements. Others less so, and I'm particularly
34 > puzzled by these:
35
36 > * Removing the value="Submit" from the button on the 
37 >   commentmoderation form.
38 > * Removing feedlink.tmpl. What?!
39 > * Using a `h2` for the header of inlinepage.tmpl and page.tmpl, rather
40 >   than the styled span. Ikiwiki has
41 >   [[a_reason|todo/Option_to_make_title_an_h1?]] for not
42 >   using real `hN` for the header atop a page and here.
43 >   AFAICS, html5 does not invalidate that.
44 > * Removing Editurl from inlinepage.tmpl actions. I assume 
45 >   this is your own preference, needs to be removed from branch
46 >   before I can use it.
47 > * Removing the pageheader, content, and footer divs
48 >   which are all used by style.css.
49 >   Perhaps, the style sheet needs to be updated to use
50 >   the new elements, like the `footer` and `header`.
51 > * Removal of the favicon from page.tmpl. Surely html5 supports?
52 > * Removal of BASEURL from page.tmpl, apparently a mistake.
53 > * Removal of the `/` between wiki title and page title.
54 >   Personal preference.
55 > * Removal of `comments` div, which is there to be styled.
56 > * Why use a `p` rather than the `div` for `addcomments`?
57 > * Moving the action bar to the bottom of the page.
58 >   Personal preference.
59 > * Clearly searchquery.tmpl has no business using bad old `center`
60 >   tag, but something should still be done to replace it.
61
62 > (BTW, it would be helpful if you could re-merge master into your branch
63 > as it is a bit diverged now.) 
64
65 > Other ideas:
66
67 > * Use aside for the sidebar? Or for the [[templates/note]] template?
68 > * Use nav for the actionbar
69 > * Use details tag instead of the javascript in the toggle plugin. 
70 >   (Need to wait on browser support probably.)
71
72 > --[[Joey]] 
73
74 # htmlscrubber.pm needs to not scrub new HTML5 elements
75
76 * [new elements](http://www.w3.org/TR/html5-diff/#new-elements)
77
78 > Many added now.
79 >
80 > Things I left out, too hard to understand today:
81 > Attributes contenteditable,
82 > data-\*, draggable, role, aria-\*.
83 > Tags command, keygen, output.
84
85 > Clearly unsafe: embed.
86
87 > Apparently cannot be used w/o javascript: menu.
88
89 > I have not added the new `ping` attribute, because parsing a
90 > space-separeated list of urls to avoid javascript injection is annoying, 
91 > and the attribute seems generally dubious.
92 >  --[[Joey]] 
93
94 # HTML5 Validation and t/html.t
95
96 [validator.nu](http://validator.nu/) is the authorative HTML5 validator,
97 however it is almost impossible to sanely introduce as a build dependency
98 because of its insane Java requirements. :( I test locally via
99 [cURL](http://wiki.whatwg.org/wiki/IDE), though Debian packages cannot be built
100 with a network dependency.
101
102 In the future, hopefully ikiwiki can test for valid HTML5 using [Relax NG
103 schema](http://syntax.whattf.org/) using a Debian package tool
104 [rnv](http://packages.qa.debian.org/r/rnv.html).
105
106 > Validation in the test suite is nice, but I am willing to lose those
107 > tests for a while. --[[Joey]] 
108
109 # HTML5 migration issues
110
111 # [article](http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#the-article-element) element
112
113 This element is poorly supported by browsers. As a workaround, `style.css` needs:
114
115         article {
116                 display: block;
117         }
118
119 Internet Explorer will display it as a block, though you can't seem to be able to further control the style.
120
121 ## Time element
122
123 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).
124
125 As a workaround:
126
127         au:~% grep timeformat natalian.setup
128         timeformat => '%Y-%m-%d',
129
130 > Also, the [[plugins/relativedate]] plugin needs to be updated to 
131 > support relatatizing the contents of time elements. --[[Joey]] 
132
133 > Done and done; in html5 mode it uses the time tag, and even 
134 > adds pubdate when displaying ctimes. --[[Joey]]
135
136 ## tidy plugin
137
138 Will reformat html5 to html4.