Bug 152032

Summary: -[WKNavigationDelegate webView:didFinishNavigation:] can be called before the main frame load is complete.
Product: WebKit Reporter: gchatz
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ap, beidson, cdumez, gchatz
Priority: P2 Keywords: InRadar
Version: Safari 9   
Hardware: iPhone / iPad   
OS: iOS 9.0   
URL: nytimes.com

Description gchatz 2015-12-08 19:02:57 PST
Summary:
When navigating to web sites, the didFinishNavigation callback from WKNavigationDelegate can be called before the main frame load completes, which is not allowed according to the documentation. I have seen this happen with sites like nytimes.com, techmeme.com, and gmail.com.

Steps to Reproduce:
1. Put a breakpoint on the didFinishNavigation method.
2. Run app using WKWebView.
3. Navigate to nytimes.com.

Expected Results:
Breakpoint is hit, and the nytimes.com main frame is fully loaded.

Actual Results:
Breakpoint is hit, but the nytimes.com main frame is not fully loaded. 

Version:
iOS 9.1

Is there a suggested workaround?
Comment 1 gchatz 2015-12-08 19:04:51 PST
Associated radar: rdar://23815031

This happens on iPad and iPhone, most dramatically on iPad.