chunhaicao / svgweb

Automatically exported from code.google.com/p/svgweb
Other
0 stars 0 forks source link

IE11 is not recognized as IE in svgweb code #664

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Run website in IE11 that utilizes the svgweb .js library
2.Notice that isIE is always false
3.

What is the expected output? What do you see instead?
Expect to be able to interact with svg objects through javascript (eg. 
getElementById('id') should return a dom element)
Instead we are getting an error that says object doesn't support property or 
method 'setAttributeNS' 

What version of the product are you using? On what operating system,
browser, and version of Flash?
Version is from here: svgweb-2011-02-03-Lurker-Above.zip    
OS is Windows7
Broswer is IE11
Flash version is 11.9.900.117

Please provide any additional information below. Reduced test cases are
always appreciated!

Original issue reported on code.google.com by craftbee...@gmail.com on 10 Dec 2013 at 4:52

GoogleCodeExporter commented 9 years ago
I've updated the browser detection code to recognize IE11 as IE, however that 
created several issues where methods like attachEvent etc... are being used. I 
added an isIE11 check in these places to use attachEventListener etc... Finally 
I'm to the point where it the code erros here:
        // This code is for crashing exception in Opera
        // that occurs with scripts running in relation
        // to an object that is unloaded.
        console.log("Call to flash but flash is not present! " +
                    invoke + ": " + this.debugMsg(message) + ": "+exp); 

Original comment by craftbee...@gmail.com on 10 Dec 2013 at 5:01

GoogleCodeExporter commented 9 years ago
It seems leaving the isIE property alone and creating a separate isIE11 
property was the key. Most places where there is an isIE check it is good that 
IE11 isn't recognized. However in the instances where there is some sort of 
setAttributeNS, getAttributeNS or etc... if the IE path isn't followed IE11 
will throw an error. So in these situations I've added an isIE11 check. So for 
example there will be:
 if(isIE || isIE11){code} 
or 
 if (!isIE && !isIE11){code}

I'm attaching an updated version of the uncompressed svg.js file.

Original comment by craftbee...@gmail.com on 10 Dec 2013 at 9:22

Attachments: