29/04/2011

HTML 5 – Part I Introduction, structure and semantics

Laura Farinetti Dipartimento di Automatica e Informatica Politecnico di Torino [email protected]

1

HTML 5  HTML5 is the next major revision of the HTML standard, currently under development ◦ Working Draft, April 5th 2011  Work on the specifications started in June 2004  Currently being carried out in a joint effort between the W3C HTML WG and the WHATWG (Hypertext Application Technology Working Group )  Not jet standard (until 2022?), but parts are going to be implemented by browsers

2

1 29/04/2011

HTML 5

 “HTML5 will reach the Proposed Recommendation stage sometime in 2022.” ◦ , editor of the HTML5 specification  However, parts of specification are going to be implemented by browsers ◦ The latest versions of Safari, Chrome, , and support some HTML5 features ◦ Internet Explorer 9 supports some HTML5 features

3

Supported features

4

2 29/04/2011

The HTML5 test

 How well does your browser support HTML5? ◦ http://html5test.com/

Mozilla Firefox 3.6.13

Opera 11.0

5

The HTML5 test

 How well does your browser support HTML5? ◦ http://html5test.com/

Internet Explorer 8.0

6

3 29/04/2011

Rough timeline of web technologies

 1991 HTML  1994 HTML 2  1996 CSS 1 + JavaScript  1997 HTML 4  1998 CSS 2  2000 XHTML 1  2002 Tableless Web Design  2005 AJAX  2009 HTML 5

7

HTML 5

 HTML5 ~= HTML + CSS + JS API

8

4 29/04/2011

Rationale

 “This specification defines the 5th major revision of the core language of the : the Hypertext Markup Language (HTML). In this version, new features are introduced to help authors, new elements are introduced based on research into prevailing authoring practices, and special attention has been given to defining clear conformance criteria for user agents in an effort to improve interoperability. This specification is intended to replace (be a new version of) what was previously the HTML4, XHTML 1.0, and DOM2 HTML specifications.”  Specifications in A4 format: 690 pages (~War and Peace by Leo Tolstoy) 9

Hand-made code?

 NO  Use a framework/library... ◦ SproutCore http://www.sproutcore.com/ ◦ Modernizr http://www.modernizr.com/ ◦ HTML5 shiv http://html5shiv.googlecode.com ◦ ExplorerCanvas http://excanvas.sourceforge.net/ ◦ More to come…

10

5 29/04/2011

New features

 The for drawing  The video and audio elements for media playback  Better support for local offline storage  New content specific elements, like article, footer, header, nav, section  New form controls, like calendar, date, time, email, url, search

11

New elements

 HTML 4.01 obsolete or never used elements are deleted or re-written  New elements for better structure, drawing, media content, and better form handling are included, to better reflect today‟s internet use

12

6 29/04/2011

What‟s new in HTML5

13

What‟s new in HTML5

 Many pieces of the HTML5 effort (e.g. Local Storage, WebSocket, and Geolocation) were originally part of the HTML5 specification  Moved to a separate standards document to keep the specification focused  Industry still refers to the original set of features, including Web Sockets, as “HTML5”

14

7 29/04/2011

What‟s new in HTML5

 Doctype  Structural elements  Web forms

15

Doctype and less header code

HTML 4 Sample page css" type="text/css" />

HTML 5 Sample page 16

8 29/04/2011

New tags in HTML5

17

Removed tags in HTML5

18

9 29/04/2011

Structural elements

 Layout ◦