WebKit Bugzilla
Attachment 357577 Details for
Bug 192676
: Navigations away from the SafeBrowsing interstitial show a flash of old content
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192676-20181218100614.patch (text/plain), 4.18 KB, created by
Alex Christensen
on 2018-12-18 10:06:15 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alex Christensen
Created:
2018-12-18 10:06:15 PST
Size:
4.18 KB
patch
obsolete
>Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 239338) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,19 @@ >+2018-12-18 Alex Christensen <achristensen@webkit.org> >+ >+ Navigations away from the SafeBrowsing interstitial show a flash of old content >+ https://bugs.webkit.org/show_bug.cgi?id=192676 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ When a user clicks to continue through a safe browsing warning, do not remove the warning until the new page has rendered something meaningful. >+ >+ * UIProcess/API/Cocoa/WKWebView.mm: >+ (-[WKWebView _showSafeBrowsingWarning:completionHandler:]): >+ * UIProcess/Cocoa/WebViewImpl.mm: >+ (WebKit::WebViewImpl::showSafeBrowsingWarning): >+ * UIProcess/WebPageProxy.cpp: >+ (WebKit::WebPageProxy::didReachLayoutMilestone): >+ > 2018-12-18 Chris Dumez <cdumez@apple.com> > > Regression(r239182) SuspendedPage's process reuse for link navigation optimization sometimes broken >Index: Source/WebKit/UIProcess/WebPageProxy.cpp >=================================================================== >--- Source/WebKit/UIProcess/WebPageProxy.cpp (revision 239222) >+++ Source/WebKit/UIProcess/WebPageProxy.cpp (working copy) >@@ -4191,6 +4191,9 @@ void WebPageProxy::didReachLayoutMilesto > { > PageClientProtector protector(pageClient()); > >+ if (layoutMilestones.contains(DidFirstVisuallyNonEmptyLayout)) >+ pageClient().clearSafeBrowsingWarning(); >+ > if (m_loaderClient) > m_loaderClient->didReachLayoutMilestone(*this, layoutMilestones); > m_navigationClient->renderingProgressDidChange(*this, layoutMilestones); >Index: Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >=================================================================== >--- Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (revision 239222) >+++ Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (working copy) >@@ -1279,9 +1279,14 @@ - (void)_didChangeEditorState > - (void)_showSafeBrowsingWarning:(const WebKit::SafeBrowsingWarning&)warning completionHandler:(CompletionHandler<void(Variant<WebKit::ContinueUnsafeLoad, URL>&&)>&&)completionHandler > { > _safeBrowsingWarning = adoptNS([[WKSafeBrowsingWarning alloc] initWithFrame:self.bounds safeBrowsingWarning:warning completionHandler:[weakSelf = WeakObjCPtr<WKWebView>(self), completionHandler = WTFMove(completionHandler)] (auto&& result) mutable { >- if (auto strongSelf = weakSelf.get()) >- [std::exchange(strongSelf->_safeBrowsingWarning, nullptr) removeFromSuperview]; > completionHandler(WTFMove(result)); >+ auto strongSelf = weakSelf.get(); >+ if (!strongSelf) >+ return; >+ auto* continueUnsafeLoad = WTF::get_if<WebKit::ContinueUnsafeLoad>(result); >+ if (continueUnsafeLoad && *continueUnsafeLoad == WebKit::ContinueUnsafeLoad::Yes) >+ return; >+ [std::exchange(strongSelf->_safeBrowsingWarning, nullptr) removeFromSuperview]; > }]); > [self addSubview:_safeBrowsingWarning.get()]; > } >Index: Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm >=================================================================== >--- Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm (revision 239222) >+++ Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm (working copy) >@@ -1622,9 +1622,13 @@ void WebViewImpl::showSafeBrowsingWarnin > return completionHandler(ContinueUnsafeLoad::Yes); > > m_safeBrowsingWarning = adoptNS([[WKSafeBrowsingWarning alloc] initWithFrame:[m_view bounds] safeBrowsingWarning:warning completionHandler:[weakThis = makeWeakPtr(*this), completionHandler = WTFMove(completionHandler)] (auto&& result) mutable { >- if (weakThis) >- [std::exchange(weakThis->m_safeBrowsingWarning, nullptr) removeFromSuperview]; > completionHandler(WTFMove(result)); >+ if (!weakThis) >+ return; >+ auto* continueUnsafeLoad = WTF::get_if<ContinueUnsafeLoad>(result); >+ if (continueUnsafeLoad && *continueUnsafeLoad == ContinueUnsafeLoad::Yes) >+ return; >+ [std::exchange(weakThis->m_safeBrowsingWarning, nullptr) removeFromSuperview]; > }]); > [m_view addSubview:m_safeBrowsingWarning.get()]; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192676
:
357577
|
357738
|
357742