Bug 30073

Summary: Need to scale the canvas, not resize it on CSS width/height change
Product: WebKit Reporter: Chris Marrin <cmarrin>
Component: WebGLAssignee: Chris Marrin <cmarrin>
Status: RESOLVED FIXED    
Severity: Normal CC: mrowe, oliver, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
Patch oliver: review+

Description Chris Marrin 2009-10-05 07:14:27 PDT
Canvas should only resize when canvas width and height attributes are changed
Comment 1 Chris Marrin 2009-10-19 20:44:46 PDT
Another odd characteristic of this bug happens if you open (for instance):

    http://webkit.org/blog-files/webgl/ManyPlanetsDeep.html

and then hit cmd-+. The planets get smaller. This is happening because I am looking at the CSS size to set the canvas, but at the canvas width and height to set the viewport. The canvas size doesn't change but the css size gets bigger, so the viewport is small relative to the canvas size.

This is all fixed by not changing the canvas based on the CSS size, which is what fixing this bug will do.
Comment 2 Chris Marrin 2010-01-18 13:56:59 PST
Created attachment 46844 [details]
Patch
Comment 3 WebKit Review Bot 2010-01-18 13:59:01 PST
Attachment 46844 [details] did not pass style-queue:

Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1
WebCore/html/HTMLCanvasElement.cpp:277:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
WebCore/html/HTMLCanvasElement.cpp:277:  Use 0 instead of NULL.  [readability/null] [5]
Total errors found: 2


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Chris Marrin 2010-01-18 15:09:47 PST
Landed in http://trac.webkit.org/changeset/53434