html5 workshop, part 1

66
HTML5 The Open Web, and what it means for you

Upload: robert-nyman

Post on 29-Aug-2014

3.101 views

Category:

Technology


6 download

DESCRIPTION

Workshop given at Jfokus 2012

TRANSCRIPT

Page 1: HTML5 workshop, part 1

HTML5The Open Web,

and what it means for you

Page 2: HTML5 workshop, part 1
Page 3: HTML5 workshop, part 1
Page 4: HTML5 workshop, part 1

Mozilla is a global non-profit dedicated to putting you in control of your online experience and shaping the future of the Web for the public good

Page 6: HTML5 workshop, part 1
Page 7: HTML5 workshop, part 1

"Very emotional. But I don't like it."

Page 9: HTML5 workshop, part 1

What is HTML5?

Page 11: HTML5 workshop, part 1

must die!!!Not really

Page 12: HTML5 workshop, part 1

HTML5 semantics

Page 13: HTML5 workshop, part 1
Page 14: HTML5 workshop, part 1

<!DOCTYPE html>

Page 16: HTML5 workshop, part 1

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

Page 17: HTML5 workshop, part 1

<meta charset="utf-8">

Page 18: HTML5 workshop, part 1

<header>

<article>

<section>

<footer>

<aside>

<nav>

<figure>

<figcaption>

Page 19: HTML5 workshop, part 1
Page 20: HTML5 workshop, part 1

<!DOCTYPE html><html><head> <meta charset="utf-8"> <title>HTML5 example with new elements and WAI-ARIA landmark roles - robertnyman.com</title> <link rel="stylesheet" href="css/base.css" type="text/css" media="screen"> <!--[if lte IE 8]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--></head>

<body id="index-page"> <div id="container"> <header role="banner"> <h1>HTML5 example <a href="http://robertnyman.com/html5">- To: Information and samples for HTML5 and related APIs</a></h1> <p>This page has valid simple HTML5 markup with new elements complemented with WAI-ARIA landmark roles for accessibility</p> </header> <div id="demo-main" role="main"> <article id="demo-main-content"> <header> <hgroup> <h2>A title</h2> <h3>Subtitle to the above title</h3> </hgroup> </header> <section> <p>Some content, created <time datetime="2009-10-14">October 14th 2009</time></p> </section> <section> <p>Some more content - I guess you get the drift by now</p> </section> </article> <aside id="demo-aside-content" role="complementary"> This is just a demo page to see HTML5 markup and WAI-ARIA landmark roles in action in a simple context </aside> </div> <footer id="page-footer" role="contentinfo"> Created by <a href="http://robertnyman.com/">Robert Nyman</a> </footer> </div> </body></html>

Page 21: HTML5 workshop, part 1

<!DOCTYPE html><html><head> <meta charset="utf-8"> <title>HTML5 example with new elements and WAI-ARIA landmark roles - robertnyman.com</title> <link rel="stylesheet" href="css/base.css" type="text/css" media="screen"> <!--[if lte IE 8]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--></head>

Page 22: HTML5 workshop, part 1

<header role="banner"> <h1>HTML5 example <a href="http://robertnyman.com/html5">- To: Information and samples for HTML5 and related APIs</a></h1> <p>This page has valid simple HTML5 markup with new elements complemented with WAI-ARIA landmark roles for accessibility</p></header>

Page 23: HTML5 workshop, part 1

<div id="demo-main" role="main"> <article id="demo-main-content"> <header> <hgroup> <h2>A title</h2> <h3>Subtitle to the above title</h3> </hgroup> </header> <section> <p>Some content, created <time datetime="2009-10-14">October 14th 2009</time></p> </section> <section> <p>Some more content - I guess you get the drift by now</p> </section> </article> <aside id="demo-aside-content" role="complementary"> This is just a demo page to see HTML5 markup and WAI-ARIA landmark roles in action in a simple context </aside></div>

Page 24: HTML5 workshop, part 1

<footer id="page-footer" role="contentinfo"> Created by <a href="http://robertnyman.com/">Robert Nyman</a></footer>

Page 25: HTML5 workshop, part 1

<figure> <img src="elephant.jpg" alt="A close up of an elephant"> <figcaption>A mighty big elephant, and mighty close too!</figcaption></figure>

Page 26: HTML5 workshop, part 1
Page 27: HTML5 workshop, part 1

JAWS version 10 screen reader

NVDA 2010.1

VoiceOver on iPhone IOS4

Page 28: HTML5 workshop, part 1

<aside aria-live="polite" aria-relevant="additions" aria-atomic="true"> Some sidebar content

</aside>

Page 29: HTML5 workshop, part 1

WAI-ARIA Authoring Practices 1.0

Live Regions

-

http://www.w3.org/WAI/PF/aria-practices/#LiveRegions

Page 31: HTML5 workshop, part 1

<p data-type="police" data-value="I am da law!"> An element with custom data attributes</p>

Page 34: HTML5 workshop, part 1

<video controls src="nasa.webm"></video>

Page 35: HTML5 workshop, part 1

<video controls> <source src="nasa.mp4"></source> <source src="nasa.webm"></source> <p>Hello, older web browser</p></video>

Page 37: HTML5 workshop, part 1

<video src="http://vid.ly/4w2g7d?content=video" controls></video>

Page 43: HTML5 workshop, part 1

<canvas id="my-canvas" width="500" height="500"> I am canvas</canvas>

Page 46: HTML5 workshop, part 1

SVG

Page 47: HTML5 workshop, part 1

<svg xmlns="http://www.w3.org/2000/svg" width="200" height="110" version="1.1" > <circle cx="100" cy="52" r="50" stroke="#0000ff" stroke-width="1" fill="#ff0000" /></svg>

Page 48: HTML5 workshop, part 1
Page 49: HTML5 workshop, part 1

<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">

<svg xmlns="http://www.w3.org/2000/svg" width="200" height="110" version="1.1" > <circle cx="100" cy="52" r="50" stroke="#0000ff" stroke-width="1" fill="#ff0000" /></svg>

Page 50: HTML5 workshop, part 1

var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg"), circle = document.createElementNS("http://www.w3.org/2000/svg", "circle");svg.setAttribute("width", "200");svg.setAttribute("height", "110");svg.setAttribute("version", "1.1");

circle.setAttribute("cx", "100");circle.setAttribute("cy", "52");circle.setAttribute("r", "50");circle.setAttribute("fill", "#ff0000");circle.setAttribute("stroke", "#00ffff");svg.appendChild(circle);document.getElementById("svg-container").appendChild(svg);

Page 51: HTML5 workshop, part 1

Raphaël JavaScript Library

-

SVG and VML

Page 52: HTML5 workshop, part 1

var paper = Raphael(document.getElementById("raphael-demo"), 320, 200), circle = paper.circle(150, 62, 60);circle.attr("fill", "#ff0000");circle.attr("stroke", "#00ffff");

Page 54: HTML5 workshop, part 1
Page 55: HTML5 workshop, part 1
Page 59: HTML5 workshop, part 1

Can I use it?

Page 61: HTML5 workshop, part 1

http://caniuse.com

Page 63: HTML5 workshop, part 1
Page 65: HTML5 workshop, part 1

HTML5 -

The beauty of the Open Web