4. "there is already a lot of excitement for HTML5,
but it’s a little too early to deploy it because
we’re running into interoperability issues."
Philippe Le Hegaret, W3C interaction domain leader
blogs.techrepublic.com.com/hiner/?p=6369
12. “...extending the language to better support
Web applications [...] This puts HTML in
direct competition with other
technologies[...] , in particular Flash and
Silverlight.”
Ian Hickson, Editor of HTML5
http://lists.w3.org/Archives/Public/public-html/2009Jan/0215.html
15. HTML5 specification aimed
at browser developers
(defines how browsers handle markup/code – no reverse engineering)
for authors: HTML5 differences from HTML4
http://www.w3.org/TR/html5-diff/
27. Top 20 class names
1. footer 11. button
2. menu 12. main
3. style1 13. style3
4. msonormal 14. small
5. text 15. nav
6. content 16. clear
7. title 17. search
8. style2 18. style4
9. header 19. logo
10. copyright 20. body
http://devfiles.myopera.com/articles/572/classlist-url.htm
28. Top 20 id names
1. footer 11. search
2. content 12. nav
3. header 13. wrapper
4. logo 14. top
5. container 15. table2
6. main 16. layer2
7. table1 17. sidebar
8. menu 18. image1
9. layer1 19. banner
10. autonumber1 20. navigation
http://devfiles.myopera.com/articles/572/idlist-url.htm
32. current and old browsers “support” these
(although some need a little extra help)
header, footer, … { display: block; }
33. Internet Explorer needs extra training wheels
document.createElement('header');
document.createElement('footer');
…
http://html5doctor.com/how-to-get-html5-working-in-ie-and-firefox-2
37. type and attributes for built-in validation
(of course you should still validate on the server)
<input … required>
<input type=”tel”>
<input type=”email”>
<input type=”url”>
<input … pattern="[a-z]{3}[0-9]{3}">
65. canvas has standard API methods for drawing
ctx = canvas.getContext("2d");
ctx.fillRect(x, y, width, height);
ctx.beginPath();
ctx.moveTo(x, y);
ctx.lineTo(x, y);
ctx.bezierCurveTo(x1, y1, x2, y2, c1, c2);
66. canvas drawing ready-made images
ctx = canvas.getContext("2d");
var logo = new Image();
logo.src = 'logo.png';
ctx.drawImage(logo,x1,y1,w1,h1,x2,y2,w2,h2);
or call in an existing image already on the page
67. canvas access to image data array
ctx = canvas.getContext("2d");
canvasData = ctx.getImageData(x,y,w,h);
[R,G,B,A,R,G,B,A,R,G,B,A,R,G,B,A, … ]
68. canvas exporting image data as data:uri
ctx = canvas.getContext("2d");
…
canvas.toDataURL("image/png");
// returns "data:image/png;base64,…"
canvas.toDataURL("image/jpg");
// returns "data:image/jpeg;base64,…"
Note: do it on the canvas, not the context!
69. canvas also works with video
ctx = canvas.getContext("2d");
v = document.getElementById('player');
ctx.drawImage(v,x1,y1,w1,h2,x2,y2,w2,h2);
grab currently displayed frame (update as appropriate)
84. feature-detection for audio/video
if (!!document.createElement('video').canPlayType;) { … }
if (!!document.createElement('audio').canPlayType;) { … }
85. feature-detection for audio/video codecs
var v = document.createElement('video');
if (!!(v.canPlayType)&&
((v.canPlayType('video/webm;codecs="vp8,vorbis"') == 'probably')
||
(v.canPlayType('video/webm;codecs="vp8, vorbis"') == 'maybe')))
{ … }