"Share" from inside contentEditable WebView results in unresponsive application

Originator:wirth_caesar
Number:rdar://23641003 Date Originated:21-Nov-2015 06:24 PM
Status:Open Resolved:
Product:iOS SDK Product Version:
Classification: Reproducible:
 
Summary:
For editing text that needs HTML backing, sometimes people use WebViews, and inside there is a page with a contentEditable div.

If the user is writing in one of these divs, and then opens up the context menu, a "Share" options occurs. Choosing to share some text, and then canceling out of the Share extension results in the original app no longer responding.

I have tested this with bare apps with nothing but a webview, and an app that is nothing but the default Share extension template, and confirmed that the behavior occurs. Please check the attached sample projects and video.

For some reason, this hang does not occur in mobile Safari, so there must be some way to fix it, but I don't know what it is.

Steps to Reproduce:
1. Create app with WebView in it
2. Load some HTML with a contentEditable div in it
3. Run the app, and begin editing inside the div
4. Select some text inside the div
5. Select "Share" from the options
6. Choose any share extension (Mail seems to crash, but that's another bug)
--> At least when running in the Simulator, these lines were logged out:
2015-11-21 18:21:52.201 WebViewFreeze[20381:2287500] _BSMachError: (os/kern) invalid capability (20)
2015-11-21 18:21:52.201 WebViewFreeze[20381:2287500] _BSMachError: (os/kern) invalid name (15)

7. Cancel out of the share extension
8. Experience not being able to do anything with the original app anymore
--> After a few seconds, this line was logged out:
2015-11-21 18:22:02.820 WebViewFreeze[20381:2287601] plugin com.cjwirth.ShareExtension.Share invalidated

But I was still unable to do anything.

Expected Results:
Once the Share Extension is finished running, the app would return back to its normal state, and I can use it as expected.

Actual Results:
The app appears to hang, not responding to any of my taps.

Version:
Xcode Version 7.1.1 (7B1005)

Notes:


Configuration:
Xcode Version 7.1.1 (7B1005); iOS 9+ -- both simulator and device

Attachments:
'WebViewHang.zip' was successfully uploaded.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!