Slide 1

Slide 1 text

HTML5, are we there yet? Jacksonvile Code Camp, 2012 Ovidiu Dimulescu @odimulescu speakerdeck.com/odimulescu

Slide 2

Slide 2 text

• What is HTML5 ? • Features • Polyfills and shims • Status • Resources • Questions ? Agenda

Slide 3

Slide 3 text

About @odimulescu • Working on the Web since 1997 • • Organizer for JaxMUG.com • Co-Organizer for Jax Big Data meetup

Slide 4

Slide 4 text

What is ?

Slide 5

Slide 5 text

HTML- A bit of history * Credit evolutionofweb.appspot.com

Slide 6

Slide 6 text

HTML- A bit of history * Credit evolutionofweb.appspot.com

Slide 7

Slide 7 text

* Credit evolutionofweb.appspot.com HTML- A bit of history

Slide 8

Slide 8 text

• W3C, WHATWG • HTML, DHTML, XHTML, Quirks mode • JSON, AJAX, Web Forms, Web Sockets, Web Workers • Navigation History State, CORS • DOM (Style, Events, HTML) • CSS, Media Queries, Web Fonts • Canvas, SVG, Audio, Video, WebGL • Local Storage, Offline Apps • HTML5 App, Single Page app HTML5- What is it?

Slide 9

Slide 9 text

An evolution of HTML4 • New DOM elements • New JavaScript APIs HTML5 is a “brand” • CSS3 • Additional Rich APIs • Umbrella term for cool web things HTML5 - What is it?

Slide 10

Slide 10 text

HTML5- Features

Slide 11

Slide 11 text

HTML5- Document Structure

Slide 12

Slide 12 text

HTML5 - Semantic Tags

Slide 13

Slide 13 text

HTML5 - Semantic Tags No DIV !? *Image Credit: indianlakes.wordpress.com

Slide 14

Slide 14 text

HTML5 - Semantic Tags Text *Credit: www.w3.org/wiki/HTML_structural_elements

Slide 15

Slide 15 text

HTML5 - Semantic Tags *Credit: www.w3.org/wiki/HTML_structural_elements

Slide 16

Slide 16 text

HTML5 - Semantic Tags *Credit: www.w3.org/wiki/HTML_structural_elements

Slide 17

Slide 17 text

HTML5 - Semantic Tags *Credit: www.w3.org/wiki/HTML_structural_elements

Slide 18

Slide 18 text

HTML5 - Semantic Tags Browser Support Modern Browser, IE9 + Problems with unknown tags 1. Default style inline + Styles not applied (oldIE) 2. DOM incorrect (oldIE) Workarounds 1. header, footer, nav, section { display: block} 2. document.createElement("article"); code.google.com/p/html5shim/

Slide 19

Slide 19 text

HTML5 - Forms New Input Types tel, url, email, number, range, color, search, datetime, date, month, week, time, datetime-local New Form and Input Type Attributes placeholder, required, autofocus, autocomplete, pattern, step, list, min, max, range, accept, multiple New Elements progress, meter, datalist, output

Slide 20

Slide 20 text

HTML5 - Forms “Roaming” Form elements • Can be outside of form elements • Can belong to multiple forms Validation Pseudo selectors :invalid and :required * Constraint Validation API checkValidity, setCustomValidity, willValidate DOM-less Form Submissions FormData -> XMLHttpRequest.send()

Slide 21

Slide 21 text

HTML5 - Forms - Status wufoo.com/html5

Slide 22

Slide 22 text

HTML5 - Offline applications Advantages • UX - Offline usage • UX - Speed • Server - Reduced load Caveats • No love from IE < 10 • Size limitation 5MB (iOS 6 is up to 25MB) • Server side add text/cache-manifest mime-type Reference • Extension is not important but mime-type is • Absolute (same origin) and relative URI • Cached as a regular HTTP resource headers*

Slide 23

Slide 23 text

HTML5 - Offline Apps - Manifest • CACHE MANIFEST is a required first line • CACHE section is implicit, default behavior • Syntax checking *very* strict. Any error aborts caching • If any resources fails loading aborts cache update • CACHE does not support wildcards. Explicit path needed • A page referencing a manifest file is implicitly cached • Relative URIs are relative to the cache manifest's URI See appcachefacts.info for various quirks

Slide 24

Slide 24 text

HTML5 - Offline Apps - Cache *Credit: marakana.com/bookshelf/html5_tutorial/offline_applications.html

Slide 25

Slide 25 text

HTML5 - Web Storage Old Way Cookies, Flash, Silverlight, AIR, userData in IE, Google Gears New Way • Isolation per sub-domain and per protocol. Does not expire until cleared • 5MB limit. Values are Strings. Webkit stores UTF-16 -> 2.5MB effective storage • No mechanism when quota is exceeded to prompt the user • Prompts the user first time for permission to store data • Well supported: IE8+. Use history.js shim for older browsers

Slide 26

Slide 26 text

HTML5 - Geolocation Geo location detection Global Positioning System (GPS) Inferred: IP address, MAC, Cellphone IDs, etc. User Input Required Attributes latitude, longitude and accuracy are guaranteed in supporting browsers Other attributes will just return null if the information cannot be provided Browser Support IE9+, Modern Browser Privacy Concerns User agent has to explicitly ask for user permission to obtain location Recipients must disclose the data usage: How long the location data is stored? Is it shared with other sites/partners? Can the location data be updated or deleted by the end user?

Slide 27

Slide 27 text

HTML5 - Geolocation

Slide 28

Slide 28 text

HTML5 - Canvas Old Way • Using plugins such as Flash, Silverlight, JavaFX, SVG, VML • VML (Vector Markup Language) only works in IE • SVG, IE support since 9+ New Way • element, lacks border and content by default • JavaScript 2D API Browser Support IE9+, Modern Browser Older IEs - use explorercanvas.js (emulates Canvas via VML) WebGL 3D API - Full support in Chrome only

Slide 29

Slide 29 text

HTML5 - Canvas Markup Operations Context, Transformation, Pixel Manipulation, Compositing, Image Drawing, Text, Path, Rectangles, Colors, Shadows, Styles Scripting http://www.nihilogic.dk/labs/canvas_sheet/HTML5_Canvas_Cheat_Sheet.png

Slide 30

Slide 30 text

HTML5 - Canvas | SVG Coolness www.chromeweblab.com Canvas developer.mozilla.org/en-US/demos/tag/tech:canvas threejs.org (webgl) hakim.se/experiments SVG raphaeljs.com d3js.org paperjs.org/about Canvas or SVG www.sitepoint.com/how-to-choose-between-canvas-and-svg

Slide 31

Slide 31 text

HTML5 - Media Elements Audio & Video tags • Modern Browser, IE9+ • Codecs support not uniform • Polyfill - audio.js, videojs.com • Audio Codecs: Ogg, Mp3, Wav, Aac • Video Codecs: H.264 (mp4), Ogg (ogv), VP8 (webm) multiple occurrences allowed caption tracks. not implemented yet external plugins

Slide 32

Slide 32 text

HTML5 - Media - videojs.com

Slide 33

Slide 33 text

Audience Old IEs and modern browser Solutions • Modernizr - Normalized feature detector • html5shim • FlashCanvas, JebGL, GCF, socket.io, css3pie, amplifyjs • GCF - Google Chrome Frame Caveats Not everything can be detected Performance (jsPerf.com, yepnope.js) HTML5 - Polyfills, shims

Slide 34

Slide 34 text

HTML5 - Status - Use or not? *Image Credit: Wikipedia

Slide 35

Slide 35 text

HTML5 - Status - Use or not? *Image Credit: coolgraphic.org

Slide 36

Slide 36 text

diveintohtml5.info html5rocks.com html5doctor.com developer.mozilla.org/en-US/docs/HTML/HTML5 HTML5 - References

Slide 37

Slide 37 text

diveintohtml5.info | modernizr.com | iewebgl.com | videojs.com caniuse.com | html5test.com | mobilehtml5.org | quirksmode.org html5rocks.com | http://coding.smashingmagazine.com/2011/11/18/ html5-semantics/ html5demos.com html5doctor.com html5boilerplate.com developer.mozilla.org/en-US/docs/HTML/HTML5 craftyjs.com www.cuttherope.ie/dev/ www.infoq.com/presentations/Angry-Birds-on-HTML5 ishtml5readyyet.com HTML5 - Resources

Slide 38

Slide 38 text

Questions ? Ovidiu Dimulescu @odimulescu speakerdeck.com/odimulescu