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

Commit ac17dd3

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 74a214c commit ac17dd3

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
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

+2-6
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ function $SnifferProvider() {
2222
int((/android (\d+)/.exec(lowercase(($window.navigator || {}).userAgent)) || [])[1]),
2323
boxee = /Boxee/i.test(($window.navigator || {}).userAgent),
2424
document = $document[0] || {},
25-
documentMode = document.documentMode,
2625
vendorPrefix,
2726
vendorRegex = /^(Moz|webkit|O|ms)(?=[A-Z])/,
2827
bodyStyle = document.body && document.body.style,
@@ -65,9 +64,7 @@ function $SnifferProvider() {
6564
// jshint -W018
6665
history: !!($window.history && $window.history.pushState && !(android < 4) && !boxee),
6766
// jshint +W018
68-
hashchange: 'onhashchange' in $window &&
69-
// IE8 compatible mode lies
70-
(!documentMode || documentMode > 7),
67+
hashchange: 'onhashchange' in $window && (!msie || msie > 7),
7168
hasEvent: function(event) {
7269
// IE9 implements 'input' event it's so fubared that we rather pretend that it doesn't have
7370
// it. In particular the event is not fired when backspace or delete key are pressed or
@@ -86,8 +83,7 @@ function $SnifferProvider() {
8683
transitions : transitions,
8784
animations : animations,
8885
android: android,
89-
msie : msie,
90-
msieDocumentMode: documentMode
86+
msie : msie
9187
};
9288
}];
9389
}

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
@@ -354,8 +354,8 @@ describe('$sniffer', function() {
354354
}
355355
}));
356356

357-
it('should return document.documentMode as msieDocumentMode', function() {
357+
it('should return document.documentMode as msie', function() {
358358
var someDocumentMode = 123;
359-
expect(sniffer({}, {documentMode: someDocumentMode}).msieDocumentMode).toBe(someDocumentMode);
359+
expect(sniffer({}, {documentMode: someDocumentMode}).msie).toBe(someDocumentMode);
360360
});
361361
});

0 commit comments

Comments
 (0)