Skip to content
Permalink
Browse files

has("webkit") and has("mozilla") should also be falsy for Edge, refs …

…#18172
  • Loading branch information...
wkeese committed Oct 20, 2015
1 parent 58ed862 commit 6bafb16c544c7dff015bb04aea9dfedcf7c430e6
Showing with 6 additions and 5 deletions.
  1. +3 −3 sniff.js
  2. +3 −2 window.js
@@ -19,9 +19,9 @@ define(["./has"], function(has){
has.add("wp", parseFloat(dua.split("Windows Phone")[1]) || undefined);
has.add("msapp", parseFloat(dua.split("MSAppHost/")[1]) || undefined);
has.add("khtml", dav.indexOf("Konqueror") >= 0 ? tv : undefined);
has.add("webkit", !has("wp") // NOTE: necessary since Windows Phone 8.1 Update 1, see #18540
&& parseFloat(dua.split("WebKit/")[1]) || undefined);
has.add("edge", parseFloat(dua.split("Edge/")[1]) || undefined);
has.add("webkit", !has("wp") // NOTE: necessary since Windows Phone 8.1 Update 1, see #18540
&& !has("edge") && parseFloat(dua.split("WebKit/")[1]) || undefined);
has.add("chrome", !has("edge")
&& parseFloat(dua.split("Chrome/")[1]) || undefined);
has.add("android", !has("wp") // NOTE: necessary since Windows Phone 8.1 Update 1, see #18528
@@ -55,7 +55,7 @@ define(["./has"], function(has){

// Mozilla and firefox
if(dua.indexOf("Gecko") >= 0 && !has("wp") // NOTE: necessary since Windows Phone 8.1 Update 1
&& !has("khtml") && !has("webkit") && !has("trident")){
&& !has("khtml") && !has("trident") && !has("edge")){
has.add("mozilla", tv);
}
if(has("mozilla")){
@@ -130,11 +130,12 @@ define(["./_base/lang", "./sniff", "./_base/window", "./dom", "./dom-geometry",
var doc = node.ownerDocument || baseWindow.doc, // TODO: why baseWindow.doc? Isn't node.ownerDocument always defined?
body = baseWindow.body(doc),
html = doc.documentElement || body.parentNode,
isIE = has("ie"),
isIE = has("ie") || has("trident"),
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") || has("trident")) && ("scrollIntoView" in node)){
if(!(has("mozilla") || isIE || isWK || has("opera") || has("trident") || has("edge"))
&& ("scrollIntoView" in node)){
node.scrollIntoView(false); // short-circuit to native if possible
return;
}

0 comments on commit 6bafb16

Please sign in to comment.
You can’t perform that action at this time.