Bug 8994 - Canvas doesn't reset on resize
Summary: Canvas doesn't reset on resize
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL: http://hixie.ch/tests/adhoc/html/canv...
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-19 07:52 PDT by Ian 'Hixie' Hickson
Modified: 2007-07-07 13:16 PDT (History)
1 user (show)

See Also:


Attachments
First attempt (14.62 KB, patch)
2007-07-07 07:16 PDT, Rob Buis
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ian 'Hixie' Hickson 2006-05-19 07:52:15 PDT
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
Comment 1 Ivo Beckers 2006-07-24 02:56:27 PDT
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.
Comment 2 Ivo Beckers 2006-07-24 02:58:47 PDT
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.
Comment 3 Rob Buis 2007-07-07 07:16:19 PDT
Created attachment 15432 [details]
First attempt

This should fix the problem.
Cheers,

Rob.
Comment 4 Darin Adler 2007-07-07 09:33:20 PDT
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
Comment 5 Darin Adler 2007-07-07 13:16:30 PDT
Committed revision 24090.