Add Support for IE11
Brought to you by:
mbatsis
Internet Explorer 11 has a different user agent.
I suggest to drop the need for document.all && window.ActiveXObject, just rely on the user agent - msie or trident for IE (like ExtJS, see http://docs.sencha.com/extjs/4.2.2/source/Ext-more.html):
Change in Sarissa.js line 64ff.
Sarissa._SARISSA_IS_IE = (navigator.userAgent.toLowerCase().indexOf("msie") > -1 || navigator.userAgent.toLowerCase().indexOf("trident") > -1) && navigator.userAgent.toLowerCase().indexOf("opera") == -1;
/** @private IE9, IE10 or IE11 (also correct identification of compatibility mode/view) */
Sarissa._SARISSA_IS_IE9 = Sarissa._SARISSA_IS_IE && (navigator.userAgent.toLowerCase().indexOf("msie 9") > -1 || navigator.userAgent.toLowerCase().indexOf("msie 10") > -1 || navigator.userAgent.toLowerCase().indexOf("trident/7.0") > -1 || document.documentMode >= 9);
Have you tried the unittests [1] with this?
[1] sarissa/src/site/resources/test/testsarissa.html
I run the unittests now.
They work mostly (at least better than without the patch).
IE 11 does not support load() anymore, so use the following instead of line 84 in SarissaTestCase().testGetParseErrorTextError():
// load (using ajax) instead of oDom.load(url)
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", "test-bad.xml", false);
xmlhttp.send(null);
oDom = xmlhttp.responseXML;
The load function needs to be replaces in XMLDocumentTestCase().testLoad() as well.
But still 2 tests fail in IE11 emulating IE9:
XSLTProcessorTestCase Results
++F++++F
8 tests ran in 175.89 seconds
XSLTProcessorTestCase.testOutputXml2, exception Assertion failed: div != #comment
XSLTProcessorTestCase.testFragment2, exception Assertion failed: HR != #text
and the same fail in IE11 and IE11 emulating IE10:
XSLTProcessorTestCase Results
++F++++F
8 tests ran in 3.167 seconds
XSLTProcessorTestCase.testOutputXml2, exception TypeError: Die Eigenschaft "indexOf" eines undefinierten oder Nullverweises kann nicht abgerufen werden.
XSLTProcessorTestCase.testFragment2, exception TypeError: Die Eigenschaft "indexOf" eines undefinierten oder Nullverweises kann nicht abgerufen werden.
Sorry - I don't know what might go wrong here.
Why bother checking for IE10/11 userAgent. Only IE has document.documentMode
Sarissa._SARISSA_IS_IE = document.documentMode != null;
/* @private IE9, IE10 or IE11 (also correct identification of compatibility mode/view) /
Sarissa._SARISSA_IS_IE9 = Sarissa._SARISSA_IS_IE && document.documentMode >= 9;
tested on IE9,10 11 and committed to cvs.
Thanks for your help.
Hi guys! can you tell me where cai I found the fixed file por IE11? Thanks a lot!!
fixed in CVS