Application crashes inside UIWebView when copy button is pressed on keyboard (iphone plus)

Originator:Den.DoroninD
Number:rdar://6468254619 Date Originated:8/10/2017
Status:Open Resolved:NO
Product:ios Product Version:10.2.1
Classification:crash Reproducible:100%
 
Area:
UIKit

Summary:
Application crashes when user tries to edit content inside UIWebView, after keyboard buttons are pressed from the following list:
crop, copy, make text bold. 

Important note: device is iphone 6s plus in landscape mode (only in landscape such options appear)

I've attached sample which shows the problem.

Steps to Reproduce:
1. Create singleview application
2. Add UIWebView to the auto-generated viewcontroller
3. load into UIWebView the following HTML (say, index.html inside project directory):

<html>
    <body>
        <div contenteditable="true">
        </div>
        <div contenteditable="true" >
            Select crash to crash GD
        </div>
    </body>
</html>
using the following command:
NSString * htmlfilePath = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"];
  [self.webView loadData:[NSData dataWithContentsOfFile:htmlfilePath] MIMEType:@"text/html" textEncodingName:@"UTF-8" baseURL:[NSURL URLWithString:@"com.test.crash"]];
where webView - is outlet
4. Build & launch application
5. Run, rotate device to landscape, make webView firstResponder
6. select text and press crop icon (first column, first row from top)

Expected Results:
Application should not crash

Observed Results:
Application crashes with:

2017-08-10 12:37:50.192091 CrashSample[3223:1087859] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIThreadSafeNode _responderForEditing]: unrecognized selector sent to instance 0x170202120'

Version:
iOS 10.2.1 (14D27)
Model: iPhone 6s Plus

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!