Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg...

56
Introduction to HTML5

Transcript of Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg...

Page 1: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

Introductionto HTML5

Page 3: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

I work for the W3Cin Japan, based

at Keio Universitynear Tokyo

Page 4: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

My official W3C title is: Special Missions

Subsection Junior Interim Floor Manager

Page 5: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

Where to start learning about HTML5?

Page 6: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

HTML5 differences from HTML4

http://w3.org/TR/html5-diff/

Page 7: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

Tutorials andhow-to guidance

Page 8: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

Dive into HTML5

http://diveintohtml5.org/

Page 9: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

The HTML5 Doctors

http://html5doctor.com/

Page 10: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

Alternative authoring references

Page 13: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

HTML5 differences

•Syntax simplifications

•MathML and SVG integration

•New elements/attributes added

• Removed old elements/attributes

• Added new APIs for scripting

Page 14: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

Syntax simplifications

Page 16: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

<!doctype html>

Page 17: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

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

Page 18: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

<meta charset="Shift_JIS">

Page 19: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

New elements

•<video> & <audio> (no plugins)

• <canvas> (scriptable image)

• <ruby> (annotations)

• <article>, <section>, <header>

•<details>, <progress>, more...

Page 20: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

New attributes• draggable (drag-and-drop)

• contenteditable (editable pages)

• spellcheck (catch spelling errors)

• new form attributes (for client- side validation, plus new form controls such as date picker, etc.)

Page 21: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

Elements and attributes removed or obsoleted

•<frame>, <frameset>

•<a name>

•more...

Page 22: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

New APIs for scripting

•API for <video> & <audio>

• 2D drawing API for <canvas>

• getElementsByClassName()

• innerHTML

•more...

Page 23: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

HTML design principles

http://w3.org/TR/html-design-principles/

Page 24: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

HTML design principles

• Support existing content

• Ensure interoperability

• Precisely define UA behavior

•Handle errors (non-draconian)

• Evolution not revolution

Page 25: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

Important point:HTML5 includes XHTML

Page 26: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

Frequently Asked Questions (FAQ) about the future of XHTML

http://w3.org/2009/06/xhtml-faq.html

Page 27: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

About error handling...

Page 28: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

• Well-formed XML: <input disabled="disabled"/> • Empty attribute: <input disabled> • Without quotes: <input value=yes> • Single quotes: <input type='checkbox'/> • Double quotes: <input name="be evil"/>

Which of these are errors?

Page 29: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

<i><b>misnested tags</i></b>

This is a real error

Page 30: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

HTML5 defines how browsers can handle real errors interoperably and

gracefully.

Page 31: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

Why is it important to handle errors?

Page 32: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

More than 93% of Alexa Top 500 sites

contain are not conformant XHTML

Page 33: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

We need to specify error handling behavior to ensure

interoperability “even in the face of documents that do not comply to the letter of the specifications”.

Page 34: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

Authors will write invalid content regardless of what we spec. So the spec states “what authors must not do, and then tells implementors what they

must do when an author does it anyway”.

Page 35: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

HTML5 Validator

http://validator.nu

Page 36: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

The Open Web Platform.

Page 37: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

Formats:HTML, CSS, SVG,

ARIA, even JavaScript

Page 38: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

The server side can be considered a black box.

Page 39: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

The open Web platform also includes APIs.

Page 40: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

Device-independent,language-independent

APIs.

Page 41: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

APIs that browsers expose to Web

applicationson the client-side

Page 42: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

Open Web Platform=

formats + APIs

(formats=HTML, CSS, SVG, etc.)

Page 43: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

HTML5:The Web platform as an

application development/runtime environment

Page 44: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

Other app-dev environments:iPhone SDK, Android

SDK, J2ME/MIDP, BREW, Symbian,Flash

Page 45: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

APIs spun off HTML5

• Canvas 2D Context API

• (Canvas 3D API: WebGL*)

• Web Storage API

• Indexed Database API (non-SQL)

Page 46: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

APIs spun off HTML5

• Web Workers API

• Web Messaging APIs (cross-doc/postmg + channel messaging)

• WebSocket API + Protocol; & Server-Sent Events

Page 47: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

Formats related to HTML5

• Microdata + Microdata API & RDFa + RDFa API

• WAI-ARIA1.0 (add accessibility to Web apps)

Page 48: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

APIs spun off HTML5

• Canvas 2D Context API

• Canvas 3D API: WebGL *

• Web Storage API

• Indexed Database API (non-SQL)

Page 49: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

Other APIs

•Geolocation

•Device Orientation + Compass

•File API (w/ HTML5 Drag & Drop)

Page 50: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

Other APIs

•Selectors API

•DOM Level 3 Events

•DOM4 + Element Traversal

Page 51: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

Other APIs

•XMLHttpRequest 1.0 & 2.0

•Cross-Origin Resource Sharing

Page 52: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

HTML5, CSS3, etc., feature detection

http://modernizr.com/

Page 53: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

HTML5 milestones 2010

• We aim to have HTML5 start Last Call (LC) in 2010

•To start Last Call:

• spec is feature complete

• all HTML WG issues resolved

Page 54: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

HTML5 milestones 2010

•To get to end of Last Call:

•collect comments from community

•respond to all comments

Page 55: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

That’s it.

Page 56: Introduction to HTML5APIs spun off HTML5 •Web Workers API •Web Messaging APIs (cross-doc/ postmg + channel messaging) •WebSocket API + Protocol; & Server-Sent Events.

Thank you.