Bug 202543 - WKWebView.loading is never updated when stopLoading called right after loadRequest
Summary: WKWebView.loading is never updated when stopLoading called right after loadRe...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-10-03 13:18 PDT by Ali Juma
Modified: 2022-07-04 09:42 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ali Juma 2019-10-03 13:18:15 PDT
After the following snippet:

  [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"https://www.webkit.org"]]];
  [webView stopLoading];

webView.loading stays YES even though the load has been cancelled, and is never updated back to NO.

PageLoadState has a non-null pendingAPIRequest URL since nothing ever calls PageLoadState::clearPendingAPIRequest

This seems to be because the WebProcess is told to stopLoading after it's already sent the decidePolicyForNavigationAction IPC (which the UIProcess handles in the usual way) but before it receives the policy decision.
Comment 1 Brent Fulgham 2022-07-01 14:44:36 PDT
@Ali: Is this still happening for you?
Comment 2 Ali Juma 2022-07-04 06:10:49 PDT
(In reply to Brent Fulgham from comment #1)
> @Ali: Is this still happening for you?

Yes, this still happens (tested on iOS 16 beta 2).
Comment 3 Radar WebKit Bug Importer 2022-07-04 09:42:44 PDT
<rdar://problem/96401001>
Comment 4 Brent Fulgham 2022-07-04 09:42:53 PDT
Pulling in as active issue in current builds.