WKNavigationAction.sourceFrame is marked as nonnull but it is actually nullable

Number:rdar://FB9877215 Date Originated:Feb 3, 2022 at 7:23 PM
Status:Open Resolved:
Product:WebKit Product Version:
Classification:Incorrect/Unexpected Behavior Reproducible:
The API document says `WKNavigationAction.sourceFrame` is nonnull but it is actually nullable.

Step to reproduce:
1. Define a class conforming WKNavigationDelegate
2. Implement WKNavigationDelegate.webView(_:decidePolicyFor:decisionHandler:)
3. Set break point to `webView(_:decidePolicyFor:decisionHandler:)` and run the app
4. Load some URL and reload web page
5. You can see `navigationAction.sourceFrame` becomes nil (debugger says it's <uninitialized>)

According to WebKit's source code, it is expected for`WKNavigationAction.sourceFrame` to become nil when the web view is reloaded.


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!