@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);
registerCallback(GWT.getModuleName());
}
+ /**
+ * 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