{ "id": "112955", "key": "TIMOB-13604", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2013-04-16T20:36:30.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [], "versions": [ { "id": "14164", "description": "Release 3.0.2", "name": "Release 3.0.2", "archived": true, "released": true, "releaseDate": "2013-02-19" }, { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:04:22.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "The communication between WebView and Titanium is buggy for some numbers (doubles). Example:\r\n\r\nweb/test.html: \r\n{code}\r\n\r\n\t\r\n\t\ttest\r\n\t\r\n\r\n\t\r\n\t\tclick me\r\n\t\t\r\n\t\r\n\r\n{code}\r\n\r\nTitanium:\r\n{code}\r\n\tself = ...\r\n\r\n\tvar webView = Ti.UI.createWebView({\r\n\t\theight : Ti.UI.FILL,\r\n\t\tbottom : 0,\r\n\t\twidth : Ti.UI.FILL,\r\n\t\turl : Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, 'web/test.html').nativePath\r\n\t});\r\n\tself.add(webView);\r\n\r\n\tTi.App.addEventListener('FromWebView:test', function(o) {\r\n\t\tTi.API.info(\"Received object: \" + JSON.stringify(o));\r\n\t});{code}\r\n\r\nOutput:\r\n{code}[INFO] Object to transmit: {\"d\":7.747421264648438}\r\n[INFO] Received object: {\"type\":\"FromWebView:test\",\"d\":7.7474212646484375}{code}\r\n\r\nNo issues under Android:\r\n\r\n{code}[INFO][TiAPI ( 1014)] Object to transmit: {\"d\":7.747421264648438}\r\n[INFO][TiAPI ( 1014)] Received object: {\"type\":\"FromWebView:test\",\"source\":{\"bubbleParent\":true,\"id\":\"com.doublewebview\",\"version\":\"1.0\",\"__propertiesDefined__\":true,\"description\":\"not specified\",\"sessionId\":\"ce89b50e-58da-4985-9b3b-df278a92e8b1\",\"Properties\":{\"bubbleParent\":true},\"deployType\":\"development\",\"Android\":{\"bubbleParent\":true,\"R\":{\"bubbleParent\":true}},\"name\":\"doublewebview\",\"_events\":{\"FromWebView:test\":{}},\"guid\":\"66986468-eed6-4497-873b-bdf4add06a86\",\"url\":\"http://\",\"copyright\":\"2013 by ich\",\"analytics\":true,\"accessibilityEnabled\":false,\"publisher\":\"ich\"},\"d\":7.747421264648438,\"bubbles\":false,\"cancelBubble\":false}{code}\r\n\r\nI'm attaching a demo project.", "attachment": [ { "id": "37542", "filename": "doublewebview.zip", "author": { "name": "usr743n", "key": "usr743n", "displayName": "Hans Joachim", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-04-16T20:36:30.000+0000", "size": 2890853, "mimeType": "application/zip" } ], "flagged": false, "summary": "iOS: Transfer of numbers from WebView to App via Ti.App.fireEvent leading to inconsistent values", "creator": { "name": "usr743n", "key": "usr743n", "displayName": "Hans Joachim", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "usr743n", "key": "usr743n", "displayName": "Hans Joachim", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Titanium 3.0.2, iOS", "comment": { "comments": [ { "id": "247972", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested and confirmed with 3.0.2 GA and 3.1 GA on iOS 6 simulator and Android emulator 4.1.2.\n\n*iOS output*\n{code}\n[INFO] : \b\b \b Object to transmit: {\"d\":7.747421264648438}\n[INFO] : \b\b \b Received object: {\"type\":\"FromWebView:test\",\"d\":7.7474212646484375}\n{code}\n\n*Android output*\n{code}\n04-17 11:18:39.369: I/TiAPI(1600): Object to transmit: {\"d\":7.747421264648438}\n04-17 11:18:39.399: I/TiAPI(1600): Received object: {\"type\":\"FromWebView:test\",\"source\":{\"deployType\":\"development\",\"id\":\"com.doublewebview\",\"name\":\"doublewebview\",\"__propertiesDefined__\":true,\"version\":\"1.0\",\"Properties\":{\"bubbleParent\":true},\"description\":\"not specified\",\"Android\":{\"bubbleParent\":true,\"R\":{\"bubbleParent\":true}},\"_events\":{\"FromWebView:test\":{}},\"bubbleParent\":true,\"guid\":\"66986468-eed6-4497-873b-bdf4add06a86\",\"copyright\":\"2013 by ich\",\"url\":\"http://\",\"publisher\":\"ich\",\"accessibilityEnabled\":false,\"sessionId\":\"02c5bba9-fb0a-4a8b-b95c-328548603fca\",\"analytics\":true},\"d\":7.747421264648438,\"bubbles\":false,\"cancelBubble\":false}\n{code}", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-17T18:24:40.000+0000", "updated": "2013-04-17T18:24:40.000+0000" }, { "id": "248516", "author": { "name": "usr743n", "key": "usr743n", "displayName": "Hans Joachim", "active": true, "timeZone": "Europe/Berlin" }, "body": "Just fired the event from the app and not from a WebView: 7.747421264648438 is received correctly as 7.747421264648438. But 49.42214071257704 is received as 49.42214071257703. So the issue isn't restricted to WebViews.", "updateAuthor": { "name": "usr743n", "key": "usr743n", "displayName": "Hans Joachim", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-04-20T10:47:21.000+0000", "updated": "2013-04-20T10:47:21.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }