#1 - html5 overview

49
Tecniche di animazione digitale I

Upload: iloveigloo

Post on 15-Jan-2015

516 views

Category:

Technology


0 download

DESCRIPTION

- How "internet" works - HTML5 overview - Browser support - Tools - Shims and Polyfills - Semantic tags

TRANSCRIPT

Page 1: #1 - HTML5 Overview

Tecniche di animazionedigitale I

Page 3: #1 - HTML5 Overview

Basic 1November 21, 2012

Page 4: #1 - HTML5 Overview

How "internet" works

HTML5 overview

Browser support

Tools

Shims and Polyfills

Semantic tags

Agenda

Basic / Agenda

4

7

23

30

35

42

5

Page 5: #1 - HTML5 Overview

How "internet" works

Page 6: #1 - HTML5 Overview

Basic / HTML5 overview

How "internet" works

6

Page 7: #1 - HTML5 Overview

HTML5 overview

Page 8: #1 - HTML5 Overview

Basic / HTML5 overview

HyperText Markup Language is the core

technology of the World Wide Web.

With HTML, authors describe the structure of

Web pages using markup tags.

Introduction

8

Page 9: #1 - HTML5 Overview

• Web applications oriented.

• Improves interoperability.

• Adds syntactic and semantic

features.

Basic / HTML5 overview

9

Introduction

Page 10: #1 - HTML5 Overview

History

Basic / HTML5 overview

10

Page 11: #1 - HTML5 Overview

• 2004 WHATWG is born (with members fro Apple, the Mozilla

Foundation and Opera Software).• 2007 W3C announces it will work with WHATWG.

• 2008 First version of HTML5 is published.

• 2008 Firefox 3 becomes HTML5 compatible.

• 2010 Youtube offers HTML5 video player.

• 2010 Steve Jobs "trashes" Flash in an open letter.

History

Basic / HTML5 overview

11

Page 12: #1 - HTML5 Overview

• 2012 Candidate recommendation.

• 2013 Last call for review.

• 2014 Recommendation.

Future

Basic / HTML5 overview

12

Page 13: #1 - HTML5 Overview

<!DOCTYPE html>

HTML 5

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

HTML 4.01

Doctype

Features

Basic / HTML5 overview

13

Page 14: #1 - HTML5 Overview

<header>

<nav>

<section>

<article>

<aside>

<footer>

Basic / HTML5 overview

14

Features

Semantic tags

Page 15: #1 - HTML5 Overview

<video>

<audio>

Media elements

Features

Basic / HTML5 overview

15

Page 18: #1 - HTML5 Overview

Input types

Features

• color

• date

• datetime

• datetime-local

• email

• month

• number

• range

• search

• tel

• time

• url

• week

Form validation

3Basic / HTML5 overview

18

Page 20: #1 - HTML5 Overview

• LocalStorage

• Appcache

Features

Offline applications

Basic / HTML5 overview

20

Page 21: #1 - HTML5 Overview

var exampleSocket = new WebSocket("ws://www.example.com/socketserver", "protocolOne"); exampleSocket.onopen = function (event) { exampleSocket.send("Here's some text that the server is urgently awaiting!"); };

Features

Basic / HTML5 overview

21

Web Sockets

Page 22: #1 - HTML5 Overview

Samples

• http://www.apple.com/html5

• http://www.youtube.com/html5

• https://developers.facebook.com/html5

Basic / HTML5 overview

22

Page 23: #1 - HTML5 Overview

Browser support

Page 24: #1 - HTML5 Overview

Browser compatibility

The ability of a Web browser to effectively

display the HTML code and execute the scripts

on Web pages.

Introduction

Basic / Browser support

24

Page 26: #1 - HTML5 Overview

Today

StatCounter

Basic / Browser support

26

Page 27: #1 - HTML5 Overview

HTML5 Support

HTML5 & CSS3 Support

Basic / Browser support

27

Page 28: #1 - HTML5 Overview

Samples

• http://browsershots.org

• https://browserlab.adobe.com

• http://www.browserstack.com

Basic / Browser support

28

Page 29: #1 - HTML5 Overview

15 MINUTI DI PAUSA

Page 30: #1 - HTML5 Overview

Tools

Page 31: #1 - HTML5 Overview

Compatibility tables for support of HTML5,

CSS3, SVG and more in desktop and mobile

browsers.

http://caniuse.com

Can I Use

Basic / Tools

31

Page 33: #1 - HTML5 Overview

Modernizr is a JavaScript library that detects

HTML5 and CSS3 features in the user’sbrowser.

http://modernizr.com/

Modernizr

Basic / Tools

33

Page 34: #1 - HTML5 Overview

if (Modernizr.localstorage) { // window.localStorage is available! } else { // no native support for local storage :( // maybe try Gears or another third-party solution }

Usage

Samples

Modernizr.addTest('localstorage', function() { var mod = 'modernizr'; try { localStorage.setItem(mod, mod); localStorage.removeItem(mod); return true; } catch(e) { return false; } });

Implementation

Basic / Tools

34

Page 35: #1 - HTML5 Overview

Shims and polyfills

Page 36: #1 - HTML5 Overview

A shim is a library that brings a new API to an

older environment, using only the means of that

environment.

Shims

Basic / Shims and polyfills

36

Page 37: #1 - HTML5 Overview

<!--[if lt IE 9]> <script src="dist/html5shiv.js"></script> <![endif]-->

HTML5Shiv

Samples

Basic / Shims and polyfills

37

Page 38: #1 - HTML5 Overview

A polyfill is a piece of code (or plugin) that

provides the technology that you, the

developer, expect the browser to provide

natively. Flattening the API landscape if you

will.

Polyfills

Basic / Tools

38

Page 39: #1 - HTML5 Overview

Samples

Basic / Tools

39

• http://lea.verou.me/polyfills/progress/

Page 40: #1 - HTML5 Overview

Yepnope is an asynchronous conditional

resource loader that's super-fast, and allows

you to load only the scripts that your users

need.

Yeponope

Basic / Tools

40

Page 41: #1 - HTML5 Overview

yepnope({ test : Modernizr.geolocation, yep : 'normal.js', nope : ['polyfill.js', 'wrapper.js'] });

Samples

Basic / Shims and polyfills

41

Page 42: #1 - HTML5 Overview

Semantic tags

Page 43: #1 - HTML5 Overview

The article element represents a self-contained

composition in a document, page, application,

or site and that is, in principle, independently

distributable or reusable, e.g. in syndication.

This could be a forum post, a magazine or

newspaper article, a blog entry, a usersubmitted

comment, an interactive widget or

gadget, or any other independent item of

content.

<article>

Basic / Semantic tags

43

Page 44: #1 - HTML5 Overview

The section element represents a generic

section of a document or application.

A section, in this context, is a thematic grouping

of content, typically with a heading.

<section>

Basic / Semantic tags

44

Page 45: #1 - HTML5 Overview

The nav element represents a section of a

page that links to other pages or to parts within

the page: a section with navigation links.

<nav>

Basic / Semantic tags

45

Page 46: #1 - HTML5 Overview

The aside element represents a section of a

page that consists of content that is tangentially

related to the content around the aside

element, and which could be considered

separate from that content.

Such sections are often represented as

sidebars in printed typography.

<aside>

Basic / Semantic tags

46

Page 47: #1 - HTML5 Overview

The header element represents a group of

introductory or navigational aids.

<header>

Basic / Semantic tags

47

Page 48: #1 - HTML5 Overview

The footer element represents a footer for its

nearest ancestor sectioning content or

sectioning root element.

A footer typically contains information about its

section such as who wrote it, links to related

documents, copyright data, and the like.

<footer>

Basic / Semantic tags

48