Bug 11251 - fill methods in <canvas> throw JS exceptions for 0 size elements
Summary: fill methods in <canvas> throw JS exceptions for 0 size elements
Status: CLOSED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 420+
Hardware: PC OS X 10.4
: P2 Normal
Assignee: Oliver Hunt
URL:
Keywords: HasReduction, Regression
Depends on:
Blocks:
 
Reported: 2006-10-10 20:45 PDT by Oliver Hunt
Modified: 2007-07-03 14:39 PDT (History)
0 users

See Also:


Attachments
Simple test case (735 bytes, text/html)
2006-10-10 20:50 PDT, Oliver Hunt
no flags Details
patch (1.80 KB, patch)
2006-10-10 21:28 PDT, Oliver Hunt
darin: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Hunt 2006-10-10 20:45:16 PDT
Canvas currently throws JS exceptions when JS attempts to draw 0 size elements (eg. when width, height, or radius, etc are 0).  These should just be ignored per the spec.
Comment 1 Oliver Hunt 2006-10-10 20:50:02 PDT
Created attachment 11028 [details]
Simple test case

Simple test case, if it fails, it presents a red square, if it succeeds it presents a green square.
Comment 2 Oliver Hunt 2006-10-10 21:28:13 PDT
Created attachment 11029 [details]
patch

Patch that fixes problem
Comment 3 Adam Roben (:aroben) 2006-10-10 21:34:06 PDT
Comment on attachment 11029 [details]
patch

r=me. Please turn the testcase into a layout test and include it when you check in.
Comment 4 Darin Adler 2006-10-11 11:56:20 PDT
Comment on attachment 11029 [details]
patch

This patch breaks handling of NaN. We need to add test cases that pass non-numeric values (which turn into NaN) and then fix the code to say things like:

    if (!(r >= 0))

rather than

    if (r < 0)

because expressions with NaN always yield false.
Comment 5 Darin Adler 2007-05-05 08:17:29 PDT
Looks like Oliver landed this patch long ago and didn't notice my review-.

http://trac.webkit.org/projects/webkit/changeset/16993
Comment 6 Oliver Hunt 2007-05-06 00:16:02 PDT
Eek, i even discussed that one with you post landing ... will bang out a correction to the logic :(
Comment 7 Oliver Hunt 2007-07-03 14:39:17 PDT
Fxed this a while back (with correct inf handling)