HTML5 Unleashed


HTML5 Unleashedis the authoritative guide that covers the key web components driving the future of the Web. Students will learn to harness the power of HTML5 to create web apps and solutions that deliver state-of-the-art media content and interactivity with new Audio, Video, and Canvas elements. Comprehensive and up-to-date, HTML5 Unleashed is organized as an accessible guide of tutorials and practical references. Because HTML5 covers a far-reaching set of standards, each chapter in HTML5 Unleashed is written to ...

See more details below
$32.41 price
(Save 27%)$44.99 List Price

Pick Up In Store

Reserve and pick up in 60 minutes at your local store

Other sellers (Paperback)
  • All (14) from $25.20   
  • New (12) from $25.20   
  • Used (2) from $32.40   
HTML5 Unleashed

Available on NOOK devices and apps  
  • NOOK Devices
  • Samsung Galaxy Tab 4 NOOK 7.0
  • Samsung Galaxy Tab 4 NOOK 10.1
  • NOOK HD Tablet
  • NOOK HD+ Tablet
  • NOOK eReaders
  • NOOK Color
  • NOOK Tablet
  • Tablet/Phone
  • NOOK for Windows 8 Tablet
  • NOOK for iOS
  • NOOK for Android
  • NOOK Kids for iPad
  • PC/Mac
  • NOOK for Windows 8
  • NOOK for PC
  • NOOK for Mac

Want a NOOK? Explore Now

NOOK Book (eBook)
$19.99 price
(Save 44%)$35.99 List Price


HTML5 Unleashedis the authoritative guide that covers the key web components driving the future of the Web. Students will learn to harness the power of HTML5 to create web apps and solutions that deliver state-of-the-art media content and interactivity with new Audio, Video, and Canvas elements. Comprehensive and up-to-date, HTML5 Unleashed is organized as an accessible guide of tutorials and practical references. Because HTML5 covers a far-reaching set of standards, each chapter in HTML5 Unleashed is written to stand on its own. Whether you choose to skip around or teach it cover to cover, full-color syntax and figures in HTML5 Unleashed ensure that students do not need to be next to a computer to learn the most important concepts of the modern Web.

Read More Show Less

Product Details

  • ISBN-13: 9780672336270
  • Publisher: Sams
  • Publication date: 7/30/2013
  • Series: Unleashed Series
  • Edition number: 1
  • Pages: 432
  • Sales rank: 961,361
  • Product dimensions: 7.00 (w) x 9.10 (h) x 0.70 (d)

Meet the Author

Simon Sarris is a web developer focusing primarily on the HTML5 Canvas. Simon has earned a reputation as a go-to source for HTML5 answers. He contributes to the question-and-answer website StackOverflow and has provided the most answers for both the Canvas and HTML5 tags. Simon blogs about Canvas and JavaScript topics, and you can find him online at

Read More Show Less

Table of Contents

Introduction 1

Who Should Read This Book? 2

HTML5 and Related Technologies 2

Software Requirements 3

Code Examples 3

How This Book Is Organized 3

Part I: Background 4

Part II: New HTML Elements 4

Part III: Canvas 4

Part IV: HTML5’s JavaScript APIs 4

Links and Real-World Examples 5

Chapter 1: Why HTML5? 7

How Did We End Up Here? 7

The Web Takes Off 9

The Rise of the Browser Plug-In 9

Web 2.0 10

HTML5 11

What Exactly Is HTML5? 11

The Importance of HTML5 12

Are Plug-ins Dead? 14

Summary 14

Chapter 2: Important Concepts for HTML5 15

The Goals of HTML5 15

Improving the Native Web 15

More Done with Less Code 16

The Semantic Web 16

Requisites for HTML5 Development 16

Modern Browser Developer Tools 16

HTML5 Fallbacks: Shims, Shivs, and Polyfills 17

Feature Support and Detection 18

Summary 19

Chapter 3: Getting Started with HTML5: Semantic Tags, Forms, and Drag and Drop 21

Ensuring Backward Compatibility with the New HTML Tags 21

The HTML5 Shim 22

HTML5 Boilerplate 23

Starting from the Top 23

The Doctype 23

Meta Character Encoding 24

HTML5 Syntax and Validation 24

How You Should Write Your HTML 27

Housekeeping 29

HTML5 Semantic Elements and Other Presentational Tags 31

HTML5 Semantic Tags 31

Document Outlines in HTML5 33

Minor Semantic and Presentational HTML5 Tags 35

Visual HTML5 Tags: and 37

HTML5 Forms 40

Form Input Types 40

New Form Input Attributes and Elements 47

Drag and Drop in HTML5 53

The Basics 53

Drag Data and Effects 55

Drag Events 58

Summary 67

Chapter 4: Rich Media Tags: Video and Audio 69

The Video Element 71

Video Formats and Support 71

Using the Video Element 75

The Audio Element 77

Audio Formats and Support 77

Using the Audio Element 79

Encoding Your Media 80

Conversion Tools 81

Supporting Older Browsers 81

Video and Audio Attributes 82

Video-Only Attributes 82

Attributes Shared Between Audio and Video 85

JavaScript API 90

The readyState and Starting at a Specified Time 92

The playbackRate and Time Control 93

Loading Videos Sequentially 94

Custom Controls 95

Advantages and Disadvantages of the HTML5 Media Tags Versus Flash 95

Ease of Use and Extensibility 95

Platform Support 96

Feature Support 96

Media Protection 97

Future Developments 97

WebRTC 97

WebVTT and the Tag 98

The Full-Screen API 100

The Web Audio API 100

The Embed Element 101

Summary 101

Chapter 5: 2D Canvas 103

Browser Support 104

Internet Explorer 105

Testing for Support 105

What Canvas Can and Cannot Do 106

A Comparison with SVG 107

Where Canvas Shines 109

When to Not Use Canvas 109

Don’t Use Canvas for General UI 111

Getting Started with Canvas 111

An HTML Page with a Canvas 113

Canvas Attributes 115

toDataURL 116

Context Methods and State 117

A Quick Look at the Properties and State Available 117

Understanding Drawing, Starting with Rectangles 118

fillStyle and strokeStyle 119

Paths 120

Understanding the Canvas Coordinate System 122

Line Styles 125

Curves 127

Ellipses 133

isPointInPath 135

Path Filling--The Winding Number Rule 135

Summary of Context State So Far 138

Saving and Restoring 140

Transformation Matrix 141

translate 141

scale 143

Saving and Restoring Affect How Drawing Functions Act on a Transformed Canvas 143

rotate 146

transform and setTransform 150

Keeping Track of Transformations 152

In-Memory Canvases 154

Using Images and Other Canvases 160

Double Buffering 161

Image Data and Pixel Manipulation 162

getImageData 162

createImageData 164

putImageData 164

Image Security on the Canvas 171

CORS 172

But I Want to Test My Image Data Code Locally! 172

Gradients and Patterns 173

Linear Gradients 173

Radial Gradients 175

Gradient Performance and Reuse 177

Patterns 179

Shadows 182

Compositing 184

Compositing Examples 186

Clipping 189

Clearing Nonrectangular Areas 190

Using Text 192

First the Bad Parts 192

Drawing Text 194

Fonts 195

textBaseline 197

textAlign 197

Measuring Text 198

Performance 199

Canvas Context Recap 200

Styling 200

Shadows 200

State 200

Rectangles 200

Paths 201

Image Drawing 202

Transformation 202

Compositing 202

Text 202

Image Data 203

Summary 203

Chapter 6: Making Canvas Interactive and Stateful 205

Canvas Coordinates--Mouse and Touch 205

getBoundingClientRect 206

Computing Element Offset 207

Canvas Animation 210

Letting the Browser Take Control with requestAnimationFrame 210

Animation and Timing 212

Canvas Interactivity Example: Making and Moving Shapes 215

Getting Started 216

The Shapes We Draw 217

Keeping Track of Canvas State. 218

Mouse and Touch Events 219

Getting Input Coordinates 222

Drawing 223

Complete Canvas Interactivity Example 225

Summary 231

Chapter 7: Canvas Performance, Tips, and Peculiarities 233

Canvas Peculiarities and Tips 234

CSS Width and Height 234

Paths or Images Look Blurry 234

The Methods save and restore 236

Clipping Regions Can Only Get Smaller and Cannot Be Reset 237

Security Exceptions, Cross-domain Images, and Image Data 238

Transformations Affect Drawing in Addition to Paths 238

A Performance Primer 239

Tools of the Trade 240

Before We Get to Canvas 245

The DOM and Canvas 248

Caching Context Properties 248

Stop Using save and restore 250

Caching with Images and In-Memory Canvases 251

Images 252

Text 252

Shadows 253

Gradients 254

Paths 255

Multiple Canvases 256

Keeping Track of Objects 257

Hit Testing 257

Size Matters 260

Summary 261

Chapter 8: The Future of Canvas and 3D Canvas 263

The Future of 2D Canvas 263

New in the Specification 264

Hints from the Browsers 270

3D (WebGL) Canvas 271

WebGL Libraries 272

Summary 275

Chapter 9: Geolocation API 277

Understanding Latitude and Longitude 278

Types of Geolocation Data 280

The Old Ways 280

The HTML5 Way--New Methods for Geolocation 281

HTML5 Geolocation API 282

Geolocation Support 283

Using Geolocation 283

The API 283

Geolocation in Action 288

Where Am I? 288

A Trailblazing App 293

Summary 299

Chapter 10: HTML5 Storage Options 301

Older Storage Methods 301

Browser Cookies 301

Flash Cookies 302

userData 302

Along the Way 302

Web Storage--sessionStorage and localStorage 303

sessionStorage 303

localStorage 304

API 304

WebSQL Database 307

IndexedDB 308

Getting Started with IndexedDB 308

Looking Further 322

FileSystem API for Local Read/Write Access 323

FileSystem API Example 324

Offline Pages and the Application Cache 326

Using the Application Cache 327

Important Notes About the Application Cache 330

Summary 331

Chapter 11: Messaging and Web Workers 333

The Web Messaging API and Cross-Document Messaging 333

Sending and Receiving Messages 334

Channel Messaging 336

Security with Web Messages 338

Web Workers 339

Getting Started with Web Workers 340

A Simple Example 342

Shared Web Workers 345

Web Worker Considerations 349

Summary 351

Chapter 12: Network Communication: WebSockets and XMLHttpRequest Level 2 353

Real-Time Communication with WebSockets 354

Before WebSockets 354

Getting Started with WebSockets 355

A Complete WebSockets Example 358

Server-Side WebSockets 359

New AJAX Capabilities with XMLHttpRequest Level 2 359

New Features in XHR2 360

Summary 364

Chapter 13: Microdata, Other Small Things, and Beyond HTML5 365

Microdata 365

Getting Started with Microdata 367

A Microdata Recipe Example 371

New Browser Features Not Covered in This Text 373

Honorable Mention: The File API 373

Other New Browser Features 375

The Future 378

The Future of Web Development 379

Summary 380

Index 381

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Terms of Use.
  • - Barnes & reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)