Commit 40de2a14 authored by Jérôme Lebel's avatar Jérôme Lebel Committed by Commit Bot

Revert "iOS 11 WKWebView load is broken"

This reverts commit 28dfaa0d.

Reason for revert: This appears fixed in Xcode 9 beta 4.

Original change's description:
> iOS 11 WKWebView load is broken
> 
> In iOS 11, WKWebView has issues (time outs) when loading request if the
> view is not part of the hierarchy. The WKWebView is now added to the
> hierarchy but off screen.
> 
> Bug: 738435, 739390
> Change-Id: Ica8584c30a24a11c04658774bd22a77273a93514
> Reviewed-on: https://chromium-review.googlesource.com/577807
> Commit-Queue: Jérôme Lebel <jlebel@chromium.org>
> Reviewed-by: Rohit Rao <rohitrao@chromium.org>
> Reviewed-by: Mihai Sardarescu <msarda@chromium.org>
> Reviewed-by: Eugene But <eugenebut@chromium.org>
> Reviewed-by: Justin Cohen <justincohen@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#488213}

TBR=rohitrao@chromium.org,msarda@chromium.org,justincohen@chromium.org,eugenebut@chromium.org,jlebel@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 738435, 739390
Change-Id: Ic57820325fef5ac86b93b4f02f449b97f0b458e0
Reviewed-on: https://chromium-review.googlesource.com/591671Reviewed-by: default avatarJustin Cohen <justincohen@chromium.org>
Reviewed-by: default avatarBenoit Zanotti <bzanotti@chromium.org>
Reviewed-by: default avatarJérôme Lebel <jlebel@chromium.org>
Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Commit-Queue: Jérôme Lebel <jlebel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#490743}
parent b8218917
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#import <WebKit/WebKit.h> #import <WebKit/WebKit.h>
#include "base/ios/ios_util.h"
#include "base/logging.h" #include "base/logging.h"
#import "base/mac/foundation_util.h" #import "base/mac/foundation_util.h"
#include "base/macros.h" #include "base/macros.h"
...@@ -395,15 +394,6 @@ WKWebView* AccountConsistencyService::GetWKWebView() { ...@@ -395,15 +394,6 @@ WKWebView* AccountConsistencyService::GetWKWebView() {
} }
if (!web_view_) { if (!web_view_) {
web_view_ = BuildWKWebView(); web_view_ = BuildWKWebView();
if (base::ios::IsRunningOnIOS11OrLater()) {
// On iOS 11 WKWebView load is broken if view is not a part of the
// hierarchy. Add view to the hierarchy, but place it offscreen to
// workaround iOS bug (rdar://33184203 and crbug.com/738435)
// TODO(crbug.com/739390): Remove this workaround.
web_view_.hidden = YES;
web_view_.frame = CGRectMake(-100, -100, 100, 100);
[UIApplication.sharedApplication.keyWindow addSubview:web_view_];
}
navigation_delegate_ = [[AccountConsistencyNavigationDelegate alloc] navigation_delegate_ = [[AccountConsistencyNavigationDelegate alloc]
initWithCallback:base::Bind(&AccountConsistencyService:: initWithCallback:base::Bind(&AccountConsistencyService::
FinishedApplyingCookieRequest, FinishedApplyingCookieRequest,
...@@ -420,13 +410,6 @@ WKWebView* AccountConsistencyService::BuildWKWebView() { ...@@ -420,13 +410,6 @@ WKWebView* AccountConsistencyService::BuildWKWebView() {
void AccountConsistencyService::ResetWKWebView() { void AccountConsistencyService::ResetWKWebView() {
[web_view_ setNavigationDelegate:nil]; [web_view_ setNavigationDelegate:nil];
[web_view_ stopLoading]; [web_view_ stopLoading];
if (base::ios::IsRunningOnIOS11OrLater()) {
// On iOS 11 WKWebView load is broken if view is not a part of the
// hierarchy. Add view to the hierarchy, but place it offscreen to
// workaround iOS bug (rdar://33184203 and crbug.com/738435)
// TODO(crbug.com/739390): Remove this workaround.
[web_view_ removeFromSuperview];
}
web_view_ = nil; web_view_ = nil;
navigation_delegate_ = nil; navigation_delegate_ = nil;
applying_cookie_requests_ = false; applying_cookie_requests_ = false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment