Last modified: 2008-04-01 19:01:20 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 13580 - SVG nesting of <tspan> elements incorrect on Firefox (works on IE6/Opera). Includes workaround.
SVG nesting of <tspan> elements incorrect on Firefox (works on IE6/Opera). In...
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-04-01 18:33 UTC by FT2
Modified: 2008-04-01 19:01 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description FT2 2008-04-01 18:33:41 UTC
The following SVG code snip renders correctly on IE6 and Opera, but incorrectly on Firefox:

<text style="font-size:14px;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Arial">
   <tspan x="20" y="25">generic blah</tspan>
   <tspan x="20" dy='70px'>(blah blah <tspan style="fill:#0024d0">WP:NOT</tspan>, etc)</tspan>
</text>

DOES NOT WORK

However if the second line is not written using nested tspans (ie each tspan element closes and then reopens), it renders correctly on both:

<text style="font-size:14px;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Arial">
   <tspan x="20" y="25">generic blah</tspan>
   <tspan x="20" dy='70px'>(blah blah </tspan><tspan style="fill:#0024d0">WP:NOT</tspan><tspan>, etc)</tspan>
</text>

WORKS


More specifically, the bug is that in the first example, Firefox has the inner <tspan> inherit the dy="70px" of the outer, and hence an extra 70px line break is inserted which was not requested. Somwhat surprisingly though (and perhaps another bug??) explicitly stating dy="0px" in the inner <tspan> of the initial example does not actually fix it.

Needs reporting to Mozilla for fixing.

Workaround: Do not use nested tspan elements in SVGs. Close the first <tspan> then reopen a second one immediately. The correct x and y positions will be remembered and used.
Comment 1 FT2 2008-04-01 18:47:06 UTC
Reworking nested <tspan> elements also seems to fix a second bug whereby the text is incorrectly positioned on the page too.
Comment 2 FT2 2008-04-01 18:57:14 UTC
Crossref bug 333698 at Mozilla:

https://bugzilla.mozilla.org/show_bug.cgi?id=333698
"nested tspan don't inherit coordinate x and y properties correctly"
Comment 3 FT2 2008-04-01 18:57:39 UTC
(previously known bug there, not new)
Comment 4 Raimond Spekking 2008-04-01 19:01:20 UTC
In which kind is this bug related to MediaWiki itself? MediaWiki renders SVG and displays PNG always. Closing this bug as INVALID. Please reopen it if MediaWiki's SVG renderer is buggy.

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


Navigation
Links