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

Commit a2adfae

Browse files
committed
chore(IE8) Remove more special code for IE8
1 parent 056a317 commit a2adfae

File tree

7 files changed

+10
-37
lines changed

7 files changed

+10
-37
lines changed

src/Angular.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,7 @@ function forEach(obj, iterator, context) {
246246
if (obj) {
247247
if (isFunction(obj)) {
248248
for (key in obj) {
249-
// Need to check if hasOwnProperty exists,
250-
// as on IE8 the result of querySelectorAll is an object without a hasOwnProperty function
251-
if (key != 'prototype' && key != 'length' && key != 'name' && (!obj.hasOwnProperty || obj.hasOwnProperty(key))) {
249+
if (key != 'prototype' && key != 'length' && key != 'name' && obj.hasOwnProperty(key)) {
252250
iterator.call(context, obj[key], key, obj);
253251
}
254252
}

src/jqLite.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,9 @@ function jqLiteClone(element) {
256256
function jqLiteDealoc(element, onlyDescendants) {
257257
if (!onlyDescendants) jqLiteRemoveData(element);
258258

259-
if (element.querySelectorAll) {
260-
var descendants = element.querySelectorAll('*');
261-
for (var i = 0, l = descendants.length; i < l; i++) {
262-
jqLiteRemoveData(descendants[i]);
263-
}
259+
var descendants = element.querySelectorAll('*');
260+
for (var i = 0, l = descendants.length; i < l; i++) {
261+
jqLiteRemoveData(descendants[i]);
264262
}
265263
}
266264

src/ng/httpBackend.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc
5858
xhr.onload = function requestLoaded() {
5959
var statusText = xhr.statusText || '';
6060

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

src/ng/location.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ function LocationHashbangInHtml5Url(appBase, hashPrefix) {
309309
hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';
310310

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

src/ng/urlUtils.js

+1-8
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,13 @@ var originUrl = urlResolve(window.location.href);
2424
*
2525
* Implementation Notes for IE
2626
* ---------------------------
27-
* IE >= 8 and <= 10 normalizes the URL when assigned to the anchor node similar to the other
27+
* IE <= 11 normalizes the URL when assigned to the anchor node similar to the other
2828
* browsers. However, the parsed components will not be set if the URL assigned did not specify
2929
* them. (e.g. if you assign a.href = "foo", then a.protocol, a.host, etc. will be empty.) We
3030
* work around that by performing the parsing in a 2nd step by taking a previously normalized
3131
* URL (e.g. by assigning to a.href) and assigning it a.href again. This correctly populates the
3232
* properties such as protocol, hostname, port, etc.
3333
*
34-
* IE7 does not normalize the URL when assigned to an anchor node. (Apparently, it does, if one
35-
* uses the inner HTML approach to assign the URL as part of an HTML snippet -
36-
* http://stackoverflow.com/a/472729) However, setting img[src] does normalize the URL.
37-
* Unfortunately, setting img[src] to something like "javascript:foo" on IE throws an exception.
38-
* Since the primary usage for normalizing URLs is to sanitize such URLs, we can't use that
39-
* method and IE < 8 is unsupported.
40-
*
4134
* References:
4235
* http://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement
4336
* http://www.aptana.com/reference/html/api/HTMLAnchorElement.html

src/ngAnimate/animate.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,8 @@ angular.module('ngAnimate', ['ng'])
420420
})
421421

422422
//this private service is only used within CSS-enabled animations
423-
//IE8 + IE9 do not support rAF natively, but that is fine since they
424-
//also don't support transitions and keyframes which means that the code
423+
//IE9 does not support rAF natively, but that is fine since they
424+
//also doesn't support transitions and keyframes which means that the code
425425
//below will never be used by the two browsers.
426426
.factory('$$animateReflow', ['$$rAF', '$document', function($$rAF, $document) {
427427
var bod = $document[0].body;
@@ -1296,7 +1296,7 @@ angular.module('ngAnimate', ['ng'])
12961296
//skip the animation if animations are disabled, a parent is already being animated,
12971297
//the element is not currently attached to the document body or then completely close
12981298
//the animation if any matching animations are not found at all.
1299-
//NOTE: IE8 + IE9 should close properly (run closeAnimation()) in case an animation was found.
1299+
//NOTE: IE9 should close properly (run closeAnimation()) in case an animation was found.
13001300
if (animationsDisabled(element, parentElement)) {
13011301
fireDOMOperation();
13021302
fireBeforeCallbackAsync();

test/AngularSpec.js

-16
Original file line numberDiff line numberDiff line change
@@ -827,22 +827,6 @@ describe('angular', function() {
827827
expect(log).toEqual(['0:a', '1:c']);
828828
});
829829

830-
if (document.querySelectorAll) {
831-
it('should handle the result of querySelectorAll in IE8 as it has no hasOwnProperty function', function() {
832-
document.body.innerHTML = "<p>" +
833-
"<a name='x'>a</a>" +
834-
"<a name='y'>b</a>" +
835-
"<a name='x'>c</a>" +
836-
"</p>";
837-
838-
var htmlCollection = document.querySelectorAll('[name="x"]'),
839-
log = [];
840-
841-
forEach(htmlCollection, function(value, key) { log.push(key + ':' + value.innerHTML); });
842-
expect(log).toEqual(['0:a', '1:c']);
843-
});
844-
}
845-
846830
it('should handle arguments objects like arrays', function() {
847831
var args,
848832
log = [];

0 commit comments

Comments
 (0)