WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
173235
WKNavigationAction.sourceFrame is not annotated as nullable, causing it to crash when accessed from Swift
https://bugs.webkit.org/show_bug.cgi?id=173235
Summary
WKNavigationAction.sourceFrame is not annotated as nullable, causing it to cr...
Matt Curtis
Reported
2017-06-11 04:25:17 PDT
Created
attachment 312599
[details]
An Xcode Swift project demonstrating the issue. Overview: The WKNavigationAction.sourceFrame property is not annotated as nullable, causing it to crash when accessed from Swift. This bug shows up when making a navigation request that does not originate from the page itself using one of the WKWebView load methods. I've also filed this bug with Apple under
rdar://32686815
. Steps to Reproduce: This bug can be reproduced from both Objective-C and Swift but is more critical in Swift, as access of the property causes crashing: 1. Create a WKWebView and set its navigationDelegate to an object implementing the WKNavigationDelegate protocol method `webView(WKWebView, decidePolicyFor: WKNavigationAction, decisionHandler: (WKNavigationActionPolicy) -> Void)` insert `print(navigationAction.sourceFrame)` in its body. 2. Create a new navigation load request for the WKWebView using `webView.loadHTMLString(String)` 3. Run the project. Actual Results: The sourceFrame property is bridged as non-nullable, and upon access the application will crash. Expected Results: `nil` should be printed. Build Date & Hardware: iOS 10, 9 & OSX 10.11 >.
Attachments
An Xcode Swift project demonstrating the issue.
(50.52 KB, application/zip)
2017-06-11 04:25 PDT
,
Matt Curtis
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2017-06-12 18:12:56 PDT
<
rdar://problem/32728039
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug