WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
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
Summary
Canvas: rect(x,y,w,h) should move to (x,y) even if w=0 and h=0
Andreas Kling
Reported
2010-07-13 16:37:42 PDT
Quoth HTML5: The rect(x, y, w, h) method must create a new subpath containing just the four points (x, y), (x+w, y), (x+w, y+h), (x, y+h), with those four points connected by straight lines, and must then mark the subpath as closed. It must then create a new subpath with the point (x, y) as the only point in the subpath. This would fix one in-tree layout test: - canvas/philip/tests/2d.path.rect.zero.4.html Spec link:
http://www.whatwg.org/specs/web-apps/current-work/#dom-context-2d-rect
Attachments
Proposed patch
(3.47 KB, patch)
2010-07-13 16:40 PDT
,
Andreas Kling
darin
: review+
kling
: commit-queue-
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Andreas Kling
Comment 1
2010-07-13 16:40:45 PDT
Created
attachment 61433
[details]
Proposed patch
Darin Adler
Comment 2
2010-07-13 17:18:57 PDT
Comment on
attachment 61433
[details]
Proposed patch 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
Andreas Kling
Comment 3
2010-07-13 17:45:43 PDT
Committed
r63270
: <
http://trac.webkit.org/changeset/63270
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug