[Webkit-unassigned] [Bug 173235] New: WKNavigationAction.sourceFrame is not annotated as nullable, causing it to crash when accessed from Swift

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jun 11 04:25:17 PDT 2017


https://bugs.webkit.org/show_bug.cgi?id=173235

            Bug ID: 173235
           Summary: WKNavigationAction.sourceFrame is not annotated as
                    nullable, causing it to crash when accessed from Swift
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: All
                OS: Other
            Status: NEW
          Severity: Major
          Priority: P2
         Component: WebKit API
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: matt.curtis.biz at gmail.com

Created attachment 312599

  --> https://bugs.webkit.org/attachment.cgi?id=312599&action=review

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 >.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170611/c78c310f/attachment-0001.html>


More information about the webkit-unassigned mailing list