Bug 45259 - SVG drawing freeze
Summary: SVG drawing freeze
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 525.x (Safari 3.2)
Hardware: PC Windows 7
: P2 Normal
Assignee: Nobody
URL: http://www.mappetizer.de/en/examples/...
Depends on: 45389
  Show dependency treegraph
Reported: 2010-09-06 05:18 PDT by Armin Mueller
Modified: 2010-09-08 08:27 PDT (History)
2 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Armin Mueller 2010-09-06 05:18:15 PDT
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

Comment 1 Nikolas Zimmermann 2010-09-08 08:21:39 PDT
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 Nikolas Zimmermann 2010-09-08 08:27:01 PDT
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")) {
        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.