Bug 25403 - Gradient Fill of text not positioned properly
: Gradient Fill of text not positioned properly
Status: RESOLVED FIXED
: WebKit
SVG
: 528+ (Nightly build)
: Macintosh Mac OS X 10.5
: P2 Normal
Assigned To:
:
:
: 23881 25431
:
  Show dependency treegraph
 
Reported: 2009-04-25 20:01 PST by
Modified: 2009-04-28 16:10 PST (History)


Attachments
Test Case showing the problem (805 bytes, image/svg+xml)
2009-04-25 20:01 PST, Jeff Schiller
no flags Details
Add text gradient test to cover (3.90 KB, patch)
2009-04-28 15:10 PST, Eric Seidel
simon.fraser: review+
Review Patch | Details | Formatted Diff | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2009-04-25 20:01:27 PST
The attached test case shows a bug in WebKit:  The green text should almost completely obscure the red text.  However, the red text is visible in Safari 4 at a different size and position than the green text.

Note that the red text is actually a gradient.  If the gradient was replaced with a solid color (fill="red"), then this problem is no longer present.

This may be related to Bug 25402.
------- Comment #1 From 2009-04-25 20:01:59 PST -------
Created an attachment (id=29795) [details]
Test Case showing the problem
------- Comment #2 From 2009-04-26 12:44:44 PST -------
I don't see a problem with the test case in r42858
------- Comment #3 From 2009-04-26 23:05:13 PST -------
*** Bug 25402 has been marked as a duplicate of this bug. ***
------- Comment #4 From 2009-04-26 23:08:55 PST -------
The wrong behavior is caused by wrong values of the drawing rect. eseidel improved boundingBox's in the last days. It should work now. Can you test it again with the latest nightly please?
------- Comment #5 From 2009-04-28 15:03:02 PST -------
Wow.  This is much better after http://trac.webkit.org/changeset/42950.

Would you consider this fixed, Jeff?  Or do we have more work to do here?

Our rendering looks as good (or better) than FF and Opera.
------- Comment #6 From 2009-04-28 15:10:12 PST -------
Created an attachment (id=29866) [details]
Add text gradient test to cover

 5 files changed, 43 insertions(+), 0 deletions(-)
------- Comment #7 From 2009-04-28 15:14:06 PST -------
Thanks for the awesome test case.

Committing to http://svn.webkit.org/repository/webkit/trunk ...
    M    LayoutTests/ChangeLog
    A    LayoutTests/platform/mac/svg/text/text-gradient-positioning-expected.checksum
    A    LayoutTests/platform/mac/svg/text/text-gradient-positioning-expected.png
    A    LayoutTests/platform/mac/svg/text/text-gradient-positioning-expected.txt
    A    LayoutTests/svg/text/text-gradient-positioning.svg
Committed r42966

We might still be using repaintRectInLocalCoordinates() in a few places where we should be using objectBoundingBox(), so related test cases could fail.  But this nice test case you provided "passes" now, as far as I can tell.

Thanks for the great test case!  (You'll see that I changed the text a little to make it more self-documenting, but otherwise landed it as-is.)
------- Comment #8 From 2009-04-28 16:10:06 PST -------
Looks great to me in nightly from 4/25.  Thanks!