Index: ios/web/web_state/ui/crw_web_controller.mm |
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm |
index 0960224271346d774722efe5cafe0ab5dd7a4710..e7fe4f3c9eb05ce6788928bf465f04c870a81dd1 100644 |
--- a/ios/web/web_state/ui/crw_web_controller.mm |
+++ b/ios/web/web_state/ui/crw_web_controller.mm |
@@ -4767,8 +4767,9 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5; |
// Remove the transient content view. |
[self clearTransientContentView]; |
- DLOG_IF(WARNING, !_webView) << "_webView null while trying to load HTML"; |
_loadPhase = web::LOAD_REQUESTED; |
+ [self ensureWebViewCreated]; |
+ DCHECK(_webView) << "_webView null while trying to load HTML"; |
[_webView loadHTMLString:HTML baseURL:net::NSURLWithGURL(URL)]; |
} |
@@ -4975,13 +4976,6 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5; |
} |
} |
- if (!allowLoad && action.targetFrame.isMainFrame) { |
- // WKWebView will stop this navigation without calling any further |
- // callbacks, so change load phase to loaded now. |
- _loadPhase = web::PAGE_LOADED; |
- _webStateImpl->SetIsLoading(false); |
- } |
- |
decisionHandler(allowLoad ? WKNavigationActionPolicyAllow |
: WKNavigationActionPolicyCancel); |
} |