Bug 22623 - WebView on iOS 6.1 throws CALayer position contains NaN for most websites
Summary: WebView on iOS 6.1 throws CALayer position contains NaN for most websites
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.2.3
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2014-09-03 18:43 UTC by John Miller [MSFT]
Modified: 2015-05-26 23:56 UTC (History)
6 users (show)

Is this bug a regression?: ---
Last known good build:

Test Case (19.98 KB, application/zip)
2014-09-03 18:43 UTC, John Miller [MSFT]

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description John Miller [MSFT] 2014-09-03 18:43:48 UTC
Created attachment 7910 [details]
Test Case


   WebView is throwing an exception iOS 6.1 devices for *certain websites. 

* xamarin.com seems to work, but google.com fails.

**Steps to Reproduce:**

   1. Run the attached test case on a iOS 6.1 simulator.

**Actual Results:**

   >Objective-C exception thrown.  Name: CALayerInvalidGeometry Reason: CALayer position contains NaN: [240 nan]

**Expected Results:**

   No exception. Webpage should render google.com

**Build Date & Platform:**

   XF 1.2.3-pre1
Comment 1 Arpit Jha 2014-09-08 05:24:03 UTC
I have checked this issue and able to reproduce it.

Steps to reproduce
I followed above bug description . 

I observed that webview  throws a run time CALayerInvalidGeometry Reason  exception  when  but  when we set source to  http://xamarin.com functioning properly as expected .I have tried following code snippet

  public static Page GetMainPage()
            return new ContentPage
                Content = new WebView {
					Source = "http://google.com"

Screencast regarding same :  http://screencast.com/t/nR9i9VISN3

Environment Info :

=== Xamarin Studio ===

Version 5.3 (build 440)
Installation UUID: 2591d519-875d-4afe-a3d9-5fcf391bbd2d
	Mono 3.8.0 ((no/45d0ba1)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 308000009

=== Apple Developer Tools ===

Xcode 4.6.3 (2068)
Build 4H1503

=== Xamarin.Mac ===

Version: (Enterprise Edition)

=== Xamarin.iOS ===

Version: (Enterprise Edition)
Hash: 77efa3f
Build date: 2014-08-26 07:59:55-0400

=== Xamarin.Android ===

Version: 4.16.0 (Enterprise Edition)
Android SDK: /Users/nischal/Desktop/android-sdk-macosx
	Supported Android versions:
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		3.2    (API level 13)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		4.5    (API level 21)
Java SDK: /usr
java version "1.6.0_35"
Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-11M3811)
Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode)

=== Build Information ===

Release ID: 503000440
Git revision: accb55419539e512cff857b14b80ec3107996511
Build date: 2014-09-01 08:53:05-04
Xamarin addins: 6dbac4b3a32df080bf98cde838ce89e573a92859

=== Operating System ===

Mac OS X 10.7.4
Darwin nischals-Mac-mini.local 11.4.0 Darwin Kernel Version 11.4.0
    Mon Apr  9 19:32:15 PDT 2012
    root:xnu-1699.26.8~1/RELEASE_X86_64 x86_64
Comment 2 Dustin 2014-09-11 23:21:57 UTC
I've narrowed this down to the following tag causing the webview to crash in iOS 6.1:

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">

I've changed this to:

<meta name="viewport" content="user-scalable=no">

And my pages work fine. As far as I can tell, any combination of two or more of width, initial-scale, or maximum-scale causes the crash (ran fine with just one).

I'm only loading pages from the bundle and they still render correctly with this working tag, so fortunately this change works for me.
Comment 3 Jason Smith [MSFT] 2015-05-26 23:56:54 UTC
This should no longer happen in latest release, please re-open if it still does.