RESOLVED FIXED 22844
[Cg] Canvas fill() draws gradients even without a path
https://bugs.webkit.org/show_bug.cgi?id=22844
Summary [Cg] Canvas fill() draws gradients even without a path
Dirk Schulze
Reported 2008-12-13 07:26:02 PST
If you add a gradient to the canvas and use fill() a gradient is drawn, even if there is no path.
Attachments
example (529 bytes, text/html)
2008-12-13 07:35 PST, Dirk Schulze
no flags
fixes canvas gradient on cg (5.16 KB, patch)
2008-12-13 08:03 PST, Dirk Schulze
darin: review+
delete wrong pixel-test gradient-emty-path (3.34 KB, patch)
2008-12-13 13:51 PST, Dirk Schulze
oliver: review+
Dirk Schulze
Comment 1 2008-12-13 07:35:00 PST
Created attachment 25999 [details] example an example. you should see a green box.
Dirk Schulze
Comment 2 2008-12-13 08:03:45 PST
Created attachment 26000 [details] fixes canvas gradient on cg just don't call GraphicsContext::fillPath() or GraphicsContext::strokePath() if the path is empty.
Darin Adler
Comment 3 2008-12-13 11:31:16 PST
Comment on attachment 26000 [details] fixes canvas gradient on cg r=me
Dirk Schulze
Comment 4 2008-12-13 12:46:31 PST
landed in r39276.
Dirk Schulze
Comment 5 2008-12-13 13:39:16 PST
One pixel-test fails. I'm prety sure that this failing pixel-test is wrong and should be deleted. It makes no sense to fill somthing with a gradient if the path is empty. This behavior is against the spec of HTML 5. It was added in https://bugs.webkit.org/show_bug.cgi?id=14642 becauses of http://adam.yanalunas.com/projects/reflect/. It could be that we didn't get fillRect to work with gradients at this time. To get reflect back, just delete the webkit hack on the script.
Dirk Schulze
Comment 6 2008-12-13 13:51:42 PST
Created attachment 26004 [details] delete wrong pixel-test gradient-emty-path delete wrong test.
Dirk Schulze
Comment 7 2008-12-14 00:13:46 PST
landed the LayoutTest fix in r39288.
Note You need to log in before you can comment on or make changes to this bug.