-
Notifications
You must be signed in to change notification settings - Fork 27.4k
chore(*): cleanup msie handling; add support comments #15407
Changes from 2 commits
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 |
---|---|---|
|
@@ -469,6 +469,10 @@ describe('$compile', function() { | |
})); | ||
|
||
// NOTE: This test may be redundant. | ||
// Support: Edge 14+ | ||
// An `<svg>` element inside a `<foreignObject>` element on MS Edge has no | ||
// size, causing the included `<circle>` element to also have no size and thus fails an | ||
// assertion (relying on the element having a non-zero size). | ||
if (!isEdge) { | ||
it('should handle custom svg containers that transclude to foreignObject' + | ||
' that transclude to custom svg containers that transclude to custom elements', inject(function() { | ||
|
@@ -1127,7 +1131,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 +10703,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 +10726,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 +11162,8 @@ describe('$compile', function() { | |
})); | ||
}); | ||
|
||
// Support: IE 9-10 only | ||
// IE <=11 don't support srcdoc | ||
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.
|
||
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 |
---|---|---|
|
@@ -39,8 +39,11 @@ describe('$location', function() { | |
/* global urlParsingNode: true */ | ||
var urlParsingNodePlaceholder; | ||
|
||
beforeEach(inject(function($sniffer) { | ||
if (msie) return; | ||
beforeEach(function() { | ||
// Support: non-Windows browsers | ||
// These tests expect a Windows environment which we can only guarantee | ||
// on IE & Edge. | ||
if (msie || /\bEdge\/[\d\.]+\b/.test(window.navigator.userAgent)) return; | ||
|
||
urlParsingNodePlaceholder = urlParsingNode; | ||
|
||
|
@@ -57,13 +60,14 @@ describe('$location', function() { | |
search: '', | ||
setAttribute: angular.noop | ||
}; | ||
})); | ||
}); | ||
|
||
afterEach(inject(function($sniffer) { | ||
if (msie) return; | ||
afterEach(function() { | ||
// Support: non-Windows browsers | ||
if (msie || /\bEdge\/[\d\.]+\b/.test(window.navigator.userAgent)) 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. It would be nice to have this as a reusable flag in tests. 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. I guess it doesn't hurt when it's used just in tests... (I would definitely not want sth like that in source). But would you like to have it in tests globally or just in I'm a little afraid of making it too easy to use UA-sniffing, though. 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. No, it doesn't hurt. It is just about the mental overhead of "deciphering"
Fair enough 😃 |
||
//reset urlParsingNode | ||
urlParsingNode = urlParsingNodePlaceholder; | ||
})); | ||
}); | ||
|
||
|
||
it('should not include the drive name in path() on WIN', function() { | ||
|
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.
What is the difference between
Edge 13-14+
andEdge 13+
?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.
In the former we've checked that it, indeed, is broken in both v13 & v14. In the latter we've just checked v13 and the v14 state is unknown.