Top Banner
Prolog: HTML5 features that work in browsers now
64

Michael(tm) Smith: HTML5 at Web Directions South 2008

May 16, 2015

Download

Technology

HTML5 overview at Web Directions South 2008
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Michael(tm) Smith: HTML5 at Web Directions South 2008

Prolog:HTML5 features that work in browsers now

Page 2: Michael(tm) Smith: HTML5 at Web Directions South 2008

• canvas element: scriptable image

• video and audio elements: embed interactive video and audio easily, without plugins

• new form attributes & APIs, for client-side form validation & new native form widgets in browsers

Page 3: Michael(tm) Smith: HTML5 at Web Directions South 2008

• API for offline Web applications: ApplicationCache

• APIs for client-side data storage per-session (sessionStorage) and persistently across sessions (localStorage and client-side SQL database storage)

Page 4: Michael(tm) Smith: HTML5 at Web Directions South 2008

• postMessage() mechanism for cross-document messaging

• API for native drag-and-drop (without need for script library)

• native getElementsByClassName

• more...

Page 5: Michael(tm) Smith: HTML5 at Web Directions South 2008

December 1997

Page 6: Michael(tm) Smith: HTML5 at Web Directions South 2008

December 1997:HTML4 published as

W3C Recommendation

Page 7: Michael(tm) Smith: HTML5 at Web Directions South 2008

In other words...It’s been ten years since the last major update

to the HTML language.

Page 8: Michael(tm) Smith: HTML5 at Web Directions South 2008

So have we all just been sitting around on the

boat doing nothing for the last ten+ years?

Page 9: Michael(tm) Smith: HTML5 at Web Directions South 2008

Well, no...

Page 10: Michael(tm) Smith: HTML5 at Web Directions South 2008

Work on Web technologies at the

W3C was focusing on some other things...

Page 11: Michael(tm) Smith: HTML5 at Web Directions South 2008

XML, XML Schema, XForms, XHTML2...

Page 12: Michael(tm) Smith: HTML5 at Web Directions South 2008

XHTML 2.0 seems to me the live proof that something is going wrong

at W3C... I strongly suggest dropping all XHTML 2.0 efforts in

favor of a new “xHTML 5.0” language. Clearly a successor to

HTML 4, feature-oriented, made for the web.

Daniel Glazman, December 2002

Page 13: Michael(tm) Smith: HTML5 at Web Directions South 2008

Meanwhile, elsewhere...

Page 14: Michael(tm) Smith: HTML5 at Web Directions South 2008

September 2003:Opera CTO Håkon Lie first announces what

will become Web Forms 2.

Page 15: Michael(tm) Smith: HTML5 at Web Directions South 2008

Web Forms 2 represented the early beginnings of the work

that led to HTML5.

Page 16: Michael(tm) Smith: HTML5 at Web Directions South 2008

April 2004:Web Applications 1.0,

which eventually becomes HTML5.

Page 17: Michael(tm) Smith: HTML5 at Web Directions South 2008

June 2004:W3C workshop on Web applications, a turning point that

led to...

Page 18: Michael(tm) Smith: HTML5 at Web Directions South 2008

June 2004:WHATWG launched,

with Apple, Opera, Mozilla on board.

Page 19: Michael(tm) Smith: HTML5 at Web Directions South 2008

The dream of a new web, based on XHTML+SVG+SMIL+XForms, is just

that — a dream... The best way to help the Web is to incrementally

improve the existing web standards... so that web content authors can actually deploy new

formats interoperably.

Brendan Eich, June 2004

Page 20: Michael(tm) Smith: HTML5 at Web Directions South 2008

“HTML is the assemblylanguage of the Web.”

Page 21: Michael(tm) Smith: HTML5 at Web Directions South 2008

Web Forms 2,Web Applications 1.0... So who actually wrote

the drafts?

Page 22: Michael(tm) Smith: HTML5 at Web Directions South 2008

Ian “Hixie” Hickson

Page 23: Michael(tm) Smith: HTML5 at Web Directions South 2008

March 2007:W3C launches a new

HTML Working Group to work on HTML5.

Page 24: Michael(tm) Smith: HTML5 at Web Directions South 2008

Co-chairs:Dan Connolly, W3C

Chris Wilson, Microsoft

Page 26: Michael(tm) Smith: HTML5 at Web Directions South 2008

What’s the value proposition for the

HTML5 work?

Page 27: Michael(tm) Smith: HTML5 at Web Directions South 2008

HTML5 makes life easier and better for

Web developers.

Page 28: Michael(tm) Smith: HTML5 at Web Directions South 2008

How?

Page 29: Michael(tm) Smith: HTML5 at Web Directions South 2008

HTML5 increases interoperability, reduces need for UA sniffing & multiple code paths.

Page 30: Michael(tm) Smith: HTML5 at Web Directions South 2008

HTML5 provides better feature parity with proprietary single-

vendor stuff like Flash.

Page 31: Michael(tm) Smith: HTML5 at Web Directions South 2008

Frankly, HTML5 also provides new business opportunities for Web

professionals like yourselves.

Page 32: Michael(tm) Smith: HTML5 at Web Directions South 2008

So what exactly does “HTML5” consist of?

Page 33: Michael(tm) Smith: HTML5 at Web Directions South 2008

• The HTML5 spec itself

• Support for HTML5 features in 4 major browser engines and in other applications

• HTML5 parsing libraries

• validator.nu HTML5 validator

Page 34: Michael(tm) Smith: HTML5 at Web Directions South 2008

How many of you have read some part of the HTML5 spec in detail?

Page 35: Michael(tm) Smith: HTML5 at Web Directions South 2008

The HTML5spec itself...

Page 36: Michael(tm) Smith: HTML5 at Web Directions South 2008

A wee bit overloaded.

Page 37: Michael(tm) Smith: HTML5 at Web Directions South 2008

Focuses mostly on specifying conformance criteria for browsers.

Page 38: Michael(tm) Smith: HTML5 at Web Directions South 2008

Introduces manynew APIs.

Page 39: Michael(tm) Smith: HTML5 at Web Directions South 2008

But also conflates conformance criteria for HTML content

authors into same spec.

Page 40: Michael(tm) Smith: HTML5 at Web Directions South 2008

Would like to have a separate spec for just the HTML5 markup

language itself?

Page 41: Michael(tm) Smith: HTML5 at Web Directions South 2008

That is, a spec for the HTML5 markup

language without the APIs and browser spec?

Page 42: Michael(tm) Smith: HTML5 at Web Directions South 2008

The HTML5 draft provides a formal spec for HTML parsing and

error handling.

Page 43: Michael(tm) Smith: HTML5 at Web Directions South 2008

HTML is not XML.HTML is not SGML.

Page 44: Michael(tm) Smith: HTML5 at Web Directions South 2008

Most HTML content is not well-formed XML.

Page 45: Michael(tm) Smith: HTML5 at Web Directions South 2008

• 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">

Page 46: Michael(tm) Smith: HTML5 at Web Directions South 2008

More than 93% of Alexa Top 500 sites

are not valid.

Page 47: Michael(tm) Smith: HTML5 at Web Directions South 2008

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”.

http://www.whatwg.org/news/start

Page 48: Michael(tm) Smith: HTML5 at Web Directions South 2008

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”.

Ian Hickson, “Error handling and Web language design”, http://ln.hixie.ch/?start=1074730186

Page 49: Michael(tm) Smith: HTML5 at Web Directions South 2008

Don’t get hung up on syntax.

Page 50: Michael(tm) Smith: HTML5 at Web Directions South 2008

HTML5 defines HTML as an abstract language with two standard

syntaxes supported by browsers:

• a text/html syntax, with parsing rules defined by the HTML5 spec

• an XML syntax, with parsing rules defined by the XML spec

Page 51: Michael(tm) Smith: HTML5 at Web Directions South 2008

Similarly, applications can potentially represent HTML in memory in any

number of ways.

Page 52: Michael(tm) Smith: HTML5 at Web Directions South 2008

However, there’s only one standard in-memory representation supported

by browsers: The W3C DOM.

The HTML5 spec precisely defines the DOM representation that

browsers must use to represent HTML content in memory.

Page 53: Michael(tm) Smith: HTML5 at Web Directions South 2008

Simplify where we can.

Page 55: Michael(tm) Smith: HTML5 at Web Directions South 2008

<!DOCTYPE html>

Page 56: Michael(tm) Smith: HTML5 at Web Directions South 2008

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

Page 57: Michael(tm) Smith: HTML5 at Web Directions South 2008

<meta charset="utf-8">

Page 58: Michael(tm) Smith: HTML5 at Web Directions South 2008

• canvas element: scriptable image

• video and audio elements: embed interactive video and audio easily, without plugins

• new form attributes & APIs, for client-side form validation & new native form widgets in browsers

Page 59: Michael(tm) Smith: HTML5 at Web Directions South 2008

• API for offline Web applications: ApplicationCache

• APIs for client-side data storage per-session (sessionStorage) and persistently across sessions (localStorage and client-side SQL database storage)

Page 60: Michael(tm) Smith: HTML5 at Web Directions South 2008

• postMessage() mechanism for cross-document messaging

• API for native drag-and-drop (without need for script library)

• native getElementsByClassName

• more...

Page 61: Michael(tm) Smith: HTML5 at Web Directions South 2008

Demos:

http://www.whatwg.org/demos/2008-sept/

Page 62: Michael(tm) Smith: HTML5 at Web Directions South 2008

Somewhat related work outside of the core HTML5 effort...

Page 63: Michael(tm) Smith: HTML5 at Web Directions South 2008

• SVG in Opera, Mozilla, WebKit

• CSS transforms/animations

• CSS3 Selectors

• Selectors API

Page 64: Michael(tm) Smith: HTML5 at Web Directions South 2008

• XMLHttpRequest level 1 and 2

• Access Control for Cross-Site Requests

• native JSON support in browsers

• JavaScript 3.1 “Harmony”