HTML5: The Good, the Bad, and Everything In Between

15
HTML5: The Good, the Bad, and Everything in Between Jeff Prosise [email protected]

description

More info on techdays.be

Transcript of HTML5: The Good, the Bad, and Everything In Between

Page 1: HTML5: The Good, the Bad, and Everything In Between

HTML5: The Good, the Bad, and Everything in Between

Jeff [email protected]

Page 2: HTML5: The Good, the Bad, and Everything In Between

History API

Pros Provides much-needed Back button support and

optionally deep-linking support for single-page apps (SPAs)

Cons Provides limited freedom to modify backstack

http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html

IE

10+

Chrome

8+

Firefox

4+

Opera

11.5+

Safari

5+

A-

Page 3: HTML5: The Good, the Bad, and Everything In Between

Geolocation API

Pros Simple, powerful, and easy to learn Works almost everywhere (including desktop

browsers) Supports GPS, WiFi Positioning, and triangulation

Cons Provides no control over callback frequency

http://www.w3.org/TR/geolocation-API/

IE

9+

Chrome

5+-

Firefox

3.5+

Opera

10.6+

Safari

5+

A-

Page 4: HTML5: The Good, the Bad, and Everything In Between

Audio and Video

Pros Provides native support for audio and video Eliminate need for Flash players, Silverlight

players, etc.

Cons No standard audio or video file format No support for streaming, adaptive bitrates, or

DRM

http://www.w3.org/TR/html5/the-video-element.html

IE

9+

Chrome

4+

Firefox

3.5+

Opera

10.5+

Safari

4+

B-

Page 5: HTML5: The Good, the Bad, and Everything In Between

Fullscreen API

Pros Provides full-screen support for all HTML

elements, including VIDEO elements

Cons Not supported in Internet Explorer

http://www.w3.org/TR/fullscreen/

IE

-

Chrome

15+

Firefox

10+

Opera

12.1+

Safari

5.1+

B

Page 6: HTML5: The Good, the Bad, and Everything In Between

Canvas

Pros Graphics API fills big hole in HTML API is rich (for 2D), yet relatively easy to learn requestAnimationFrame makes animations

better

Cons API is primitive by today's standards

http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html

IE

9+

Chrome

4+

Firefox

2+

Opera

9+

Safari

3.1+

A-

Page 7: HTML5: The Good, the Bad, and Everything In Between

Web Workers

Pros Allows for multithreaded JavaScript apps API eliminates most complexities from

multithreading

Cons High overhead when transferring large objects

between threads (mitigated by new transferrable objects feature)

http://dev.w3.org/html5/workers/

IE

10+

Chrome

4+

Firefox

3.5+

Opera

10.6+

Safari

4+

A

Page 8: HTML5: The Good, the Bad, and Everything In Between

Web Storage

Pros Allows Web apps to store data persistently on client API simple and easy to learn

Cons Data is stringified when stored and requires type

coercion Recommended 5 MB storage limit is too restricting

http://www.w3.org/TR/webstorage/

IE

8+

Chrome

5+

Firefox

3.5+

Opera

10.5+

Safari

4+

B

Page 9: HTML5: The Good, the Bad, and Everything In Between

Indexed DB

Pros Provides a structured alternative to Web storage Supports fast (indexed) retrieval from large data

sets Supports transacted access and large storage

volumes

Cons No query language; reads are case-sensitive

http://www.w3.org/TR/IndexedDB/

IE

10+

Chrome

11+

Firefox

4+

Opera

-

Safari

-

B

Page 10: HTML5: The Good, the Bad, and Everything In Between

Offline Apps

Pros Provides offline caching story for running apps

when not connected

Cons Story for updating cached content is confusing API could be richer

http://www.w3.org/TR/html5/offline.html

IE

10+

Chrome

5+

Firefox

3.6+

Opera

12+

Safari

4+

C

Page 11: HTML5: The Good, the Bad, and Everything In Between

FileReader API

Pros Provides async API for reading files Relatively well-designed and widely adopted

Cons Reads were all or nothing until introduction of

slicing, which still isn't universally supported

http://www.w3.org/TR/FileAPI/

IE

10+

Chrome

6+

Firefox

4+

Opera

12+

Safari

-

A-

Page 12: HTML5: The Good, the Bad, and Everything In Between

FileWriter and FileSystem APIs

Pros Provides much-needed API for file writing

Cons Specifications came very late, adoption has been

slow Implementations to date only support virtual file

systems API is complex and unintuitive (but fortunately

async)

http://www.w3.org/TR/file-writer-api/ | http://www.w3.org/TR/file-system-api/

IE

-

Chrome

13+

Firefox

-

Opera

-

Safari

-

D

Page 13: HTML5: The Good, the Bad, and Everything In Between

XMLHttpRequest Level 2

http://www.w3.org/TR/XMLHttpRequest/

IE

10+

Chrome

7+

Firefox

4+

Opera

12+

Safari

5+

APros Cross-origin calls via CORS protocol Support for progress reporting on file uploads Support for binary data transfers (send and

receive) Support for request time-outs Cleaner, more consistent API

Page 14: HTML5: The Good, the Bad, and Everything In Between

WebSockets

http://dev.w3.org/html5/websockets/

IE

10+

Chrome

14+

Firefox

6+

Opera

11+

Safari

5+

APros Push model for client-side updates Compatible with proxies and firewalls Supported in other platforms (e.g., Windows 8) Simple and intuitive API

Page 15: HTML5: The Good, the Bad, and Everything In Between

Forms

Pros Allows for richer HTML UIs (finally!) Allows browsers to assume partial responsibility

for input validation (required fields, pattern fields, etc.)

Cons Should have happened a long time ago Not ambitious enough in scope

http://www.w3.org/TR/html5/forms.html

B-