summaryrefslogtreecommitdiffstats
path: root/shared
diff options
context:
space:
mode:
authorDos Moonen <darsstar@gmail.com>2017-03-22 07:46:00 +0100
committerHenri Sara <henri.sara@gmail.com>2017-03-22 16:45:33 +0200
commit235b6254ba8e968efc08ea890736f0ab73d619b0 (patch)
tree4bf85f3b54b87bd2b25b9a5956c231750fcadd78 /shared
parent1ce1ff6a8a694711b90b75ad2494804d1d3c6214 (diff)
downloadvaadin-framework-235b6254ba8e968efc08ea890736f0ab73d619b0.tar.gz
vaadin-framework-235b6254ba8e968efc08ea890736f0ab73d619b0.zip
Check Trident version to detect compatibility mode (#8884)
IE11 in compatibility mode is actually not too old. It's just not recognized as IE11 if you leave the Trident version out of the equation. Checking the Trident version and using it to determine the actual IE version instead of trusting the possibly emulated MSIE version string.
Diffstat (limited to 'shared')
-rw-r--r--shared/src/main/java/com/vaadin/shared/VBrowserDetails.java18
1 files changed, 10 insertions, 8 deletions
diff --git a/shared/src/main/java/com/vaadin/shared/VBrowserDetails.java b/shared/src/main/java/com/vaadin/shared/VBrowserDetails.java
index 2b6018f314..99dac478bc 100644
--- a/shared/src/main/java/com/vaadin/shared/VBrowserDetails.java
+++ b/shared/src/main/java/com/vaadin/shared/VBrowserDetails.java
@@ -120,13 +120,13 @@ public class VBrowserDetails implements Serializable {
.substring(userAgent.indexOf("webkit/") + 7);
tmp = tmp.replaceFirst("([0-9]+)[^0-9].+", "$1");
browserEngineVersion = Float.parseFloat(tmp);
- } else if (isIE) {
- int tridentPos = userAgent.indexOf("trident/");
- if (tridentPos >= 0) {
- String tmp = userAgent
- .substring(tridentPos + "Trident/".length());
- tmp = tmp.replaceFirst("([0-9]+\\.[0-9]+).*", "$1");
- browserEngineVersion = Float.parseFloat(tmp);
+ } else if (isTrident) {
+ String tmp = userAgent
+ .substring(userAgent.indexOf("trident/") + 8);
+ tmp = tmp.replaceFirst("([0-9]+\\.[0-9]+).*", "$1");
+ browserEngineVersion = Float.parseFloat(tmp);
+ if (browserEngineVersion > 7) {
+ browserEngineVersion = 7;
}
} else if (isEdge) {
browserEngineVersion = 0;
@@ -148,6 +148,9 @@ public class VBrowserDetails implements Serializable {
tmp = tmp.replaceFirst("(\\.[0-9]+).+", "$1");
parseVersionString(tmp);
}
+ } else if (isTrident) {
+ // See https://msdn.microsoft.com/en-us/library/ms537503(v=vs.85).aspx#TriToken
+ setIEMode((int) browserEngineVersion + 4);
} else {
String ieVersionString = userAgent
.substring(userAgent.indexOf("msie ") + 5);
@@ -565,7 +568,6 @@ public class VBrowserDetails implements Serializable {
* supported or might work
*/
public boolean isTooOldToFunctionProperly() {
- // Check Trident version to detect compatibility mode
if (isIE() && getBrowserMajorVersion() < 11) {
return true;
}