diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2015-04-15 10:24:44 +0300 |
---|---|---|
committer | Teemu Suo-Anttila <teemusa@vaadin.com> | 2015-04-15 10:24:44 +0300 |
commit | 2c4e533c9f2aa68211329ea6ce4de0b577407863 (patch) | |
tree | 1d9c1cc8bb72678b0edb991947c6fc94112baf0f /shared | |
parent | 93235f05c9dd4739cdccf87a4858a61904dbf4b5 (diff) | |
parent | 7cb23bc63f794a7549dd79c37da2f8bb8e88e20d (diff) | |
download | vaadin-framework-2c4e533c9f2aa68211329ea6ce4de0b577407863.tar.gz vaadin-framework-2c4e533c9f2aa68211329ea6ce4de0b577407863.zip |
Merge remote-tracking branch 'origin/master' into grid-7.5
Change-Id: I03fdd2014fd0393341db0f650c065f6d27905b73
Diffstat (limited to 'shared')
-rw-r--r-- | shared/src/com/vaadin/shared/VBrowserDetails.java | 11 | ||||
-rw-r--r-- | shared/src/com/vaadin/shared/ui/MarginInfo.java | 5 |
2 files changed, 16 insertions, 0 deletions
diff --git a/shared/src/com/vaadin/shared/VBrowserDetails.java b/shared/src/com/vaadin/shared/VBrowserDetails.java index 6e45d33e16..561b6c76d0 100644 --- a/shared/src/com/vaadin/shared/VBrowserDetails.java +++ b/shared/src/com/vaadin/shared/VBrowserDetails.java @@ -41,6 +41,7 @@ public class VBrowserDetails implements Serializable { private boolean isFirefox = false; private boolean isOpera = false; private boolean isIE = false; + private boolean isPhantomJS = false; private boolean isWindowsPhone; private boolean isIPad; @@ -86,6 +87,7 @@ public class VBrowserDetails implements Serializable { isSafari = !isChrome && !isIE && userAgent.indexOf("safari") != -1; isFirefox = userAgent.indexOf(" firefox/") != -1; + isPhantomJS = userAgent.indexOf("phantomjs/") != -1; // chromeframe isChromeFrameCapable = userAgent.indexOf("chromeframe") != -1; @@ -371,6 +373,15 @@ public class VBrowserDetails implements Serializable { } /** + * Tests if the browser is PhantomJS. + * + * @return true if it is PhantomJS, false otherwise + */ + public boolean isPhantomJS() { + return isPhantomJS; + } + + /** * Returns the version of the browser engine. For WebKit this is an integer * e.g., 532.0. For gecko it is a float e.g., 1.8 or 1.9. * diff --git a/shared/src/com/vaadin/shared/ui/MarginInfo.java b/shared/src/com/vaadin/shared/ui/MarginInfo.java index 3b1fece88a..4c0255a9ba 100644 --- a/shared/src/com/vaadin/shared/ui/MarginInfo.java +++ b/shared/src/com/vaadin/shared/ui/MarginInfo.java @@ -24,6 +24,7 @@ public class MarginInfo implements Serializable { private static final int RIGHT = 2; private static final int BOTTOM = 4; private static final int LEFT = 8; + private static final int ALL = TOP | RIGHT | BOTTOM | LEFT; private int bitMask; @@ -51,6 +52,10 @@ public class MarginInfo implements Serializable { bitMask = marginInfo.bitMask; } + public boolean hasAll() { + return (bitMask & ALL) == ALL; + } + public boolean hasLeft() { return (bitMask & LEFT) == LEFT; } |