summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--client/src/com/vaadin/client/ApplicationConfiguration.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/client/src/com/vaadin/client/ApplicationConfiguration.java b/client/src/com/vaadin/client/ApplicationConfiguration.java
index d43e2b4d31..5c3ec36d78 100644
--- a/client/src/com/vaadin/client/ApplicationConfiguration.java
+++ b/client/src/com/vaadin/client/ApplicationConfiguration.java
@@ -533,6 +533,14 @@ public class ApplicationConfiguration implements EntryPoint {
@Override
public void onModuleLoad() {
+ BrowserInfo browserInfo = BrowserInfo.get();
+
+ // Enable iOS6 cast fix (see #10460)
+ if (browserInfo.isIOS() && browserInfo.isWebkit()
+ && browserInfo.getBrowserMajorVersion() == 6) {
+ enableIOS6castFix();
+ }
+
// Prepare VConsole for debugging
if (isDebugMode()) {
Console console = GWT.create(Console.class);
@@ -569,6 +577,18 @@ public class ApplicationConfiguration implements EntryPoint {
}
/**
+ * Fix to iOS6 failing when comparing with 0 directly after the kind of
+ * comparison done by GWT when a double or float is cast to an int. Forcing
+ * another trivial operation (other than a compare to 0) after the dangerous
+ * comparison makes the issue go away. See #10460.
+ */
+ private static native void enableIOS6castFix()
+ /*-{
+ Math.max = function(a,b) {return (a > b === 1 < 2)? a : b}
+ Math.min = function(a,b) {return (a < b === 1 < 2)? a : b}
+ }-*/;
+
+ /**
* Registers that callback that the bootstrap javascript uses to start
* applications once the widgetset is loaded and all required information is
* available