In some situations the rendering of the <canvas> on <http://canvex.lazyilluminati.com/83/play.xhtml> becomes corrupted. Resizing the canvas with the size links at the top of the page, which seems to reset the canvas buffer and start over generally corrects the rendering. Steps to reproduce: 1. At the start walk directly forward until standing on the edge of the step out of the blue area and stop. 2. Hold the left arrow key and do a 360 degree spin. Another Way: 1. From the start, turn and walk to the left and stop inside the doorway after the door as gone up. 2. Face the inside room area (away from the Firefox logo). 3. Rotate 360 degrees. Some flickering may occur, and different parts of the canvas rendering area may become stuck displaying part of the level, while other parts keep changing. The frame rate should also jump much higher after this. The 360 degree spin isn't strictly required, and the bug can be produced by doing a partial spin as you walk over the step from the blue floored area in the middle of the room as well in other situations. Can't produce this behavior in Opera 9 or Firefox 2, so it doesn't appear to be a bug in the JS.
Reproducible in the latest nightly (Sun Apr 29 3:44:55 GMT 2007).
Confirmed with r21199.
I've debugged this and determined that the problem is that Safari's canvas will throw an exception if drawImage arguments are no good. That's what the WhatWG specification says we should do <http://www.whatwg.org/specs/web-apps/current-work/#images>, but here in the Canvex example it's causing us to do a save() without a restore() and the clip is getting stuck.
Created attachment 14347 [details] patch; tolerate 0 sizes without raising an exception
See also: bug 11251.
Comment on attachment 14347 [details] patch; tolerate 0 sizes without raising an exception r=me
Sending LayoutTests/ChangeLog Deleting LayoutTests/fast/canvas/drawImage-with-invalid-args-expected.checksum Deleting LayoutTests/fast/canvas/drawImage-with-invalid-args-expected.png Sending LayoutTests/fast/canvas/drawImage-with-invalid-args-expected.txt Sending LayoutTests/fast/canvas/drawImage-with-invalid-args.html Sending WebCore/ChangeLog Sending WebCore/html/CanvasRenderingContext2D.cpp Transmitting file data ..... Committed revision 21280.