[webkit-reviews] review granted: [Bug 42211] Canvas: rect(x, y, w, h) should move to (x, y) even if w=0 and h=0 : [Attachment 61433] Proposed patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 13 17:18:57 PDT 2010


Darin Adler <darin at apple.com> has granted Andreas Kling
<andreas.kling at nokia.com>'s request for review:
Bug 42211: Canvas: rect(x,y,w,h) should move to (x,y) even if w=0 and h=0
https://bugs.webkit.org/show_bug.cgi?id=42211

Attachment 61433: Proposed patch
https://bugs.webkit.org/attachment.cgi?id=61433&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
Do we still need the validateRectForCanvas function? Can we refactor it so we
can still use it?

> +    if (!isfinite(x) | !isfinite(y) | !isfinite(width) | !isfinite(height))
> +	   return;

Why "|" instead of "||"?

> +    if (width < 0) {
> +	   width = -width;
> +	   x -= width;
> +    }
> +
> +    if (height < 0) {
> +	   height = -height;
> +	   y -= height;
> +    }

It’s inelegant to modify the arguments like this.

r=me


More information about the webkit-reviews mailing list