Bug 197096

Summary: AX: Cannot load local file after loaded online page with a wkWebView on iOS12.2
Product: WebKit Reporter: qianyangbiao <ahut_qyb_6737>
Component: AccessibilityAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Major CC: beidson, cdumez, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 12   
Hardware: iPhone / iPad   
OS: iOS 12   

Description qianyangbiao 2019-04-19 00:18:33 PDT
Reproduce on iOS 12.2 device:

1.Create a wkwebView like :
WKWebView *webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, size.width, (size.height - 100)/2) configuration:[WKWebViewConfiguration new]];

2.Load online page like :
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"https://www.baidu.com"]]];

3.After webView finish load, load a local file like:
NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject] stringByAppendingPathComponent:@"test.html"];
[webView loadFileURL:fileURL allowingReadAccessToURL:fileURL];

Then you can see error like:
2019-04-19 15:17:11.107165+0800 TestWKWebView[10686:386533] [ProcessSwapping] 0x1035382c0 - ProvisionalPageProxy::didFailProvisionalLoadForFrame: pageID = 1, frameID = 1, navigationID = 2
2019-04-19 15:17:11.109566+0800 TestWKWebView[10686:386533] didFailProvisionalNavigation = Error Domain=kCFErrorDomainCFNetwork Code=1 "(null)" UserInfo={_NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <644E6D87-CC60-4D8D-8B89-3898D4899027>.<31>, _WKRecoveryAttempterErrorKey=<WKReloadFrameErrorRecoveryAttempter: 0x283c87440>}
Comment 1 Radar WebKit Bug Importer 2019-04-19 00:18:49 PDT
<rdar://problem/50041855>