diff --git a/docs/content/error/$httpBackend/noxhr.ngdoc b/docs/content/error/$httpBackend/noxhr.ngdoc deleted file mode 100644 index e2d5901d72ea..000000000000 --- a/docs/content/error/$httpBackend/noxhr.ngdoc +++ /dev/null @@ -1,10 +0,0 @@ -@ngdoc error -@name $httpBackend:noxhr -@fullName Unsupported XHR -@description - -This error occurs in browsers that do not support XmlHttpRequest. AngularJS -supports Safari, Chrome, Firefox, Opera, IE8 and higher, and mobile browsers -(Android, Chrome Mobile, iOS Safari). To avoid this error, use an officially -supported browser. - diff --git a/docs/content/error/$sce/iequirks.ngdoc b/docs/content/error/$sce/iequirks.ngdoc deleted file mode 100644 index 08afbf66faa2..000000000000 --- a/docs/content/error/$sce/iequirks.ngdoc +++ /dev/null @@ -1,17 +0,0 @@ -@ngdoc error -@name $sce:iequirks -@fullName IE8 in quirks mode is unsupported -@description - -This error occurs when you are using AngularJS with {@link ng.$sce Strict Contextual Escaping (SCE)} mode enabled (the default) on IE8 or lower in quirks mode. - -In this mode, IE8 allows one to execute arbitrary javascript by the use of the `expression()` syntax and is not supported. -Refer -[MSDN Blogs > IEBlog > Ending Expressions](http://blogs.msdn.com/b/ie/archive/2008/10/16/ending-expressions.aspx) -to learn more about them. - -To resolve this error please specify the proper doctype at the top of your main html document: - -``` - -``` diff --git a/src/ng/compile.js b/src/ng/compile.js index 95d07518011b..3676d309af8b 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -1218,37 +1218,35 @@ function $CompileProvider($provide, $$sanitizeUriProvider) { var attrEndName = false; attr = nAttrs[j]; - if (!msie || msie >= 8 || attr.specified) { - name = attr.name; - value = trim(attr.value); - - // support ngAttr attribute binding - ngAttrName = directiveNormalize(name); - if (isNgAttr = NG_ATTR_BINDING.test(ngAttrName)) { - name = snake_case(ngAttrName.substr(6), '-'); - } + name = attr.name; + value = trim(attr.value); - var directiveNName = ngAttrName.replace(/(Start|End)$/, ''); - if (directiveIsMultiElement(directiveNName)) { - if (ngAttrName === directiveNName + 'Start') { - attrStartName = name; - attrEndName = name.substr(0, name.length - 5) + 'end'; - name = name.substr(0, name.length - 6); - } - } + // support ngAttr attribute binding + ngAttrName = directiveNormalize(name); + if (isNgAttr = NG_ATTR_BINDING.test(ngAttrName)) { + name = snake_case(ngAttrName.substr(6), '-'); + } - nName = directiveNormalize(name.toLowerCase()); - attrsMap[nName] = name; - if (isNgAttr || !attrs.hasOwnProperty(nName)) { - attrs[nName] = value; - if (getBooleanAttrName(node, nName)) { - attrs[nName] = true; // presence means true - } + var directiveNName = ngAttrName.replace(/(Start|End)$/, ''); + if (directiveIsMultiElement(directiveNName)) { + if (ngAttrName === directiveNName + 'Start') { + attrStartName = name; + attrEndName = name.substr(0, name.length - 5) + 'end'; + name = name.substr(0, name.length - 6); } - addAttrInterpolateDirective(node, directives, value, nName, isNgAttr); - addDirective(directives, nName, 'A', maxPriority, ignoreDirective, attrStartName, - attrEndName); } + + nName = directiveNormalize(name.toLowerCase()); + attrsMap[nName] = name; + if (isNgAttr || !attrs.hasOwnProperty(nName)) { + attrs[nName] = value; + if (getBooleanAttrName(node, nName)) { + attrs[nName] = true; // presence means true + } + } + addAttrInterpolateDirective(node, directives, value, nName, isNgAttr); + addDirective(directives, nName, 'A', maxPriority, ignoreDirective, attrStartName, + attrEndName); } // use class as directive diff --git a/src/ng/directive/a.js b/src/ng/directive/a.js index 850d7d6d3093..eef5e2ddd96c 100644 --- a/src/ng/directive/a.js +++ b/src/ng/directive/a.js @@ -16,22 +16,6 @@ var htmlAnchorDirective = valueFn({ restrict: 'E', compile: function(element, attr) { - - if (msie <= 8) { - - // turn link into a stylable link in IE - // but only if it doesn't have name attribute, in which case it's an anchor - if (!attr.href && !attr.name) { - attr.$set('href', ''); - } - - // add a comment node to anchors to workaround IE bug that causes element content to be reset - // to new attribute content if attribute is updated with value containing @ and element also - // contains value with @ - // see issue #1949 - element.append(document.createComment('IE fix')); - } - if (!attr.href && !attr.xlinkHref && !attr.name) { return function(scope, element) { // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute. diff --git a/src/ng/httpBackend.js b/src/ng/httpBackend.js index 78d04cfa24b9..9fad535eebb2 100644 --- a/src/ng/httpBackend.js +++ b/src/ng/httpBackend.js @@ -1,17 +1,8 @@ 'use strict'; -function createXhr(method) { - //if IE and the method is not RFC2616 compliant, or if XMLHttpRequest - //is not available, try getting an ActiveXObject. Otherwise, use XMLHttpRequest - //if it is available - if (msie <= 8 && (!method.match(/^(get|post|head|put|delete|options)$/i) || - !window.XMLHttpRequest)) { - return new window.ActiveXObject("Microsoft.XMLHTTP"); - } else if (window.XMLHttpRequest) { - return new window.XMLHttpRequest(); - } - - throw minErr('$httpBackend')('noxhr', "This browser does not support XMLHttpRequest."); +// TODO: inline the constructor call and remove this helper method +function createXhr() { + return new window.XMLHttpRequest(); } /** @@ -59,7 +50,7 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc }); } else { - var xhr = createXhr(method); + var xhr = createXhr(); xhr.open(method, url, true); forEach(headers, function(value, key) { diff --git a/src/ng/sanitizeUri.js b/src/ng/sanitizeUri.js index faceda8f56de..ff1e160540f5 100644 --- a/src/ng/sanitizeUri.js +++ b/src/ng/sanitizeUri.js @@ -60,14 +60,12 @@ function $$SanitizeUriProvider() { this.$get = function() { return function sanitizeUri(uri, isImage) { var regex = isImage ? imgSrcSanitizationWhitelist : aHrefSanitizationWhitelist; - var normalizedVal; - // NOTE: urlResolve() doesn't support IE < 8 so we don't sanitize for that case. - if (!msie || msie >= 8 ) { - normalizedVal = urlResolve(uri).href; - if (normalizedVal !== '' && !normalizedVal.match(regex)) { - return 'unsafe:'+normalizedVal; - } + var normalizedVal = urlResolve(uri).href; + + if (normalizedVal !== '' && !normalizedVal.match(regex)) { + return 'unsafe:'+normalizedVal; } + return uri; }; }; diff --git a/src/ng/sce.js b/src/ng/sce.js index 4a002f941740..dcc11e65d991 100644 --- a/src/ng/sce.js +++ b/src/ng/sce.js @@ -729,14 +729,6 @@ function $SceProvider() { this.$get = ['$parse', '$sniffer', '$sceDelegate', function( $parse, $sniffer, $sceDelegate) { - // Prereq: Ensure that we're not running in IE8 quirks mode. In that mode, IE allows - // the "expression(javascript expression)" syntax which is insecure. - if (enabled && $sniffer.msie && $sniffer.msieDocumentMode < 8) { - throw $sceMinErr('iequirks', - 'Strict Contextual Escaping does not support Internet Explorer version < 9 in quirks ' + - 'mode. You can fix this by adding the text to the top of your HTML ' + - 'document. See http://docs.angularjs.org/api/ng.$sce for more information.'); - } var sce = shallowCopy(SCE_CONTEXTS); diff --git a/test/ng/sceSpecs.js b/test/ng/sceSpecs.js index 9b57eb36eed4..d174a048fbcf 100644 --- a/test/ng/sceSpecs.js +++ b/test/ng/sceSpecs.js @@ -26,62 +26,6 @@ describe('SCE', function() { })); }); - describe('IE8 quirks mode', function() { - function runTest(enabled, documentMode, expectException) { - module(function($provide) { - $provide.value('$sniffer', { - msie: documentMode, - msieDocumentMode: documentMode - }); - $provide.value('$sceDelegate', {trustAs: null, valueOf: null, getTrusted: null}); - }); - - inject(function($window, $injector) { - function constructSce() { - /* global $SceProvider: false */ - var sceProvider = new $SceProvider(); - sceProvider.enabled(enabled); - return $injector.invoke(sceProvider.$get, sceProvider); - } - - if (expectException) { - expect(constructSce).toThrowMinErr( - '$sce', 'iequirks', 'Strict Contextual Escaping does not support Internet Explorer ' + - 'version < 9 in quirks mode. You can fix this by adding the text to ' + - 'the top of your HTML document. See http://docs.angularjs.org/api/ng.$sce for more ' + - 'information.'); - } else { - // no exception. - constructSce(); - } - }); - } - - it('should throw an exception when sce is enabled in quirks mode', function() { - runTest(true, 7, true); - }); - - it('should NOT throw an exception when sce is enabled and in standards mode', function() { - runTest(true, 8, false); - }); - - it('should NOT throw an exception when sce is enabled and documentMode is undefined', function() { - runTest(true, undefined, false); - }); - - it('should NOT throw an exception when sce is disabled even when in quirks mode', function() { - runTest(false, 7, false); - }); - - it('should NOT throw an exception when sce is disabled and in standards mode', function() { - runTest(false, 8, false); - }); - - it('should NOT throw an exception when sce is disabled and documentMode is undefined', function() { - runTest(false, undefined, false); - }); - }); - describe('when enabled', function() { it('should wrap string values with TrustedValueHolder', inject(function($sce) { var originalValue = 'original_value';