I found that the animations starting from chapter 6 were not working in Chrome, the cube that was supposed to be animated never appeared, in fact it did but only for a single frame before it animated itself far off screen.
The reason is due to a change in the time value returned when requestAnimFrame is called. It is simple to fix by replacing
Code:
if (currentTime === undefined) {
currentTime = Date.now();
}
with
Code:
if (currentTime === undefined) {
currentTime = performance.now();
}
in the draw method. Animations will then work in Chrome and Firefox will continue to work as before.
More information can be found from
html5rocks.com.
It appears that this is a change in the standard rather than an error in the authors source code.