[Pkg-javascript-commits] [dojo] 01/28: Fix IE11 sniffing. Fixes #17311. (cherry picked from commit f58c0e19ce509398985908688a768c8fb41191b8)

David Prévot taffit at moszumanska.debian.org
Thu Aug 21 17:39:46 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag 1.8.6
in repository dojo.

commit 28e1f7c31de5a407a0c095038bf851518085bffc
Author: mahays0 <mahays0 at gmail.com>
Date:   Mon Aug 5 10:53:43 2013 -0400

    Fix IE11 sniffing. Fixes #17311.
    (cherry picked from commit f58c0e19ce509398985908688a768c8fb41191b8)
---
 sniff.js  | 29 +++++++++++++++++------------
 window.js |  2 +-
 2 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/sniff.js b/sniff.js
index 96bdb37..d0787f0 100644
--- a/sniff.js
+++ b/sniff.js
@@ -34,19 +34,15 @@ define(["./has"], function(has){
 				has.add("opera", tv >= 9.8 ? parseFloat(dua.split("Version/")[1]) || tv : tv);
 			}
 
-			// Mozilla and firefox
-			if(dua.indexOf("Gecko") >= 0 && !has("khtml") && !has("webkit")){
-				has.add("mozilla", tv);
-			}
-			if(has("mozilla")){
-				//We really need to get away from this. Consider a sane isGecko approach for the future.
-				has.add("ff", parseFloat(dua.split("Firefox/")[1] || dua.split("Minefield/")[1]) || undefined);
-			}
-
-			// IE
+			var isIE = 0;
 			if(document.all && !has("opera")){
-				var isIE = parseFloat(dav.split("MSIE ")[1]) || undefined;
-
+				// IE < 11
+				isIE = parseFloat(dav.split("MSIE ")[1]) || undefined;
+			}else if(dav.indexOf("Trident")){
+				// IE >= 9
+				isIE = parseFloat(dav.split("rv:")[1]) || undefined;
+			}
+			if(isIE){
 				//In cases where the page has an HTTP header or META tag with
 				//X-UA-Compatible, then it is in emulation mode.
 				//Make sure isIE reflects the desired version.
@@ -60,6 +56,15 @@ define(["./has"], function(has){
 
 				has.add("ie", isIE);
 			}
+			
+			// Mozilla and firefox
+			if(!has("ie") && dua.indexOf("Gecko") >= 0 && !has("khtml") && !has("webkit")){
+				has.add("mozilla", tv);
+			}
+			if(has("mozilla")){
+				//We really need to get away from this. Consider a sane isGecko approach for the future.
+				has.add("ff", parseFloat(dua.split("Firefox/")[1] || dua.split("Minefield/")[1]) || undefined);
+			}
 
 			// Wii
 			has.add("wii", typeof opera != "undefined" && opera.wiiremote);
diff --git a/window.js b/window.js
index c9d24b2..c02cc3c 100644
--- a/window.js
+++ b/window.js
@@ -100,7 +100,7 @@ define(["./_base/lang", "./sniff", "./_base/window", "./dom", "./dom-geometry",
 			// reference to the real window object (maybe a copy), so we must fix it as well
 			// We use IE specific execScript to attach the real window reference to
 			// document._parentWindow for later use
-			if(has("ie") && window !== document.parentWindow){
+			if(has("ie") < 9 && window !== document.parentWindow){
 				/*
 				In IE 6, only the variable "window" can be used to connect events (others
 				may be only copies).

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/dojo.git



More information about the Pkg-javascript-commits mailing list