Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#14103 closed defect (fixed)

Calling dojo/domstyle.getComputedStyle on svg elements fails under IE9

Reported by: Patrick Ruzand Owned by: Kenneth G. Franqueiro
Priority: high Milestone: 1.5.2
Component: Core Version: 1.5
Keywords: Cc: cjolif
Blocked By: Blocking:

Description

Calling dojo/domstyle.getComputedStyle on svg elements fails under IE9. The problem seems to come from the getComputedStyle impl., that assumes the currentStyle property is defined for all nodes of type Element under IEs:

}else if(has("ie")){

getComputedStyle = function(node){ IE (as of 7) doesn't expose Element like sane browsers return node.nodeType == 1 /* ELEMENT_NODE*/ ? node.currentStyle : {};

};

This is not true when the node is an SVG element. In this case, currentStyle is not defined (window.getComputedStyle shouldn't be used instead in the case currentStyle is undefined ?).

Attached a simple testcase to be put in the dojo distrib root directory. It works on the other browsers (FF7, Chrome).

Attachments (2)

getComputedStyle.html (967 bytes) - added by Patrick Ruzand 8 years ago.
test file, to be put in the dojo distrib root directory
getComputedStyle-1.6.html (845 bytes) - added by Kenneth G. Franqueiro 8 years ago.
version of test runnable against non-AMD versions of dojo

Download all attachments as: .zip

Change History (15)

Changed 8 years ago by Patrick Ruzand

Attachment: getComputedStyle.html added

test file, to be put in the dojo distrib root directory

comment:1 Changed 8 years ago by Adam Peller

should get this in as an automated test

comment:2 Changed 8 years ago by Adam Peller

Milestone: 1.71.7.1

comment:3 Changed 8 years ago by bill

Owner: set to Eugene Lazutkin

comment:4 Changed 8 years ago by Kenneth G. Franqueiro

Milestone: 1.7.11.8
Priority: highnormal

This bug is reproducible on older versions of dojo as well; bumping to 1.8 as such. I'll attach a version of the test that can reproduce this on 1.6.

Changed 8 years ago by Kenneth G. Franqueiro

Attachment: getComputedStyle-1.6.html added

version of test runnable against non-AMD versions of dojo

comment:5 Changed 8 years ago by Kenneth G. Franqueiro

I should clarify that if we do find a fix for this, I'd totally be for backporting it as far as we see fit for the sake of fixing browser compatibility.

comment:6 Changed 7 years ago by Patrick Ruzand

Note that this bug prevent the gfx bidi extension to run under IE9 (run the dojox/gfx/tests/_gfxBidiSupport/testBidi.html *in IE9 standard mode*)

comment:7 Changed 7 years ago by cjolif

Cc: cjolif added

comment:8 Changed 7 years ago by Adam Peller

Priority: normalhigh

comment:9 Changed 7 years ago by Kenneth G. Franqueiro

Milestone: 1.81.5.2
Owner: changed from Eugene Lazutkin to Kenneth G. Franqueiro
Status: newassigned
Version: 1.5

I'll be committing the fix for this as well as adding a test to dojo/tests/_base/html.html in trunk and branches for 1.5 through 1.7.

comment:10 Changed 7 years ago by Kenneth G. Franqueiro

Resolution: fixed
Status: assignedclosed

In [27116]:

Fix dojo.getComputedStyle code path for IE9; fixes #14103 on trunk

comment:11 Changed 7 years ago by Kenneth G. Franqueiro

In [27117]:

Fix dojo.getComputedStyle code path for IE9; fixes #14103 on 1.7 branch

comment:12 Changed 7 years ago by Kenneth G. Franqueiro

In [27118]:

Fix dojo.getComputedStyle code path for IE9; fixes #14103 on 1.5 branch !strict

comment:13 Changed 7 years ago by Kenneth G. Franqueiro

In [27119]:

Fix dojo.getComputedStyle code path for IE9; fixes #14103 on 1.6 branch !strict

Note: See TracTickets for help on using tickets.