Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19922] iOS: Child WebView is not loaded when re-added back to the parent window

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionCannot Reproduce
Resolution Date2016-10-18T23:27:18.000+0000
Affected Version/sRelease 5.1.0, Release 5.0.2
Fix Version/sn/a
ComponentsiOS
Labelsqe-5.1.0
ReporterWilson Luu
AssigneeChee Kiat Ng
Created2015-11-11T23:53:23.000+0000
Updated2016-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

FileDateSize
no_load.png2015-11-11T23:52:30.000+000043601

Comments

  1. Hans Knöchel 2016-10-18

    [~wluu] I cannot reproduce this with 5.5.1.GA and other current versions. Can you revalidate that? Thx!
  2. Wilson Luu 2016-10-18

    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.

JSON Source