Closed Bug 398513 Opened 17 years ago Closed 17 years ago

No change in page if svg:polyline is dynamicly added to svg:svg with javascript.

Categories

(Firefox :: General, defect)

x86
Windows Vista
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 354318

People

(Reporter: tiomeg1, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; sv-SE; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; sv-SE; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6

If you run this javascript the new polyline will not show up in the svg-window.
If you look in the DOM-tree of the 'canvas' with firebug it won't be there eighter. But if you look at the innerHTML of the entire document the polyline will be there! And if you copy the markup generated by the js and save it as a pure xml-file(no js) the polyline will be visible.

    var newLine = document.createElement('polyline');
    newLine.setAttribute('points', x + ', ' + y);
    newLine.setAttribute('style', 'fill: none; stroke: black; stroke-width: ' + w +';');
    document.getElementById("canvas").appendChild(newLine);  

====================================================
I know that one point won't be visible but I add more points later and the above code is enough to show that the DOM-tree won't be updated.


this is the svg-file:
<?xml version="1.0" ?>
<svg id="canvas" width="600px" height="400px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  <defs>
    <script type="text/javascript" xlink:href="paint.js"></script>  
  </defs>
</svg>

Don't think there should be anything wrong with my code, it works perfect in opera.

Reproducible: Always

Steps to Reproduce:
See details
Actual Results:  
No polyline added to the svg

Expected Results:  
Polyline added to the svg
You need to use createElementNS.
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.