Bug 4211 - REGRESSION: Most SVG's render black
Summary: REGRESSION: Most SVG's render black
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P4 Normal
Assignee: Eric Seidel (no email)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-29 14:23 PDT by Eric Seidel (no email)
Modified: 2005-08-01 12:31 PDT (History)
0 users

See Also:


Attachments
A simple SVG to show problems with drawing colors (756 bytes, image/svg+xml)
2005-07-31 12:56 PDT, Ben La Monica
no flags Details
An even simpler reduction (499 bytes, image/svg+xml)
2005-07-31 16:53 PDT, Eric Seidel (no email)
no flags Details
Removes WebCore's usage of WebKitGraphicsBridge, fixing bug. (9.87 KB, patch)
2005-07-31 23:08 PDT, Eric Seidel (no email)
darin: review+
Details | Formatted Diff | Diff
Removes WebKit portion of WebKitGraphicsBridge (755 bytes, patch)
2005-08-01 00:10 PDT, Eric Seidel (no email)
darin: 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 (no email) 2005-07-29 14:23:00 PDT
Most SVG's render black

There seems to have been a serious regression in color handling during the process of merging SVG 
support into TOT WebCore.  Possibly the regression is in KWQColor... more likely I'm doing something else 
wrong.

Either way, most SVG's fail to lookup their colors properly and thus all colors are black.
Comment 1 Ben La Monica 2005-07-31 12:56:35 PDT
Created attachment 3181 [details]
A simple SVG to show problems with drawing colors

It turns out that those SVGs that render properly don't use any solid fills.
However, if you use a RadialGradient (or I assume, any gradient) it applies the
color correctly.

This file has 2 ellipses in it, the smaller ellipse should be red. The larger
ellipse is blue.
Comment 2 Eric Seidel (no email) 2005-07-31 16:53:04 PDT
Created attachment 3184 [details]
An even simpler reduction
Comment 3 Eric Seidel (no email) 2005-07-31 21:17:57 PDT
pojo2 found the problem.

Basically, this happens because we're not linking in WebKit... which means that some bridge functions 
don't get defined.

One example is this one:

- (CGColorSpaceRef)createRGBColorSpace
{
    return 0;
}

Thus we're getting back a NULL color space.  Now... why this means that gradients are still working, I 
don't know.  That sounds like a bug.
Comment 4 Eric Seidel (no email) 2005-07-31 23:08:02 PDT
Created attachment 3189 [details]
Removes WebCore's usage of WebKitGraphicsBridge, fixing bug.
Comment 5 Darin Adler 2005-08-01 00:01:42 PDT
Comment on attachment 3189 [details]
Removes WebCore's usage of WebKitGraphicsBridge, fixing bug.

Looks great, but doesn't go far enough. Should also remove the unused methods
from the WebCoreGraphicsBridge interface, and from WebKit.

(And later we should remove the underlying calls from WebKitSystemInterface as
well.)
Comment 6 Eric Seidel (no email) 2005-08-01 00:10:36 PDT
Created attachment 3191 [details]
Removes WebKit portion of WebKitGraphicsBridge
Comment 7 Eric Seidel (no email) 2005-08-01 02:13:08 PDT
According to autovicki, this change produced no speed regressions.  Possibly a speed improvement:

Before:

TestSuite: PageLoadTest
TestType: cvs-base
OSVersion: 8C46
SafariVersion: (v412+)
Machine Model: PowerBook G4 12"
Number Of CPUs: 1
CPU Speed: 1.33 GHz
Memory: 1.25 GB
Date: Mon Aug  1 02:06:45 PDT 2005
==================================

cvs-base Cold:      	0.416
cvs-base Uncached:      0.226
cvs-base AvgCached:     0.159
cvs-base Cached 1:  0.159
cvs-base Cached 2:  0.159
cvs-base Cached 3:  0.158
cvs-base Cached 4:  0.161
cvs-base Cached 5:  0.158


After:

TestSuite: PageLoadTest
TestType: cvs-base
OSVersion: 8C46
SafariVersion: (v412+)
Machine Model: PowerBook G4 12"
Number Of CPUs: 1
CPU Speed: 1.33 GHz
Memory: 1.25 GB
Date: Mon Aug  1 01:41:51 PDT 2005
==================================

cvs-base Cold:      	0.418
cvs-base Uncached:      0.226
cvs-base AvgCached:     0.158
cvs-base Cached 1:  0.159
cvs-base Cached 2:  0.158
cvs-base Cached 3:  0.157
cvs-base Cached 4:  0.158
cvs-base Cached 5:  0.159
Comment 8 Eric Seidel (no email) 2005-08-01 02:22:08 PDT
Commited WebCore fixes, waiting for WebKit fix approval.
Comment 9 Darin Adler 2005-08-01 11:38:56 PDT
Comment on attachment 3191 [details]
Removes WebKit portion of WebKitGraphicsBridge

Looks fine. Lets be sure to remove the WebCore side too.
Comment 10 Eric Seidel (no email) 2005-08-01 12:31:50 PDT
Sent mail to Darin w/ proposed SPI removal.  The public part of this bug is fixed.