WKSelectionGranularityCharacter option of WKWebView broken in iOS 9

Originator:kiptonk
Number:rdar://23345435 Date Originated:31-Oct-2015
Status:Open Resolved:
Product:iOS SDK Product Version:9.1
Classification: Reproducible:
 
Summary:
When the WKSelectionGranularityCharacter option is set on a WKWebView in iOS 9, no selection is possible. A long press brings up a magnifier but no selection begins. No highlighting or handles appear, the magnifier just disappears.  The option works correctly in iOS 8.4.

Steps to Reproduce:
1. Create a single view Objective C app in XCode 7
2. Add the following code to ViewController.m within viewDidLoad

    [super viewDidLoad];
    WKWebViewConfiguration *cfg = [[WKWebViewConfiguration alloc] init];
    cfg.selectionGranularity = WKSelectionGranularityCharacter;
    _webview = [[WKWebView alloc] initWithFrame:self.view.frame configuration:cfg];
    [self.view addSubview:_webview];
    [_webview loadHTMLString:@"<html><body><br><br><br>Here is some text for selection</body></html>" baseURL:nil];

3. Target iOS 9.1 and run on an iPad Air simulator
4. Long press on the text


Expected Results:
Text selection should begin with highlighting and grab handles.

Actual Results:
No text selection happens.  Magnifier just disappears.

Version:
iOS 9.1

Notes:
Also fails with XCode 7.2 beta and iOS 9.2 beta.  Also fails with loadRequest and loadFileURL instead of loadHTMLString.  Also fails with App Transport Security disabled.

Configuration:
iPad Air simulator, iPad mini 2

Attachments:

Comments

No reply from Apple or even a rank as of 4-Dec-2015


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!