diff options
author | Henri Sara <hesara@vaadin.com> | 2013-07-04 10:53:44 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2013-07-04 12:43:44 +0000 |
commit | d7a64fd5b514f18a65bbc6f3f3816c9219f7ab80 (patch) | |
tree | 721804ea4648263c7d4105c97cd652c2b75ad567 | |
parent | ae565a229325f1289348c2c0e3dc02f14ed6f549 (diff) | |
download | vaadin-framework-d7a64fd5b514f18a65bbc6f3f3816c9219f7ab80.tar.gz vaadin-framework-d7a64fd5b514f18a65bbc6f3f3816c9219f7ab80.zip |
Enable native scrolling in home screen apps on iOS 6+ (#12149)
This also fixes another iOS 6 detection issue for home screen apps.
Change-Id: Icbbb15d3f0d6668f11b2a796ae2c096d8c4dec0b
3 files changed, 27 insertions, 3 deletions
diff --git a/client/src/com/vaadin/client/ApplicationConfiguration.java b/client/src/com/vaadin/client/ApplicationConfiguration.java index 86ab9455ed..ecd957194d 100644 --- a/client/src/com/vaadin/client/ApplicationConfiguration.java +++ b/client/src/com/vaadin/client/ApplicationConfiguration.java @@ -559,8 +559,7 @@ public class ApplicationConfiguration implements EntryPoint { BrowserInfo browserInfo = BrowserInfo.get(); // Enable iOS6 cast fix (see #10460) - if (browserInfo.isIOS() && browserInfo.isWebkit() - && browserInfo.getBrowserMajorVersion() == 6) { + if (browserInfo.isIOS6() && browserInfo.isWebkit()) { enableIOS6castFix(); } diff --git a/client/src/com/vaadin/client/BrowserInfo.java b/client/src/com/vaadin/client/BrowserInfo.java index b3490c3ca4..c733f38481 100644 --- a/client/src/com/vaadin/client/BrowserInfo.java +++ b/client/src/com/vaadin/client/BrowserInfo.java @@ -353,6 +353,16 @@ public class BrowserInfo { } /** + * Checks if the browser is run on iOS 6. + * + * @since 7.1.1 + * @return true if the browser is run on iOS 6, false otherwise + */ + public boolean isIOS6() { + return isIOS() && getOperatingSystemMajorVersion() == 6; + } + + /** * Checks if the browser is run on Android * * @return true if the browser is run on Android, false otherwise @@ -378,7 +388,7 @@ public class BrowserInfo { } // iOS 6 Safari supports native scrolling; iOS 5 suffers from #8792 // TODO Should test other iOS browsers - if (isIOS() && isSafari() && getBrowserMajorVersion() >= 6) { + if (isIOS6() && isWebkit()) { return false; } return true; diff --git a/client/tests/src/com/vaadin/client/TestVBrowserDetailsUserAgentParser.java b/client/tests/src/com/vaadin/client/TestVBrowserDetailsUserAgentParser.java index 4ce03d885d..7d5911f5a0 100644 --- a/client/tests/src/com/vaadin/client/TestVBrowserDetailsUserAgentParser.java +++ b/client/tests/src/com/vaadin/client/TestVBrowserDetailsUserAgentParser.java @@ -43,6 +43,9 @@ public class TestVBrowserDetailsUserAgentParser extends TestCase { private static final String IPHONE_IOS_4_0 = "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7"; private static final String IPAD_IOS_4_3_1 = "Mozilla/5.0 (iPad; U; CPU OS 4_3_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8G4 Safari/6533.18.5"; + // application on the home screen, without Safari in user agent + private static final String IPHONE_IOS_6_1_HOMESCREEN_SIMULATOR = "Mozilla/5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Mobile/10B141"; + private static final String ANDROID_HTC_2_1 = "Mozilla/5.0 (Linux; U; Android 2.1-update1; en-us; ADR6300 Build/ERE27) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17"; private static final String ANDROID_GOOGLE_NEXUS_2_2 = "Mozilla/5.0 (Linux; U; Android 2.2; en-us; Nexus One Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"; private static final String ANDROID_MOTOROLA_3_0 = "Mozilla/5.0 (Linux; U; Android 3.0; en-us; Xoom Build/HRI39) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13"; @@ -68,6 +71,18 @@ public class TestVBrowserDetailsUserAgentParser extends TestCase { assertMacOSX(bd); } + public void testIPhoneIOS6Homescreen() { + VBrowserDetails bd = new VBrowserDetails( + IPHONE_IOS_6_1_HOMESCREEN_SIMULATOR); + assertWebKit(bd); + // not identified as Safari, no browser version available + // assertSafari(bd); + // assertBrowserMajorVersion(bd, 6); + // assertBrowserMinorVersion(bd, 1); + assertEngineVersion(bd, 536f); + assertIOS(bd, 6, 1); + } + public void testIPhoneIOS5() { VBrowserDetails bd = new VBrowserDetails(IPHONE_IOS_5_1); assertWebKit(bd); |