Bug 22844 - [Cg] Canvas fill() draws gradients even without a path
Summary: [Cg] Canvas fill() draws gradients even without a path
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-13 07:26 PST by Dirk Schulze
Modified: 2008-12-14 00:13 PST (History)
0 users

See Also:


Attachments
example (529 bytes, text/html)
2008-12-13 07:35 PST, Dirk Schulze
no flags Details
fixes canvas gradient on cg (5.16 KB, patch)
2008-12-13 08:03 PST, Dirk Schulze
darin: review+
Details | Formatted Diff | Diff
delete wrong pixel-test gradient-emty-path (3.34 KB, patch)
2008-12-13 13:51 PST, Dirk Schulze
oliver: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Schulze 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.
Comment 1 Dirk Schulze 2008-12-13 07:35:00 PST
Created attachment 25999 [details]
example

an example. you should see a green box.
Comment 2 Dirk Schulze 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.
Comment 3 Darin Adler 2008-12-13 11:31:16 PST
Comment on attachment 26000 [details]
fixes canvas gradient on cg

r=me
Comment 4 Dirk Schulze 2008-12-13 12:46:31 PST
landed in r39276.
Comment 5 Dirk Schulze 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.
Comment 6 Dirk Schulze 2008-12-13 13:51:42 PST
Created attachment 26004 [details]
delete wrong pixel-test gradient-emty-path

delete wrong test.
Comment 7 Dirk Schulze 2008-12-14 00:13:46 PST
landed the LayoutTest fix in r39288.