Closed Bug 304334 Opened 19 years ago Closed 19 years ago

Wrong SVG displayed on reloading via innerHTML in secondary window

Categories

(Core :: SVG, defect)

1.8 Branch
x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: w.langdon, Unassigned)

Details

(Keywords: qawanted)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b3) Gecko/20050712 Firefox/1.0+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b3) Gecko/20050712 Firefox/1.0+

Javascript creates a new window containing a table etc. which are created using
w.document.write(). One colume of the table (4 or more rows) is created using
w.document.write("<td id=\"flk"+ i +"\">"+
	     <TABLE BORDER=1"+" "+
	        "BORDERCOLOR=\""+"WHITE"+"\""+
	        "><TR><TD>"+
                "<img name=\"idot"+ i +"\" src=\""+"snow.gif"+"\" border=\"0\">";	+
	        "</TD></TR></TABLE>
		     "</td>");
All appears well and the window is displayed, including snow.gif (4 times).

Some time later <img...> is replaced using
w.document.getElementById("flk"+i).innerHTML = txt;
where txt contains 
         "<object" + //" name=\"idot"+ I   +
         " type=\"image/svg+xml\""         +
         " data=\"data:image/svg+xml," + encodeURI(src) +"\"" +
         " width=\"" +width +"\"" +
         " height=\""+height+"\"" +
         "></object>"
All still appears well and the SVG graphic in text string src is displayed. Note
this is done for each row and each row displays a its own unique SVG graphic.

Some time later innerHTML for the first row is updated with a brand new SVG.
And SVG graphic for the last row is displayed in the first row!
This can be verified by right clicking on it using this frame| show frame source
and manulaly inspecting the contents of the SVG. Note I also change the colour
of the border from WHITE to BLUE in the same operation and this change does
appear in the window.

Reproducible: Always

Actual Results:  
SVG graphic in first row updated BUT with SVG graphic from last row.
Ie last SVG now appears in both 1st and last row. 

Expected Results:  
Display of new SVG graphic in first row.

I have crashed Deerpark repeatedly:-(
I think as a result it is corrupted and no longer talks to its javascript console
(see bug 286444)
WindowsNT 5.1 Service Pack 2 

Problem not observed when using innerHTML of <DIV> on main window without <TABLE>

Problem is also oberved when using <DIV> innerHTML inside table in secondary window.
Could you attach a testcase, or put somewhere an url online where we can see the
bug occuring? Thanks.

> I have crashed Deerpark repeatedly:-(
You mean crashed with the testcase? Do you have talkback ID's?
(In reply to comment #1)
> Could you attach a testcase, or put somewhere an url online where we can see the
> bug occuring? Thanks.
> 
> > I have crashed Deerpark repeatedly:-(
> You mean crashed with the testcase? Do you have talkback ID's?

Sorry I should have been clearer. Deerpark+SVG has crashed WindowsNT several
times in the past. I have got windows message saying "ialmrnt5 display has
stopped working normally". I think this has nothing to do with the current bug.
However, since the javascript console is now permantly:-( broken, I cannot
report any diagnostic error message that _might_ have appeared on it.
(In reply to comment #1)
> Could you attach a testcase, or put somewhere an url online where we can see the
> bug occuring? Thanks.

I just hacked together 
http://www.cs.ucl.ac.uk/staff/W.Langdon/demo_304334.html
When you press the press me button, the secondary window will be created.
Scroll it sideways untill you get to the colume labbelled "Chromosome".
Editing that will cause the SVG to be recalculated and rotated. The new SVG
should then be displayed. BUT the svg in the last row is displayed not the new
one. Check it out using view frame|frame source
Component: General → SVG
Product: Firefox → Core
Version: unspecified → 1.8 Branch
I tried following the steps in comment 3, but I can't tell what I'm supposed to edit where and how....
Keywords: qawanted
(In reply to comment #4)
> I tried following the steps in comment 3, but I can't tell what I'm supposed to
> edit where and how....
Sorry this example is a bit of a mess.
I will try and make a simplier example which shows the problem.
Thanks
Bill
(In reply to comment #5)

Dear Boris,
           Problem has gone away:-) 
Problem does not appear with deerpark alpha 2 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20051119 Firefox/1.6a1
after I fixed my example (http://www.cs.ucl.ac.uk/staff/W.Langdon/demo_304334.html
new version is: 23 November 2005 Revision: 1.111)

Once again many thanks

Bill

PS: SVG fractals are very faint:-(
    I think this may be due to known bug 314063 tiger.svg not properly displayed


Ah, ok.  Marking worksforme per comments.  Thanks for retesting, Bill!
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.