[Pkg-javascript-commits] [dojo] 16/27: Change has("ie") to return undefined for IE11+, and instead has("trident") returns true. Unfixes #17311 on 1.7 branch.

David Prévot taffit at moszumanska.debian.org
Sun Sep 14 16:23:06 UTC 2014


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

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

commit a60da77869493437e22e0555afd2fa7c9cadf95b
Author: mahays0 <mahays0 at gmail.com>
Date:   Thu Feb 6 15:08:22 2014 -0500

    Change has("ie") to return undefined for IE11+, and instead
    has("trident") returns true.  Unfixes #17311 on 1.7 branch.
    
    Also, fix missed line in 3321e70 backport. Refs #18124 on 1.7 branch.
---
 _base/sniff.js | 25 +++++++++----------------
 window.js      |  2 +-
 2 files changed, 10 insertions(+), 17 deletions(-)

diff --git a/_base/sniff.js b/_base/sniff.js
index 3b4b0f6..f7f9e20 100644
--- a/_base/sniff.js
+++ b/_base/sniff.js
@@ -118,6 +118,7 @@ define(["./kernel", "../has"], function(dojo, has){
 	isIos = /iPhone|iPod|iPad/.test(dua);
 	isAndroid = parseFloat(dua.split("Android ")[1]) || undefined;
 	isWii = typeof opera != "undefined" && opera.wiiremote;
+	isTrident = parseFloat(dav.split("Trident/")[1]) || undefined;
 
 	// safari detection derived from:
 	//		http://developer.apple.com/internet/safari/faq.html#anchor2
@@ -143,15 +144,15 @@ define(["./kernel", "../has"], function(dojo, has){
 			}
 		}
 
-		isIE = 0;
-		if(document.all && !has("opera")){
-			// IE < 11
-			isIE = parseFloat(dav.split("MSIE ")[1]) || undefined;
-		}else if(dav.indexOf("Trident")){
-			// IE >= 9
-			isIE = parseFloat(dav.split("rv:")[1]) || undefined;
+		if(dua.indexOf("Gecko") >= 0 && !isKhtml && !isWebKit && !isTrident){
+			isMozilla = isMoz = tv;
+		}
+		if(isMoz){
+			//We really need to get away from this. Consider a sane isGecko approach for the future.
+			isFF = parseFloat(dua.split("Firefox/")[1] || dua.split("Minefield/")[1]) || undefined;
 		}
 		if(document.all && !isOpera){
+			isIE = parseFloat(dav.split("MSIE ")[1]) || undefined;
 			//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.
@@ -163,15 +164,6 @@ define(["./kernel", "../has"], function(dojo, has){
 				isIE = mode;
 			}
 		}
-		
-		// Mozilla and firefox
-		if(!isIE && dua.indexOf("Gecko") >= 0 && !isKhtml && !isWebKit){
-			isMozilla = isMoz = tv;
-		}
-		if(isMoz){
-			//We really need to get away from this. Consider a sane isGecko approach for the future.
-			isFF = parseFloat(dua.split("Firefox/")[1] || dua.split("Minefield/")[1]) || undefined;
-		}
 	}
 
 	isQuirks = document.compatMode == "BackCompat";
@@ -189,6 +181,7 @@ define(["./kernel", "../has"], function(dojo, has){
 	hasAdd("quirks", dojo.isQuirks = isQuirks);
 	hasAdd("ios", dojo.isIos = isIos);
 	hasAdd("android", dojo.isAndroid = isAndroid);
+	hasAdd("trident", dojo.isTrident = isTrident);
 
 	dojo.locale = dojo.locale || (isIE ? n.userLanguage : n.language).toLowerCase();
 
diff --git a/window.js b/window.js
index a406c1e..e3828e6 100644
--- a/window.js
+++ b/window.js
@@ -138,7 +138,7 @@ window.scrollIntoView = function(/*DomNode*/ node, /*Object?*/ pos){
 			isWK = has("webkit");
 		// if an untested browser, then use the native method
 		if(node == body || node == html){ return; }
-		if(!(has("mozilla") || isIE || isWK || has("opera")) && ("scrollIntoView" in node)){
+		if(!(has("mozilla") || isIE || isWK || has("opera") || has("trident")) && ("scrollIntoView" in node)){
 			node.scrollIntoView(false); // short-circuit to native if possible
 			return;
 		}

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