RESOLVED INVALID 46576
<canvas> stops working when out of view for some time
https://bugs.webkit.org/show_bug.cgi?id=46576
Summary <canvas> stops working when out of view for some time
Gilles Dubuc
Reported 2010-09-26 03:37:39 PDT
I've written a little <canvas> demo that renders metaballs: http://kouiskas.deviantart.com If you open that page then go do some browsing on other tabs for a while, when you come back to the demo the canvas is empty, despite the animation code still running (verified with developer tools). The duration it takes for the canvas to become empty seems random, sometimes it takes 5 seconds browsing on another tab, sometimes a minute. Even scrolling on the current window can trigger it sometimes (when the canvas goes out of view by scrolling), but most times won't. If you inspect the page around the canvas you should find the javascript code that renders the animation.
Attachments
Andreas Kling
Comment 1 2010-09-26 12:29:34 PDT
Your code ends up calling CanvasRenderingContext2D's arc() with x=NaN and y=NaN, which makes WebKit ignore the call in accordance with HTML5: "Except where otherwise specified, for the 2D context interface, any method call with a numeric argument whose value is infinite or a NaN value must be ignored." http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#2dcontext
Note You need to log in before you can comment on or make changes to this bug.