Bug 12062 - WebCore does not handle CSS-specified fill fallback correctly
: WebCore does not handle CSS-specified fill fallback correctly
Product: WebKit
Classification: Unclassified
Component: SVG
: 420+
: Macintosh Mac OS X 10.4
: P2 Normal
Assigned To: Rob Buis
Depends on:
  Show dependency treegraph
Reported: 2007-01-01 16:43 PST by Eric Seidel
Modified: 2007-06-26 00:48 PDT (History)
1 user (show)

See Also:

test case (167 bytes, image/svg+xml)
2007-01-01 16:43 PST, Eric Seidel
no flags Details
First attempt (92.30 KB, patch)
2007-06-23 08:26 PDT, Rob Buis
mjs: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel 2007-01-01 16:43:02 PST
The SVG spec says that when fill is specified fill="url(#foo) green" if #foo is not found, then "green" is used.  if "green" is not found, the document is in error.

WebKit (intentionally) avoids ever putting the document in error.  And instead falls back to the default fill (black) when a fill URI is invalid.   However, in this case, WebKit should first check to see if any other fills were specified first.  In this case, it it should be green.

See test case.  Opera renders it correctly.

(Note, this can't be done by the CSS parser, as the uri might not resolve at that time.  the SVGPaint needs to carry this additional information about fallback.
Comment 1 Eric Seidel 2007-01-01 16:43:37 PST
Created attachment 12150 [details]
test case
Comment 2 Rémi Zara 2007-02-03 03:23:54 PST
This is also the case for stroke
Comment 3 Rob Buis 2007-06-23 08:26:24 PDT
Created attachment 15199 [details]
First attempt

I don't know why I kept this on my HD so long, seems simple now :)

Comment 4 Maciej Stachowiak 2007-06-26 00:13:07 PDT
Comment on attachment 15199 [details]
First attempt

seems simple enough... r=me
Comment 5 Rob Buis 2007-06-26 00:48:51 PDT
Landed in r23788.