Resizing the canvas coordinate space (changing the height and width attributes) should reset the canvas bitmap to transparent black and the context to its initial state. The lineWidth currently doesn't seem to get reset. TESTCASES http://hixie.ch/tests/adhoc/html/canvas/017.html http://hixie.ch/tests/adhoc/html/canvas/018.html http://hixie.ch/tests/adhoc/html/canvas/019.html
The entire CANVAS element becomes unusable after changing the width and height on the fly. A complete swap of the element with its new dimensions is necessary to bring it back to live.
The entire CANVAS element becomes unusable after changing its width,height on the fly. A complete swap of the element with the new dimensions is necessary to bring it back to live again.
Created attachment 15432 [details] First attempt This should fix the problem. Cheers, Rob.
Comment on attachment 15432 [details] First attempt You shouldn't need to say .get() to check a RefPtr for null. Also, the indentation is 4 spaces, not 3. r=me
Committed revision 24090.