Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#14288 closed defect (fixed)

Loading a custom layer that includes gfx fails under IE7/8

Reported by: Patrick Ruzand Owned by: Patrick Ruzand
Priority: high Milestone: 1.7.1
Component: DojoX GFX Version: 1.6.1
Keywords: Cc:
Blocked By: Blocking:

Description

If a custom layer file is created that includes dojox.gfx.canvas, and that layer file is loaded on a browser which doesn't properly support the canvas element, then the following code will cause the layer file evaluation to stop and an Error is raised:

if(typeof dojo.doc.createElement("canvas").getContext("2d").fillText != "function"){
    canvas.Text.extend({
        getTextWidth: function(){
            return 0;
        },
        _renderShape: function(){}
    });
}

Specifically, IE browsers break on the call to getContext. This is problematic primarily because this code will run regardless of whether the browser supports canvas or not

Attachments (1)

test_loadCanvas.html (1.1 KB) - added by Patrick Ruzand 8 years ago.
testcase

Download all attachments as: .zip

Change History (3)

Changed 8 years ago by Patrick Ruzand

Attachment: test_loadCanvas.html added

testcase

comment:1 Changed 8 years ago by Patrick Ruzand

Resolution: fixed
Status: newclosed

In [27084]:

fillText API detection code should check canvas is supported by the browser first, fixes #14288

comment:2 Changed 8 years ago by Patrick Ruzand

In [27085]:

fillText API detection code should check canvas is supported by the browser first, refs #14288

Note: See TracTickets for help on using tickets.