WebKit Bugzilla
Attachment 362648 Details for
Bug 194914
: Clicking "Go Back" on a safe browsing warning before a WKWebView has loaded any page should request to close the WKWebView
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194914-20190221142719.patch (text/plain), 7.87 KB, created by
Alex Christensen
on 2019-02-21 14:27:20 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alex Christensen
Created:
2019-02-21 14:27:20 PST
Size:
7.87 KB
patch
obsolete
>Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 241874) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,22 @@ >+2019-02-21 Alex Christensen <achristensen@webkit.org> >+ >+ Clicking "Go Back" on a safe browsing warning before a WKWebView has loaded any page should request to close the WKWebView >+ https://bugs.webkit.org/show_bug.cgi?id=194914 >+ <rdar://problem/47586889> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UIProcess/API/APIUIClient.h: >+ (API::UIClient::didShowSafeBrowsingWarning): >+ (API::UIClient::didClickGoBackFromSafeBrowsingWarning): Deleted. >+ * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: >+ * UIProcess/Cocoa/UIDelegate.h: >+ * UIProcess/Cocoa/UIDelegate.mm: >+ (WebKit::UIDelegate::setDelegate): >+ (WebKit::UIDelegate::UIClient::didClickGoBackFromSafeBrowsingWarning): Deleted. >+ * UIProcess/WebPageProxy.cpp: >+ (WebKit::WebPageProxy::decidePolicyForNavigationAction): >+ > 2019-02-21 Chris Dumez <cdumez@apple.com> > > Unreviewed API test fix after r241855. >Index: Source/WebKit/UIProcess/WebPageProxy.cpp >=================================================================== >--- Source/WebKit/UIProcess/WebPageProxy.cpp (revision 241754) >+++ Source/WebKit/UIProcess/WebPageProxy.cpp (working copy) >@@ -4516,7 +4516,8 @@ void WebPageProxy::decidePolicyForNaviga > }, [&] (ContinueUnsafeLoad continueUnsafeLoad) { > switch (continueUnsafeLoad) { > case ContinueUnsafeLoad::No: >- protectedThis->m_uiClient->didClickGoBackFromSafeBrowsingWarning(); >+ if (!protectedThis->hasCommittedAnyProvisionalLoads()) >+ protectedThis->m_uiClient->close(protectedThis.ptr()); > completionHandler(PolicyAction::Ignore); > break; > case ContinueUnsafeLoad::Yes: >Index: Source/WebKit/UIProcess/API/APIUIClient.h >=================================================================== >--- Source/WebKit/UIProcess/API/APIUIClient.h (revision 241753) >+++ Source/WebKit/UIProcess/API/APIUIClient.h (working copy) >@@ -182,7 +182,6 @@ public: > virtual void didExceedBackgroundResourceLimitWhileInForeground(WebKit::WebPageProxy&, WKResourceLimit) { } > > virtual void didShowSafeBrowsingWarning() { } >- virtual void didClickGoBackFromSafeBrowsingWarning() { } > }; > > } // namespace API >Index: Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h >=================================================================== >--- Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h (revision 241753) >+++ Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h (working copy) >@@ -102,7 +102,6 @@ struct UIEdgeInsets; > - (void)_webViewRequestPointerLock:(WKWebView *)webView WK_API_AVAILABLE(macosx(10.12.3)); > - (void)_webViewDidRequestPointerLock:(WKWebView *)webView completionHandler:(void (^)(BOOL))completionHandler WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); > - (void)_webViewDidShowSafeBrowsingWarning:(WKWebView *)webView WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); >-- (void)_webViewDidClickGoBackFromSafeBrowsingWarning:(WKWebView *)webView WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); > - (void)_webViewDidLosePointerLock:(WKWebView *)webView WK_API_AVAILABLE(macosx(10.12.3)); > - (void)_webView:(WKWebView *)webView hasVideoInPictureInPictureDidChange:(BOOL)hasVideoInPictureInPicture WK_API_AVAILABLE(macosx(10.13), ios(11.0)); > >Index: Source/WebKit/UIProcess/Cocoa/UIDelegate.h >=================================================================== >--- Source/WebKit/UIProcess/Cocoa/UIDelegate.h (revision 241753) >+++ Source/WebKit/UIProcess/Cocoa/UIDelegate.h (working copy) >@@ -148,7 +148,6 @@ private: > > void imageOrMediaDocumentSizeChanged(const WebCore::IntSize&) final; > void didShowSafeBrowsingWarning() final; >- void didClickGoBackFromSafeBrowsingWarning() final; > > UIDelegate& m_uiDelegate; > }; >@@ -226,7 +225,6 @@ private: > #endif > bool webViewHasVideoInPictureInPictureDidChange : 1; > bool webViewDidShowSafeBrowsingWarning : 1; >- bool webViewDidClickGoBackFromSafeBrowsingWarning : 1; > } m_delegateMethods; > }; > >Index: Source/WebKit/UIProcess/Cocoa/UIDelegate.mm >=================================================================== >--- Source/WebKit/UIProcess/Cocoa/UIDelegate.mm (revision 241753) >+++ Source/WebKit/UIProcess/Cocoa/UIDelegate.mm (working copy) >@@ -173,7 +173,6 @@ void UIDelegate::setDelegate(id <WKUIDel > > m_delegateMethods.webViewHasVideoInPictureInPictureDidChange = [delegate respondsToSelector:@selector(_webView:hasVideoInPictureInPictureDidChange:)]; > m_delegateMethods.webViewDidShowSafeBrowsingWarning = [delegate respondsToSelector:@selector(_webViewDidShowSafeBrowsingWarning:)]; >- m_delegateMethods.webViewDidClickGoBackFromSafeBrowsingWarning = [delegate respondsToSelector:@selector(_webViewDidClickGoBackFromSafeBrowsingWarning:)]; > } > > #if ENABLE(CONTEXT_MENUS) >@@ -1243,18 +1242,6 @@ void UIDelegate::UIClient::didShowSafeBr > [static_cast<id <WKUIDelegatePrivate>>(delegate) _webViewDidShowSafeBrowsingWarning:m_uiDelegate.m_webView]; > } > >-void UIDelegate::UIClient::didClickGoBackFromSafeBrowsingWarning() >-{ >- if (!m_uiDelegate.m_delegateMethods.webViewDidClickGoBackFromSafeBrowsingWarning) >- return; >- >- auto delegate = m_uiDelegate.m_delegate.get(); >- if (!delegate) >- return; >- >- [static_cast<id <WKUIDelegatePrivate>>(delegate) _webViewDidClickGoBackFromSafeBrowsingWarning:m_uiDelegate.m_webView]; >-} >- > void UIDelegate::UIClient::hasVideoInPictureInPictureDidChange(WebPageProxy*, bool hasVideoInPictureInPicture) > { > if (!m_uiDelegate.m_delegateMethods.webViewHasVideoInPictureInPictureDidChange) >Index: Tools/ChangeLog >=================================================================== >--- Tools/ChangeLog (revision 241875) >+++ Tools/ChangeLog (working copy) >@@ -1,3 +1,16 @@ >+2019-02-21 Alex Christensen <achristensen@webkit.org> >+ >+ Clicking "Go Back" on a safe browsing warning before a WKWebView has loaded any page should request to close the WKWebView >+ https://bugs.webkit.org/show_bug.cgi?id=194914 >+ <rdar://problem/47586889> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm: >+ (-[SafeBrowsingNavigationDelegate webViewDidClose:]): >+ (TEST): >+ (-[SafeBrowsingNavigationDelegate _webViewDidClickGoBackFromSafeBrowsingWarning:]): Deleted. >+ > 2019-02-21 Zalan Bujtas <zalan@apple.com> > > [LFC][Floats] Add support for placing formatting roots in-between floats. >Index: Tools/TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm >=================================================================== >--- Tools/TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm (revision 241729) >+++ Tools/TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm (working copy) >@@ -41,7 +41,7 @@ > > static bool committedNavigation; > static bool warningShown; >-static bool goBackClicked; >+static bool didCloseCalled; > > @interface SafeBrowsingNavigationDelegate : NSObject <WKNavigationDelegate, WKUIDelegatePrivate> > @end >@@ -58,9 +58,9 @@ - (void)_webViewDidShowSafeBrowsingWarni > warningShown = true; > } > >-- (void)_webViewDidClickGoBackFromSafeBrowsingWarning:(WKWebView *)webView >+- (void)webViewDidClose:(WKWebView *)webView > { >- goBackClicked = true; >+ didCloseCalled = true; > } > > @end >@@ -231,9 +231,9 @@ template<typename ViewType> void goBack( > TEST(SafeBrowsing, GoBack) > { > auto webView = safeBrowsingView(); >- EXPECT_FALSE(goBackClicked); >+ EXPECT_FALSE(didCloseCalled); > goBack([webView _safeBrowsingWarning]); >- EXPECT_TRUE(goBackClicked); >+ EXPECT_TRUE(didCloseCalled); > } > > template<typename ViewType> void visitUnsafeSite(ViewType *view)
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 194914
:
362633
| 362648