-
Notifications
You must be signed in to change notification settings - Fork 27.4k
chore(*): cleanup msie handling; add support comments #15407
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1127,7 +1127,8 @@ describe('$compile', function() { | |
expect(element).toHaveClass('class_2'); | ||
})); | ||
|
||
if (!msie || msie > 11) { | ||
// Support: IE 9-11 only | ||
if (!msie) { | ||
// style interpolation not working on IE (including IE11). | ||
it('should handle interpolated css style from replacing directive', inject( | ||
function($compile, $rootScope) { | ||
|
@@ -10698,6 +10699,8 @@ describe('$compile', function() { | |
expect(element.text()).toBe('102030'); | ||
expect(newWatcherCount).toBe(3); | ||
|
||
// Support: IE 11 only | ||
// See #11781 and #14924 | ||
if (msie === 11) { | ||
expect(element.find('ng-transclude').contents().length).toBe(1); | ||
} | ||
|
@@ -10719,9 +10722,10 @@ describe('$compile', function() { | |
expect(element.attr('src')).toEqual('http://example.com/image2.png'); | ||
})); | ||
|
||
// Support: IE 9 only | ||
// IE9 rejects the video / audio tag with "Error: Not implemented" and the source tag with | ||
// "Unable to get value of the property 'childNodes': object is null or undefined" | ||
if (!msie || msie > 9) { | ||
if (msie !== 9) { | ||
they('should NOT require trusted values for $prop src', ['video', 'audio'], | ||
function(tag) { | ||
inject(function($rootScope, $compile, $sce) { | ||
|
@@ -11154,6 +11158,8 @@ describe('$compile', function() { | |
})); | ||
}); | ||
|
||
// Support: IE 9-10 only | ||
// IE <=11 don't support srcdoc | ||
if (!msie || msie >= 11) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could be |
||
describe('iframe[srcdoc]', function() { | ||
it('should NOT set iframe contents for untrusted values', inject(function($compile, $rootScope, $sce) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -182,6 +182,7 @@ describe('ngSrc', function() { | |
})); | ||
|
||
|
||
// Support: IE 9-11 only | ||
if (msie) { | ||
it('should update the element property as well as the attribute', inject( | ||
function($compile, $rootScope, $sce) { | ||
|
@@ -283,8 +284,9 @@ describe('ngHref', function() { | |
expect(element.attr('href')).toEqual(undefined); | ||
})); | ||
|
||
if (msie) { | ||
// IE11/10/Edge fail when setting a href to a URL containing a % that isn't a valid escape sequence | ||
// Support: IE 9-11 only, Edge 12-14+ | ||
if (msie || /\bEdge\/[\d\.]+\b/) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't it make more sense to put Edge in a variable, same as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't this need a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jbedard Nice catch. This means, though, that we can just remove the @Narretz A variable would make it easier to reuse and we should avoid UA-sniffing (it's more acceptable in tests but still); it's not robust, it can catch more browsers than intended and cause compatibility concerns. This is actually a good example as the IE sniffing is different as:
IE sniffing is, therefore, one of the few safe browser sniffing available. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, no, this particular condition was necessary, the tests are now failing. Fixing... |
||
// IE/Edge fail when setting a href to a URL containing a % that isn't a valid escape sequence | ||
// See https://github.com/angular/angular.js/issues/13388 | ||
it('should throw error if ng-href contains a non-escaped percent symbol', inject(function($rootScope, $compile) { | ||
element = $compile('<a ng-href="http://www.google.com/{{\'a%link\'}}">')($rootScope); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,9 +13,7 @@ describe('Scope', function() { | |
|
||
|
||
it('should expose the constructor', inject(function($rootScope) { | ||
if (msie < 11) return; | ||
// eslint-disable-next-line no-proto | ||
expect($rootScope.__proto__).toBe($rootScope.constructor.prototype); | ||
expect(Object.getPrototypeOf($rootScope)).toBe($rootScope.constructor.prototype); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was there only because of the Annex B (i.e. compatibility "don't use" stuff) |
||
})); | ||
|
||
|
||
|
@@ -125,6 +123,8 @@ describe('Scope', function() { | |
function Listener() { | ||
expect(this).toBeUndefined(); | ||
} | ||
// Support: IE 9 only | ||
// IE 9 doesn't support strict mode so its `this` will always be defined. | ||
if (msie < 10) return; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could be |
||
$rootScope.$watch(Getter, Listener); | ||
$rootScope.$digest(); | ||
|
@@ -1227,6 +1227,7 @@ describe('Scope', function() { | |
})); | ||
|
||
|
||
// Support: IE 9 only | ||
if (msie === 9) { | ||
// See issue https://github.com/angular/angular.js/issues/10706 | ||
it('should completely disconnect all child scopes on IE9', inject(function($rootScope) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<=
--><