Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
refactor(): remove more bits and pieces related to Internet Explorer 8
Browse files Browse the repository at this point in the history
Closes #12407
  • Loading branch information
realityking authored and Narretz committed Aug 7, 2015
1 parent 929ec6b commit 99d2c46
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/ng/httpBackend.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc
xhr.onload = function requestLoaded() {
var statusText = xhr.statusText || '';

// responseText is the old-school way of retrieving response (supported by IE8 & 9)
// responseText is the old-school way of retrieving response (supported by IE9)
// response/responseType properties were introduced in XHR Level2 spec (supported by IE10)
var response = ('response' in xhr) ? xhr.response : xhr.responseText;

Expand Down
2 changes: 1 addition & 1 deletion src/ng/location.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ function LocationHashbangInHtml5Url(appBase, appBaseNoFile, hashPrefix) {
hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';

this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;
// include hashPrefix in $$absUrl when $$url is empty so IE8 & 9 do not reload page because of removal of '#'
// include hashPrefix in $$absUrl when $$url is empty so IE9 does not reload page because of removal of '#'
this.$$absUrl = appBase + hashPrefix + this.$$url;
};

Expand Down
9 changes: 1 addition & 8 deletions src/ng/urlUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,13 @@ var originUrl = urlResolve(window.location.href);
*
* Implementation Notes for IE
* ---------------------------
* IE >= 8 and <= 10 normalizes the URL when assigned to the anchor node similar to the other
* IE <= 10 normalizes the URL when assigned to the anchor node similar to the other
* browsers. However, the parsed components will not be set if the URL assigned did not specify
* them. (e.g. if you assign a.href = "foo", then a.protocol, a.host, etc. will be empty.) We
* work around that by performing the parsing in a 2nd step by taking a previously normalized
* URL (e.g. by assigning to a.href) and assigning it a.href again. This correctly populates the
* properties such as protocol, hostname, port, etc.
*
* IE7 does not normalize the URL when assigned to an anchor node. (Apparently, it does, if one
* uses the inner HTML approach to assign the URL as part of an HTML snippet -
* http://stackoverflow.com/a/472729) However, setting img[src] does normalize the URL.
* Unfortunately, setting img[src] to something like "javascript:foo" on IE throws an exception.
* Since the primary usage for normalizing URLs is to sanitize such URLs, we can't use that
* method and IE < 8 is unsupported.
*
* References:
* http://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement
* http://www.aptana.com/reference/html/api/HTMLAnchorElement.html
Expand Down
2 changes: 1 addition & 1 deletion test/ng/httpBackendSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ describe('$httpBackend', function() {


it('should read responseText if response was not defined', function() {
// old browsers like IE8, don't support responseType, so they always respond with responseText
// old browsers like IE9, don't support responseType, so they always respond with responseText

$backend('GET', '/whatever', null, callback, {}, null, null, 'blob');

Expand Down
6 changes: 0 additions & 6 deletions test/ng/sceSpecs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@

describe('SCE', function() {

// Work around an IE8 bug. Though window.inject === angular.mock.inject, if it's invoked the
// window scope, IE8 loses the exception object that bubbles up and replaces it with a TypeError.
// By using a local alias, it gets invoked on the global scope instead of window.
// Ref: https://github.com/angular/angular.js/pull/4221#/issuecomment-25515813
var inject = angular.mock.inject;

describe('when disabled', function() {
beforeEach(function() {
module(function($sceProvider) {
Expand Down
6 changes: 0 additions & 6 deletions test/ngMock/angular-mocksSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -719,8 +719,6 @@ describe('ngMock', function() {

it('should serialize scope that has overridden "hasOwnProperty"', inject(function($rootScope, $sniffer) {
/* jshint -W001 */
// MS IE8 just doesn't work for this kind of thing, since "for ... in" doesn't return
// things like hasOwnProperty even if it is explicitly defined on the actual object!
$rootScope.hasOwnProperty = 'X';
expect(d($rootScope)).toMatch(/Scope\(.*\): \{/);
expect(d($rootScope)).toMatch(/hasOwnProperty: "X"/);
Expand Down Expand Up @@ -906,10 +904,6 @@ describe('ngMock', function() {
});


// We don't run the following tests on IE8.
// IE8 throws "Object does not support this property or method." error,
// when thrown from a function defined on window (which `inject` is).

it('should not change thrown Errors', inject(function($sniffer) {
expect(function() {
inject(function() {
Expand Down
3 changes: 1 addition & 2 deletions test/ngRoute/directive/ngViewSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,7 @@ describe('ngView', function() {

$location.url('/foo');
$rootScope.$digest();
// using toMatch because in IE8+jquery the space doesn't get preserved. jquery bug?
expect(element.text()).toMatch(/\s*WORKS/);
expect(element.text()).toEqual(' \n WORKS');

var div = element.find('div');
expect(div.parent()[0].nodeName.toUpperCase()).toBeOneOf('NG:VIEW', 'VIEW');
Expand Down

0 comments on commit 99d2c46

Please sign in to comment.