Closed
Bug 602854
Opened 14 years ago
Closed 11 years ago
Bad rendering SVG via XSLT over JavaScript API
Categories
(Core :: SVG, defect)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: hynek.musil, Unassigned)
References
()
Details
(Keywords: testcase)
Attachments
(2 files)
1.75 KB,
text/html
|
Details | |
4.84 KB,
patch
|
Details | Diff | Splinter Review |
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"/>
...
Updated•14 years ago
|
Component: General → SVG
Product: Firefox → Core
QA Contact: general → general
Version: unspecified → Trunk
Comment 1•14 years ago
|
||
Comment 2•14 years ago
|
||
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?
Comment 3•14 years ago
|
||
Oh, the XSLT thing wouldn't help because getSource parses the SVG via the normal XML parser, so will in fact create SVG elements.
Comment 4•14 years ago
|
||
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
Comment 5•14 years ago
|
||
Maybe we should just take this as-is, even....
Comment 6•14 years ago
|
||
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.
Reporter | ||
Comment 7•14 years ago
|
||
It's ok, thanks :-)
Comment 9•11 years ago
|
||
comment 2 works so I'm assuming this is fixed.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
Updated•11 years ago
|
Flags: needinfo?(jwatt)
You need to log in
before you can comment on or make changes to this bug.
Description
•