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

Commit 57694e8

Browse files
committed
chore($sniffer): Remove remnants of separate documentMode handling
Since msie is now set to document.documentMode, it's not necessary to keep the documentMode in a separate property.
1 parent 1beebee commit 57694e8

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

src/ng/sce.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -729,9 +729,9 @@ function $SceProvider() {
729729

730730
this.$get = ['$parse', '$sniffer', '$sceDelegate', function(
731731
$parse, $sniffer, $sceDelegate) {
732-
// Prereq: Ensure that we're not running in IE8 quirks mode. In that mode, IE allows
732+
// Prereq: Ensure that we're not running in IE9/IE10/IE11 quirks mode. In that mode, IE allows
733733
// the "expression(javascript expression)" syntax which is insecure.
734-
if (enabled && $sniffer.msie && $sniffer.msieDocumentMode < 8) {
734+
if (enabled && $sniffer.msie < 8) {
735735
throw $sceMinErr('iequirks',
736736
'Strict Contextual Escaping does not support Internet Explorer version < 9 in quirks ' +
737737
'mode. You can fix this by adding the text <!doctype html> to the top of your HTML ' +

src/ng/sniffer.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ function $SnifferProvider() {
2121
int((/android (\d+)/.exec(lowercase(($window.navigator || {}).userAgent)) || [])[1]),
2222
boxee = /Boxee/i.test(($window.navigator || {}).userAgent),
2323
document = $document[0] || {},
24-
documentMode = document.documentMode,
2524
vendorPrefix,
2625
vendorRegex = /^(Moz|webkit|O|ms)(?=[A-Z])/,
2726
bodyStyle = document.body && document.body.style,
@@ -82,8 +81,7 @@ function $SnifferProvider() {
8281
transitions : transitions,
8382
animations : animations,
8483
android: android,
85-
msie : msie,
86-
msieDocumentMode: documentMode
84+
msie : msie
8785
};
8886
}];
8987
}

test/ng/sceSpecs.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ describe('SCE', function() {
3030
function runTest(enabled, documentMode, expectException) {
3131
module(function($provide) {
3232
$provide.value('$sniffer', {
33-
msie: documentMode,
34-
msieDocumentMode: documentMode
33+
msie: documentMode
3534
});
3635
$provide.value('$sceDelegate', {trustAs: null, valueOf: null, getTrusted: null});
3736
});

test/ng/snifferSpec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,8 @@ describe('$sniffer', function() {
340340
}
341341
}));
342342

343-
it('should return document.documentMode as msieDocumentMode', function() {
343+
it('should return document.documentMode as msie', function() {
344344
var someDocumentMode = 123;
345-
expect(sniffer({}, {documentMode: someDocumentMode}).msieDocumentMode).toBe(someDocumentMode);
345+
expect(sniffer({}, {documentMode: someDocumentMode}).msie).toBe(someDocumentMode);
346346
});
347347
});

0 commit comments

Comments
 (0)