The words you are searching are inside this book. To get more targeted content, please make full-text search by clicking here.

Pro HTML5 Programming - Peter Lubbers, brian Albers, Frank Salim

Discover the best professional documents and content resources in AnyFlip Document Base.
Search
Published by , 2015-05-31 00:20:56

Pro HTML5 Programming - Peter Lubbers, brian Albers, Frank Salim

Pro HTML5 Programming - Peter Lubbers, brian Albers, Frank Salim

scale function, 50 ■ INDEX
scaling, canvas objects, 49–51
scriptable media attributes, 75 socket.onmessage callback, 163, 231
scripting APIs, 71 socket.onopen callback, 231
sectioning content type, 10–13, 16–17 split() routine, 163, 228
security SquirrelFish Extreme, 22
src attribute, 72–73
canvas, 58–59 Standards (or no-quirks) mode, 9
HTML5 and, 4 startTime attribute, 75
origin, 117–118 startVideo function, 81
Selectors API, 18–20 status bar, 111–112
semantic markup, 10–13, 16–17 step attribute, 179
send method, 141 stepMismatch constraint, 182
sendMyLocation() function, 163 stopPropagation() function, 189
server validation, 180 stopTimeline function, 83
sessionStorage object, 214– 219, 228–229 Storage interface, 219
setConfidence() function, 189 storage.key() function, 230
setItem(key, value) function, 220 storageArea, 222
shadowBlur property, 55 StorageEvent interface, 222
shadowColor property, 55 storageLog.html page, 240
shadowOffsetX property, 55 streaming, 138
shadowOffsetY property, 55 streaming audio, 68
shadows, 55–57 streaming video, 68
shape routines, performing at origin, 51 stringify() function, 21
shapes stroke styles, 38
drawing, using paths, 35–37 strokeStyle property, 48
filling rectangular content, 40–41 strokeText function, 53
using fill styles with, 39–41 structured data, 135
using stroke styles on, 38 subspecifications, 13
SimpleHTTPServer module, 247 successCallback function, 97
slow-script warnings, 193
281

■ INDEX

T user input, handling, in video element, 82–
83
Tamarin, 22
TCPConnection, 139 user-defined geolocation data, 91
text
V
adding to canvas, 53–54
applying shadows, 55–57 V8, 22
Theora video codec, 67 validation
timeout attribute, 100
toggleSound() function, 77 form, 180–185
tooLong constraint, 182 passwords, 190–191
Touch API, 266 server, 180
touch events, 265–266 validationMessage attribute, 183
touchscreen device events, 263 ValidityState object, 180–181, 190
transaction.executeSql() function, 236 valueAsNumber function, 179
transformations valueMissing constraint, 181
applying to drawings, 32–35 Vector Markup Language (VML), 25
using, 52–53 video/Video API
translate method, 34 adding, 78
translations, creating diagonal line using, adding variables, 79
attributes, 77
33–35 browser support for, 68–70
two-dimensional context, 31 codecs, 67
TypedArray, 262 containers, 65–66
typeMismatch constraint, 181, 187 creating video timeline browser, 78–84
declaring, 71
U Flash, 70
full-screen, 68
universal access, 5 future improvements in, 263
update() function, 250 mouseover video playback, 85–86
updateFrame() function, 80 playback controls, 74–76
updateInterval variable, 79 source, 72–73
updateLocation() function, 97–98, 162 startVideo function, adding, 81

282

stopTimeline function, adding, 83 ■ INDEX
streaming, 68
understanding, 71–76 overview, 213–214
unsupported, 68 storage values, 223–224
updateFrame function, adding, 80 using, 215–224
using input, handling, 82–83
using, 69–86 checking for browser support, 215–
videoHeight attribute, 77 216, 229
videoWidth attribute, 77
volume attribute, 75 communicating updates, 221–222
Vorbis audio codec, 67 local vs. session storage, 219
plugging data leaks, 217– 219
W setting and retrieving values, 216–

watchPosition() function, 101–102, 112 217
Web 2.0, 1 Web Workers API, 193–212
Web Accessibility Initiative (WAI)
browser support for, 194–195
Accessible Rich Internet building application with, 200–201
Applications (ARIA), 5
Web Hypertext Application Working application in action, 207
Group (WHATWG), 1, 3 coding blur.html application page,
Web pages, rendering modes, 9
Web SQL Database, 235–238 203
Web Storage API, 213–241 coding blur.js helper script, 201–202
atrtibutes and functions, 219–221 coding blurWorker.js Web Worker
benefits of, 234
browser support for, 214 script, 204
browser treatment of, 223–224 communicating with Web Workers,
building application with, 224–235
vs. cookies, 213–214 205
cross-window communication, 239– example code, 207–212
241 introduction to, 193
JSON object storage, 238–239 using, 194
coding JavaScript file, 197
communicating with web workers,

195197
creating Web Workers, 195
error handling, 197
example code, 199200
loading and executing JavaScript,

195

283

■ INDEX

stopping Web Workers, 198 Wi-Fi–based geolocation data, 90
timers, 199 willValidate attribute, 183
within Web Workers, 198 window object, 219
WebGL, 260–262 window.applicationCache, 250
WebSocket API, 3, 137–167, 230 window.applicationCache.status, 248
browser support for, 154 window.JSON, 21
building application with, 158–167 window.openDatabase() function, 236
adding Geolocation code, 162 window.orientation property, 264
adding WebSocket code, 161–162 window.WebSocket command, 154
coding HTML file, 159–161 World Wide Web Consortium (W3C), 1, 3
final code, 164–167
putting all together, 162–164 X
compared with polling, 143
echo server, 146–153 XForms, 170
handshake, 140 XMLHttpRequest, 126, 141
interface, 141 XMLHttpRequest Level 2, 126–135
overview, 137–144
protocol, 140 application in action, 134–135
reduction in network traffic and latency browser support, 129
code for application, 132
using, 142–144 cross-origin communication, 126–128
server implementations, 147 progress events, 128
using, 154–158 using, 129–131

adding event listeners, 155 building application, 131–132
creating WebSocket object and making cross-origin requests, 130
progress events, 130
connecting to WebSocket server,
155 Z
running WebSocket page, 156–158
sending messages, 155–156 Z-order, 53
WebSocketConnection, 148
width attribute, 77

284


Click to View FlipBook Version