Closed Bug 602854 Opened 14 years ago Closed 11 years ago

Bad rendering SVG via XSLT over JavaScript API

Categories

(Core :: SVG, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: hynek.musil, Unassigned)

References

()

Details

(Keywords: testcase)

Attachments

(2 files)

User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:2.0b8pre) Gecko/20101007 Firefox/4.0b8pre Build Identifier: Mozilla/5.0 (Windows NT 5.1; rv:2.0b8pre) Gecko/20101007 Firefox/4.0b8pre The test is on the page: http://test.formax.cz/xslt-svg-bug/ In the onload XSLT transformation starts: ... <xsl:template match="/*"> <xsl:variable name="x1" select="10"/> <xsl:variable name="y1" select="10"/> <svg height="100" width="100" xmlns="http://www.w3.org/2000/svg"> <polyline points="0,0 {$x1},{$y1}"/> </svg> </xsl:template> Javascript: ... var fragment = stylesheetProc.transformToFragment(xmlDoc, document); document.body.appendChild(fragment); ... Reproducible: Always Steps to Reproduce: 1. Test is on the page: http://test.formax.cz/xslt-svg-bug/ Actual Results: ... <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><style type="text/css"> <polyline points="0,0"/> ... Expected Results: ... <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><style type="text/css"> <polyline points="0,0 10,10"/> ...
Component: General → SVG
Product: Firefox → Core
QA Contact: general → general
Version: unspecified → Trunk
Presumably because SVG normalizes attribute values, right? Testcase: data:text/html,<svg height="100" width="100" xmlns="http://www.w3.org/2000/svg"><polyline points="0,0 {$x1},{$y1}"/></svg><script>alert(document.getElementsByTagName("polyline")[0].getAttribute("points"))</script> I believe the XSLT folks want to start using generic XML for the templates for this reason, but should we really lose the original value of @points there?
Oh, the XSLT thing wouldn't help because getSource parses the SVG via the normal XML parser, so will in fact create SVG elements.
nsSVGNumberList::SetValueString will happily parse whatever and return NS_OK. So we never end up using the proxy value stuff. Seems like we should be able to remove the proxy value business and just use the same setup as style attributes, right? And make SetValueString pass the string to DidModify even on error conditions so the SetAttr call that gets made there will actually save the right value?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Maybe we should just take this as-is, even....
Blocks: 609527
The combination of bug 610990 followed by bug 630083 should have fixed this, I think. Maybe we should still be adding a test before closing this though.
It's ok, thanks :-)
Is it fixed?
Flags: needinfo?(jwatt)
comment 2 works so I'm assuming this is fixed.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
Flags: needinfo?(jwatt)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: