Bug 16953 - REGRESSION(Safari3-TOT): SVG renders improperly
Summary: REGRESSION(Safari3-TOT): SVG renders improperly
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL: http://upload.wikimedia.org/wikipedia...
Keywords: NeedsReduction, Regression
Depends on:
Blocks:
 
Reported: 2008-01-20 23:04 PST by Mike
Modified: 2012-02-16 04:28 PST (History)
4 users (show)

See Also:


Attachments
reduction of "failing" SVG (1.24 KB, image/svg+xml)
2009-05-06 18:00 PDT, Eric Seidel (no email)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike 2008-01-20 23:04:42 PST
On wikipedia, a subway map does not display properly. The improperly rendered SVG is located at http://upload.wikimedia.org/wikipedia/commons/1/1c/NYCS_map_V.svg and the reference PNG rendering is located at http://upload.wikimedia.org/wikipedia/commons/thumb/1/1c/NYCS_map_V.svg/490px-NYCS_map_V.svg.png. I do not know if this is the fault of an improper SVG file or not, but I figured I'd let you guys know so you could determine.

Interestingly, the SVG does not render well(i.e. the same as WebKit) on Firefox 3.0b2 on Mac OSX, but DOES render properly on Firefox 2.0.0.11 on Windows.
Comment 1 Mark Rowe (bdash) 2008-01-21 00:11:50 PST
Safari 3 appears to render this "properly" too, while the nightly build gets it wrong.  The fact that both the WebKit nightly and Firefox 3 beta render this improperly in the same fashion suggests there may have been a bug fixed in both WebKit and Firefox since the previous versions.
Comment 2 Oliver Hunt 2008-01-21 00:27:39 PST
Looks to be a font positioning issue
Comment 3 Eric Seidel (no email) 2009-05-06 18:00:10 PDT
Created attachment 30077 [details]
reduction of "failing" SVG

The trick here is that this SVG uses <tspan> with an x="" offset list.  We used to not support x="" offsets lists, and so all chars were just laid out normally.  I haven't looked closely enough yet, but I expect that the offset list is just wrong (or not what the author intended), and we're correctly following it.

It's also possible that we're not transforming the x values correctly and that there is a real bug here.  Again, I just haven't stared at it enough yet.
Comment 4 Nikolas Zimmermann 2009-05-06 18:30:30 PDT
Oh, never noticed this bug. I suspect the SVGCharacterLayoutInfo is properly, because it's calculated right from the DOM values. I guess the painting is faulty. It has to properly detect chunk start/end offsets. Otherwhise individual x/y positions won't be respected properly. Needs further investigation.
Comment 5 Nikolas Zimmermann 2009-05-06 18:37:16 PDT
@Eric: Forgot to mention, that we support x/y/dx/dy offset lists on tspan since almost two years now. The engine (SVGCharacterLayoutInfo) uses x/y/dx/dy stacks just for that. The LayoutTests/svg/custom/text-x-dx-lists.svg tests covers this. There are more tests, but I can't remember atm.

So the bug must have a different root. Maybe a combination of wrong chunk start/end detection - while painting transformed tspans.
Comment 6 Eric Seidel (no email) 2009-05-06 19:27:34 PDT
@Nikolas:  I'm still not sure this is even a bug.  As mentioned above, FF3 matches our behavior here.  One of us would need to stare more closely at the text in question to determine if our layout/painting is wrong or not.
Comment 7 Rob Buis 2011-05-15 15:09:27 PDT
I think this problem is fixed now? It seems to me rendered equally on FF, Opera and my webkit build.
Cheers,

Rob.
Comment 8 Nikolas Zimmermann 2012-02-16 04:28:23 PST
(In reply to comment #7)
> I think this problem is fixed now? It seems to me rendered equally on FF, Opera and my webkit build.
> Cheers,
> 
> Rob.

Confirmed, works just fine in trunk - also the <tspan x=".."> scenarios are pretty well tested in svg/text nowadays.