diff options
author | Artur Signell <artur@vaadin.com> | 2013-09-26 09:28:50 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2013-09-26 09:28:50 +0300 |
commit | c18b20050d6b04a2c69b3fdfc75ca901b78edc0a (patch) | |
tree | 1d91200782aa20a4fcf331bb0f773070c7cd080a /shared | |
parent | 7c5bdce3b4c76e7f19bc46bcaed135d67a94f06a (diff) | |
parent | bd0ae0581f265be57374b236cfe1b71043ab69aa (diff) | |
download | vaadin-framework-c18b20050d6b04a2c69b3fdfc75ca901b78edc0a.tar.gz vaadin-framework-c18b20050d6b04a2c69b3fdfc75ca901b78edc0a.zip |
Merge changes from origin/7.1
7f7dc31 Base files for TB3 tests (#12572)
6b17abe Make it possible to override web driver in tests (#12572)
a682e3b Refactored build scripts to support TB2, TB3 + integration tests (#12572)
e556642 Converted servlet integration tests to TB3 (#12573)
21af0c3 Updated TB3 tests to use Firefox 24 (#12604)
a7583c6 TB3 test for browsers (#12572)
37b8543 Do not add empty package javadoc for new classes
0248b8f Fixes browser detection for IE11 (#12638)
1df28c3 Run TB3 tests also on IE11 (#12631)
a2daf65 Converted TB2 push tests to TB3 (#12580)
d3261d7 Fixes issue with Table not scrolling completely to the end #12651
bd0ae05 Limit the number of tests run concurrently (#12572)
Change-Id: Idb4389aac388b728490a4ffd57d30aee20ea9fe8
Diffstat (limited to 'shared')
-rw-r--r-- | shared/src/com/vaadin/shared/VBrowserDetails.java | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/shared/src/com/vaadin/shared/VBrowserDetails.java b/shared/src/com/vaadin/shared/VBrowserDetails.java index f31f5f3c04..a745a212b0 100644 --- a/shared/src/com/vaadin/shared/VBrowserDetails.java +++ b/shared/src/com/vaadin/shared/VBrowserDetails.java @@ -31,6 +31,7 @@ public class VBrowserDetails implements Serializable { private boolean isGecko = false; private boolean isWebKit = false; private boolean isPresto = false; + private boolean isTrident = false; private boolean isChromeFrameCapable = false; private boolean isChromeFrame = false; @@ -65,9 +66,11 @@ public class VBrowserDetails implements Serializable { // browser engine name isGecko = userAgent.indexOf("gecko") != -1 - && userAgent.indexOf("webkit") == -1; + && userAgent.indexOf("webkit") == -1 + && userAgent.indexOf("trident/") == -1; isWebKit = userAgent.indexOf("applewebkit") != -1; isPresto = userAgent.indexOf(" presto/") != -1; + isTrident = userAgent.indexOf("trident/") != -1; // browser name isChrome = userAgent.indexOf(" chrome/") != -1; @@ -75,6 +78,9 @@ public class VBrowserDetails implements Serializable { isOpera = userAgent.indexOf("opera") != -1; isIE = userAgent.indexOf("msie") != -1 && !isOpera && (userAgent.indexOf("webtv") == -1); + // IE 11 no longer contains MSIE in the user agent + isIE = isIE || isTrident; + isFirefox = userAgent.indexOf(" firefox/") != -1; // chromeframe @@ -113,11 +119,21 @@ public class VBrowserDetails implements Serializable { // Browser version try { if (isIE) { - String ieVersionString = userAgent.substring(userAgent - .indexOf("msie ") + 5); - ieVersionString = safeSubstring(ieVersionString, 0, - ieVersionString.indexOf(";")); - parseVersionString(ieVersionString); + if (userAgent.indexOf("msie") == -1) { + // IE 11+ + int rvPos = userAgent.indexOf("rv:"); + if (rvPos >= 0) { + String tmp = userAgent.substring(rvPos + 3); + tmp = tmp.replaceFirst("(\\.[0-9]+).+", "$1"); + parseVersionString(tmp); + } + } else { + String ieVersionString = userAgent.substring(userAgent + .indexOf("msie ") + 5); + ieVersionString = safeSubstring(ieVersionString, 0, + ieVersionString.indexOf(";")); + parseVersionString(ieVersionString); + } } else if (isFirefox) { int i = userAgent.indexOf(" firefox/") + 9; parseVersionString(safeSubstring(userAgent, i, i + 5)); @@ -288,6 +304,16 @@ public class VBrowserDetails implements Serializable { } /** + * Tests if the browser is using the Trident engine + * + * @since 7.1.7 + * @return true if it is Trident, false otherwise + */ + public boolean isTrident() { + return isTrident; + } + + /** * Tests if the browser is Safari. * * @return true if it is Safari, false otherwise |