[TIMOB-19922] iOS: Child WebView is not loaded when re-added back to the parent window
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2016-10-18T23:27:18.000+0000 |
Affected Version/s | Release 5.1.0, Release 5.0.2 |
Fix Version/s | n/a |
Components | iOS |
Labels | qe-5.1.0 |
Reporter | Wilson Luu |
Assignee | Chee Kiat Ng |
Created | 2015-11-11T23:53:23.000+0000 |
Updated | 2016-10-18T23:27:18.000+0000 |
Description
*Details:* On iOS, the child WebView is not loaded when readded back to the parent window.
*Note:* This is *not a regression* as this occurs with the current GA stack.
*Steps to reproduce:*
Create a Titanium classic project
Replace app.js with the following code:
var win = Ti.UI.createWindow({
backgroundColor : 'white'
});
var webview = Ti.UI.createWebView({
html : '<html><head></head><body><script>var now = Date.now(); document.body.innerHTML = now;</script></body></html>',
top : 0,
height : 200
});
webview.addEventListener('load', function() {
alert('The webview is loaded!');
});
var b = Ti.UI.createButton({
title : "remove and add webview",
top : 210
});
b.addEventListener("click", function() {
win.remove(webview);
win.add(webview);
});
var b2 = Ti.UI.createButton({
title : "remove and release and add webview",
top : 280
});
b2.addEventListener("click", function() {
win.remove(webview);
webview.reload();
win.add(webview);
});
win.add(webview);
win.add(b);
win.add(b2);
win.open();
Install app to device or simulator
Once app is launched, dismiss the alert dialog
Press *remove and add webview* or *remove and release and add webview* button
*Actual:* The child WebView is never loaded (see [^no_load.png]) and in the console, the following logs appear:
[DEBUG] : Loading: /var/mobile/Containers/Bundle/Application/80E75AAC-B055-4363-8873-7B3AB2F08B4E/monkey17027.app/app.js, Resource: app_js
[DEBUG] : Loading: /var/mobile/Containers/Bundle/Application/80E75AAC-B055-4363-8873-7B3AB2F08B4E/monkey17027.app/_app_props_.json, Resource: _app_props__json
[DEBUG] : Application booted in 135.113001 ms
[DEBUG] : New scheme: <NSMutableURLRequest: 0x146d81880> { URL: file:///var/mobile/Containers/Bundle/Application/80E75AAC-B055-4363-8873-7B3AB2F08B4E/monkey17027.app/ }
[DEBUG] : CoreAnimation: failed to allocate IOSurface
[TRACE] : Uploaded tiapp metadata with Appcelerator Platform!
[DEBUG] : Cannot load file: /var/mobile/Containers/Bundle/Application/80E75AAC-B055-4363-8873-7B3AB2F08B4E/monkey17027.app. Error message was: Error Domain=NSCocoaErrorDomain Code=257 "The file ???monkey17027??? couldn???t be opened because you don???t have permission to view it." UserInfo={NSFilePath=/var/mobile/Containers/Bundle/Application/80E75AAC-B055-4363-8873-7B3AB2F08B4E/monkey17027.app, NSUnderlyingError=0x146dd90c0 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}}
[DEBUG] : New scheme: <NSMutableURLRequest: 0x146da2e60> { URL: file:///var/mobile/Containers/Bundle/Application/80E75AAC-B055-4363-8873-7B3AB2F08B4E/monkey17027.app/ }
*Expected:* The child WebView should be loaded again.
Attachments
File | Date | Size |
---|---|---|
no_load.png | 2015-11-11T23:52:30.000+0000 | 43601 |
[~wluu] I cannot reproduce this with 5.5.1.GA and other current versions. Can you revalidate that? Thx!
Yep, cannot reproduce this issue any more on: Appc CLI NPM: 4.2.7 Appc CLI Core: 5.5.1 Arrow: 1.8.6 SDK: 5.5.1.GA Node: v4.6.0 OS: Mac OS X (10.12) Xcode: 8.0 Devices: iphone 7 simulator (10), iphone 6s simulator (9.2) Will close ticket as cannot reproduce.