Bug 22844

Summary: [Cg] Canvas fill() draws gradients even without a path
Product: WebKit Reporter: Dirk Schulze <krit>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
example
none
fixes canvas gradient on cg
darin: review+
delete wrong pixel-test gradient-emty-path oliver: review+

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.