Summary: | Improve handling of <canvas> path operations on an empty path. | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Dean McNamee <deanm> | ||||
Component: | DOM | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | dglazkov, dimich | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | PC | ||||||
OS: | OS X 10.5 | ||||||
Attachments: |
|
Description
Dean McNamee
2009-07-15 02:22:36 PDT
Created attachment 32772 [details]
Patch
Comment on attachment 32772 [details]
Patch
In general this seems okay to me -- how does the output compare to firefox?
Differs from Firefox, looks like the control point vs endpoint, but I really don't see how control point could ever make any sense. I'll look at their code today, and maybe file a bug with them. (In reply to comment #2) > (From update of attachment 32772 [details]) > In general this seems okay to me -- how does the output compare to firefox? (In reply to comment #3) > Differs from Firefox, looks like the control point vs endpoint, but I really > don't see how control point could ever make any sense. I'll look at their code > today, and maybe file a bug with them. > > (In reply to comment #2) > > (From update of attachment 32772 [details] [details]) > > In general this seems okay to me -- how does the output compare to firefox? Ok, so Firefox just passes this directly to cairo: 162 void 163 gfxContext::LineTo(const gfxPoint& pt) 164 { 165 cairo_line_to(mCairo, pt.x, pt.y); 166 } And Cairo has the control point behavior: http://cairographics.org/manual/cairo-paths.html#cairo-curve-to If there is no current point before the call to cairo_curve_to() this function will behave as if preceded by a call to cairo_move_to(cr, x1, y1). I think they should cairo_has_current_point() and cairo_move_to the endpoints if not. I'll file a bug with Mozilla. I wonder why Cairo has this behavior. Discussion of the cairo behavior is here: http://lists.freedesktop.org/archives/cairo/2008-June/014262.html I guess the reason cairo behaves like it does, is because it still wants to emit a curve. I think the current behavior for browser should be to not emit anything, and just do the moveTo. I will follow up with Mozilla. (In reply to comment #4) > (In reply to comment #3) > > Differs from Firefox, looks like the control point vs endpoint, but I really > > don't see how control point could ever make any sense. I'll look at their code > > today, and maybe file a bug with them. > > > > (In reply to comment #2) > > > (From update of attachment 32772 [details] [details] [details]) > > > In general this seems okay to me -- how does the output compare to firefox? > > Ok, so Firefox just passes this directly to cairo: > > 162 void > 163 gfxContext::LineTo(const gfxPoint& pt) > 164 { > 165 cairo_line_to(mCairo, pt.x, pt.y); > 166 } > > And Cairo has the control point behavior: > > http://cairographics.org/manual/cairo-paths.html#cairo-curve-to > > If there is no current point before the call to cairo_curve_to() this function > will behave as if preceded by a call to cairo_move_to(cr, x1, y1). > > I think they should cairo_has_current_point() and cairo_move_to the endpoints > if not. I'll file a bug with Mozilla. I wonder why Cairo has this behavior. Landed as http://trac.webkit.org/changeset/45973. |