Bug 45259 - SVG drawing freeze
: SVG drawing freeze
Status: UNCONFIRMED
: WebKit
SVG
: 525.x (Safari 3.2)
: PC Windows 7
: P2 Normal
Assigned To:
: http://www.mappetizer.de/en/examples/...
:
: 45389
:
  Show dependency treegraph
 
Reported: 2010-09-06 05:18 PST by
Modified: 2010-09-08 08:27 PST (History)


Attachments


Note

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


Description From 2010-09-06 05:18:15 PST
The problem occurs in Safari and in Chrome

If you check and uncheck layers in the legend, then you see that the legend part is changing and the layer is visible/unvisible in the map.
If you now change the tab to tools and then go back to legend you still see the legend. But if you check/uncheck a layer only the map part is updated but the legend part is not updated it is freezed

For the Tab we use Dojo Dijits. The handling is fine with Firefox, Opera and IE (with Adobe SVGViewer)

Thank you for looking at this problem

Armin
------- Comment #1 From 2010-09-08 08:21:39 PST -------
I investigated a bit using WebInspector.

It seems to me that there's a variable in mappetizer, that points to the SVGDocument contained in the <embed> object. When switching tabs the renderer is destroyed, and recreated as soon as you switch back to the "legend" tab again. But the variable in JS still references the "old" document from the first load.

When constructing the renderer, it will requiest the embedded SVG, parse the DOM, and attach to our render tree - that means a new document is created - and your JS still points to the old one.

If Dojo would use visibility instead of display, I guess you wouldn't see any bugs.
------- Comment #2 From 2010-09-08 08:27:01 PST -------
function mv_testEmbedLegend() {
    try {
        //Problem, wenn Legende in Tab und erster Tab ist nicht Legende(also nicht sichtbar),
        //dann kommt Opera, Safari.... nicht an das SVGDocument
        var svgDoc = dojo.byId("MVlegendDoc").getSVGDocument();
        if (svgDoc == null) {
            // Endlosschleife
            if (dojo.byId("MVtabContainer")) {
                dijit.byId("MVtabContainer").selectChild("MVlegend");
            }
            mv_checkLegendLoaded();
        }
        else {
            mv_Map.Legend = svgDoc;
...

This is the culprit. The mv_Map.Legend is only cached once.
Which is perfectly fine, but as WebKit recreates the embedded document, upon switching tabs, you're doomed.