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

MSIE documentMode detection #4115

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/component-spec/mocks.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copy/pasted from src/Angular.js, so that we can disable specific tests on IE.
var msie = parseInt((/msie (\d+)/.exec(navigator.userAgent.toLowerCase()) || [])[1], 10);
//var msie = parseInt((/msie (\d+)/.exec(navigator.userAgent.toLowerCase()) || [])[1], 10);
var msie = document.documentMode;

var createMockWindow = function() {
var mockWindow = {};
Expand Down
2 changes: 1 addition & 1 deletion src/ngScenario/browserTrigger.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

(function() {
var msie = parseInt((/msie (\d+)/.exec(navigator.userAgent.toLowerCase()) || [])[1], 10);
var msie = document.documentMode;

function indexOf(array, obj) {
if (array.indexOf) return array.indexOf(obj);
Expand Down
2 changes: 1 addition & 1 deletion test/ngTouch/directive/ngSwipeSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var swipeTests = function(description, restrictBrowsers, startEvent, moveEvent,
// Skip tests on IE < 9. These versions of IE don't support createEvent(), and so
// we cannot control the (x,y) position of events.
// It works fine in IE 8 under manual testing.
var msie = +((/msie (\d+)/.exec(navigator.userAgent.toLowerCase()) || [])[1]);
var msie = document.documentMode;
if (msie < 9) {
return;
}
Expand Down