Unreviewed, rolling out r222033.
authorryanhaddad@apple.com <ryanhaddad@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Sep 2017 20:12:03 +0000 (20:12 +0000)
committerryanhaddad@apple.com <ryanhaddad@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Sep 2017 20:12:03 +0000 (20:12 +0000)
This change caused API test WebKit.PrintFrame to time out.

Reverted changeset:

"Add WKUIDelegatePrivate equivalent of WKPageUIClient's
drawHeader, drawFooter, headerHeight, and footerHeight"
https://bugs.webkit.org/show_bug.cgi?id=176889
http://trac.webkit.org/changeset/222033

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222047 268f45cc-cd09-0410-ab3c-d52691b4dbfc

25 files changed:
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/C/WKPage.cpp
Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextController.mm
Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp
Source/WebKit/UIProcess/Cocoa/UIDelegate.h
Source/WebKit/UIProcess/Cocoa/UIDelegate.mm
Source/WebKit/UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm
Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
Source/WebKit/UIProcess/FrameLoadState.cpp
Source/WebKit/UIProcess/FrameLoadState.h
Source/WebKit/UIProcess/WebFrameProxy.cpp
Source/WebKit/UIProcess/WebFrameProxy.h
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h
Source/WebKit/UIProcess/WebPageProxy.messages.in
Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKit/WebProcess/WebPage/WebPage.h
Source/WebKit/WebProcess/WebPage/WebPage.messages.in
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm
Tools/TestWebKitAPI/cocoa/TestWKWebView.h
Tools/TestWebKitAPI/cocoa/TestWKWebView.mm

index 776b76d..5542f1d 100644 (file)
@@ -1,3 +1,16 @@
+2017-09-14  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r222033.
+
+        This change caused API test WebKit.PrintFrame to time out.
+
+        Reverted changeset:
+
+        "Add WKUIDelegatePrivate equivalent of WKPageUIClient's
+        drawHeader, drawFooter, headerHeight, and footerHeight"
+        https://bugs.webkit.org/show_bug.cgi?id=176889
+        http://trac.webkit.org/changeset/222033
+
 2017-09-14  Alex Christensen  <achristensen@webkit.org>
 
         Add WKUIDelegatePrivate equivalent of WKPageUIClient's drawHeader, drawFooter, headerHeight, and footerHeight
index 82dd3e1..067c0ec 100644 (file)
@@ -209,12 +209,12 @@ void WKPageLoadHTMLStringWithUserData(WKPageRef pageRef, WKStringRef htmlStringR
 
 void WKPageLoadAlternateHTMLString(WKPageRef pageRef, WKStringRef htmlStringRef, WKURLRef baseURLRef, WKURLRef unreachableURLRef)
 {
-    toImpl(pageRef)->loadAlternateHTMLString(toWTFString(htmlStringRef), URL(URL(), toWTFString(baseURLRef)), URL(URL(), toWTFString(unreachableURLRef)));
+    toImpl(pageRef)->loadAlternateHTMLString(toWTFString(htmlStringRef), toWTFString(baseURLRef), toWTFString(unreachableURLRef));
 }
 
 void WKPageLoadAlternateHTMLStringWithUserData(WKPageRef pageRef, WKStringRef htmlStringRef, WKURLRef baseURLRef, WKURLRef unreachableURLRef, WKTypeRef userDataRef)
 {
-    toImpl(pageRef)->loadAlternateHTMLString(toWTFString(htmlStringRef), URL(URL(), toWTFString(baseURLRef)), URL(URL(), toWTFString(unreachableURLRef)), toImpl(userDataRef));
+    toImpl(pageRef)->loadAlternateHTMLString(toWTFString(htmlStringRef), toWTFString(baseURLRef), toWTFString(unreachableURLRef), toImpl(userDataRef));
 }
 
 void WKPageLoadPlainTextString(WKPageRef pageRef, WKStringRef plainTextStringRef)
index b7e5e69..2aee0c9 100644 (file)
@@ -157,7 +157,7 @@ static HashMap<WebPageProxy*, WKBrowsingContextController *>& browsingContextCon
 
 - (void)loadAlternateHTMLString:(NSString *)string baseURL:(NSURL *)baseURL forUnreachableURL:(NSURL *)unreachableURL
 {
-    _page->loadAlternateHTMLString(string, baseURL, unreachableURL);
+    _page->loadAlternateHTMLString(string, [baseURL _web_originalDataAsWTFString], [unreachableURL _web_originalDataAsWTFString]);
 }
 
 - (void)loadData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)encodingName baseURL:(NSURL *)baseURL
index 8937945..c47e5d2 100644 (file)
@@ -161,10 +161,6 @@ struct UIEdgeInsets;
 - (void)_webView:(WKWebView *)webView didClickAutoFillButtonWithUserInfo:(id <NSSecureCoding>)userInfo WK_API_AVAILABLE(macosx(WK_MAC_TBA));
 - (void)_webView:(WKWebView *)webView getToolbarsAreVisibleWithCompletionHandler:(void(^)(BOOL))completionHandler WK_API_AVAILABLE(macosx(WK_MAC_TBA));
 - (void)_webView:(WKWebView *)webView saveDataToFile:(NSData *)data suggestedFilename:(NSString *)suggestedFilename mimeType:(NSString *)mimeType originatingURL:(NSURL *)url WK_API_AVAILABLE(macosx(WK_MAC_TBA));
-- (CGFloat)_webViewHeaderHeight:(WKWebView *)webView WK_API_AVAILABLE(macosx(WK_MAC_TBA));
-- (CGFloat)_webViewFooterHeight:(WKWebView *)webView WK_API_AVAILABLE(macosx(WK_MAC_TBA));
-- (void)_webView:(WKWebView *)webView drawHeaderInRect:(CGRect)rect forPageWithTitle:(NSString *)title URL:(NSURL *)url WK_API_AVAILABLE(macosx(WK_MAC_TBA));
-- (void)_webView:(WKWebView *)webView drawFooterInRect:(CGRect)rect forPageWithTitle:(NSString *)title URL:(NSURL *)url WK_API_AVAILABLE(macosx(WK_MAC_TBA));
 - (void)_webView:(WKWebView *)webView requestNotificationPermissionForSecurityOrigin:(WKSecurityOrigin *)securityOrigin decisionHandler:(void (^)(BOOL))decisionHandler WK_API_AVAILABLE(macosx(WK_MAC_TBA));
 - (void)_webView:(WKWebView *)webview mouseDidMoveOverElement:(_WKHitTestResult *)hitTestResult withFlags:(NSEventModifierFlags)flags userInfo:(id <NSSecureCoding>)userInfo;
 - (void)_webView:(WKWebView *)webView didExceedBackgroundResourceLimitWhileInForeground:(_WKResourceLimit)limit WK_API_AVAILABLE(macosx(WK_MAC_TBA));
index f52f2f4..0494706 100644 (file)
@@ -3839,7 +3839,7 @@ WEBCORE_COMMAND(yankAndSelect)
 
 - (void)_loadAlternateHTMLString:(NSString *)string baseURL:(NSURL *)baseURL forUnreachableURL:(NSURL *)unreachableURL
 {
-    _page->loadAlternateHTMLString(string, baseURL, unreachableURL);
+    _page->loadAlternateHTMLString(string, [baseURL _web_originalDataAsWTFString], [unreachableURL _web_originalDataAsWTFString]);
 }
 
 - (WKNavigation *)_loadData:(NSData *)data MIMEType:(NSString *)MIMEType characterEncodingName:(NSString *)characterEncodingName baseURL:(NSURL *)baseURL userData:(id)userData
index 0c17983..c4bd1c2 100644 (file)
@@ -65,7 +65,6 @@
 #include <WebCore/GUniquePtrSoup.h>
 #include <WebCore/JSDOMExceptionHandling.h>
 #include <WebCore/RefPtrCairo.h>
-#include <WebCore/URL.h>
 #include <glib/gi18n-lib.h>
 #include <wtf/SetForScope.h>
 #include <wtf/glib/GRefPtr.h>
@@ -2492,7 +2491,7 @@ void webkit_web_view_load_alternate_html(WebKitWebView* webView, const gchar* co
     g_return_if_fail(content);
     g_return_if_fail(contentURI);
 
-    getPage(webView).loadAlternateHTMLString(String::fromUTF8(content), URL(URL(), String::fromUTF8(baseURI)), URL(URL(), String::fromUTF8(contentURI)));
+    getPage(webView).loadAlternateHTMLString(String::fromUTF8(content), String::fromUTF8(baseURI), String::fromUTF8(contentURI));
 }
 
 /**
@@ -2628,7 +2627,7 @@ void webkit_web_view_reload_bypass_cache(WebKitWebView* webView)
 {
     g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
 
-    getPage(webView).reload(ReloadOption::FromOrigin);
+    getPage(webView).reload(WebCore::ReloadOption::FromOrigin);
 }
 
 /**
@@ -3156,7 +3155,7 @@ JSGlobalContextRef webkit_web_view_get_javascript_global_context(WebKitWebView*
     return webView->priv->javascriptGlobalContext.get();
 }
 
-static void webkitWebViewRunJavaScriptCallback(API::SerializedScriptValue* wkSerializedScriptValue, const ExceptionDetails& exceptionDetails, GTask* task)
+static void webkitWebViewRunJavaScriptCallback(API::SerializedScriptValue* wkSerializedScriptValue, const WebCore::ExceptionDetails& exceptionDetails, GTask* task)
 {
     if (g_task_return_error_if_cancelled(task))
         return;
@@ -3207,7 +3206,7 @@ void webkit_web_view_run_javascript(WebKitWebView* webView, const gchar* script,
     g_return_if_fail(script);
 
     GTask* task = g_task_new(webView, cancellable, callback, userData);
-    getPage(webView).runJavaScriptInMainFrame(String::fromUTF8(script), true, [task](API::SerializedScriptValue* serializedScriptValue, bool, const ExceptionDetails& exceptionDetails, WebKit::CallbackBase::Error) {
+    getPage(webView).runJavaScriptInMainFrame(String::fromUTF8(script), true, [task](API::SerializedScriptValue* serializedScriptValue, bool, const WebCore::ExceptionDetails& exceptionDetails, WebKit::CallbackBase::Error) {
         webkitWebViewRunJavaScriptCallback(serializedScriptValue, exceptionDetails, adoptGRef(task).get());
     });
 }
@@ -3298,7 +3297,7 @@ static void resourcesStreamReadCallback(GObject* object, GAsyncResult* result, g
     WebKitWebView* webView = WEBKIT_WEB_VIEW(g_task_get_source_object(task.get()));
     gpointer outputStreamData = g_memory_output_stream_get_data(G_MEMORY_OUTPUT_STREAM(object));
     getPage(webView).runJavaScriptInMainFrame(String::fromUTF8(reinterpret_cast<const gchar*>(outputStreamData)), true,
-        [task](API::SerializedScriptValue* serializedScriptValue, bool, const ExceptionDetails& exceptionDetails, WebKit::CallbackBase::Error) {
+        [task](API::SerializedScriptValue* serializedScriptValue, bool, const WebCore::ExceptionDetails& exceptionDetails, WebKit::CallbackBase::Error) {
             webkitWebViewRunJavaScriptCallback(serializedScriptValue, exceptionDetails, task.get());
         });
 }
index 5fbca66..304baf2 100644 (file)
@@ -105,10 +105,6 @@ private:
         void setWindowFrame(WebPageProxy&, const WebCore::FloatRect&) final;
         void windowFrame(WebPageProxy&, Function<void(WebCore::FloatRect)>&&) final;
         void didNotHandleWheelEvent(WebPageProxy*, const NativeWebWheelEvent&) final;
-        float headerHeight(WebPageProxy&, WebFrameProxy&) final;
-        float footerHeight(WebPageProxy&, WebFrameProxy&) final;
-        void drawHeader(WebPageProxy&, WebFrameProxy&, WebCore::FloatRect&&) final;
-        void drawFooter(WebPageProxy&, WebFrameProxy&, WebCore::FloatRect&&) final;
         void decidePolicyForNotificationPermissionRequest(WebPageProxy&, API::SecurityOrigin&, Function<void(bool)>&&) final;
         void handleAutoplayEvent(WebPageProxy&, WebCore::AutoplayEvent, OptionSet<WebCore::AutoplayEventFlags>) final;
         void unavailablePluginButtonClicked(WebPageProxy&, WKPluginUnavailabilityReason, API::Dictionary&) final;
@@ -164,16 +160,12 @@ private:
         bool webViewRunModal : 1;
         bool webViewTakeFocus : 1;
         bool webViewDidScroll : 1;
-        bool webViewHeaderHeight : 1;
-        bool webViewFooterHeight : 1;
         bool webViewSetResizable : 1;
         bool webViewSetWindowFrame : 1;
         bool webViewDidNotHandleWheelEvent : 1;
         bool webViewHandleAutoplayEventWithFlags : 1;
         bool webViewUnavailablePlugInButtonClicked : 1;
         bool webViewDidClickAutoFillButtonWithUserInfo : 1;
-        bool webViewDrawHeaderInRectForPageWithTitleURL : 1;
-        bool webViewDrawFooterInRectForPageWithTitleURL : 1;
         bool webViewGetWindowFrameWithCompletionHandler : 1;
         bool webViewMouseDidMoveOverElementWithFlagsUserInfo : 1;
         bool webViewGetToolbarsAreVisibleWithCompletionHandler : 1;
index a1f19d5..e05e12c 100644 (file)
@@ -120,10 +120,6 @@ void UIDelegate::setDelegate(id <WKUIDelegate> delegate)
     m_delegateMethods.webViewUnavailablePlugInButtonClicked = [delegate respondsToSelector:@selector(_webView:unavailablePlugInButtonClickedWithReason:plugInInfo:)];
     m_delegateMethods.webViewHandleAutoplayEventWithFlags = [delegate respondsToSelector:@selector(_webView:handleAutoplayEvent:withFlags:)];
     m_delegateMethods.webViewDidClickAutoFillButtonWithUserInfo = [delegate respondsToSelector:@selector(_webView:didClickAutoFillButtonWithUserInfo:)];
-    m_delegateMethods.webViewDrawHeaderInRectForPageWithTitleURL = [delegate respondsToSelector:@selector(_webView:drawHeaderInRect:forPageWithTitle:URL:)];
-    m_delegateMethods.webViewDrawFooterInRectForPageWithTitleURL = [delegate respondsToSelector:@selector(_webView:drawFooterInRect:forPageWithTitle:URL:)];
-    m_delegateMethods.webViewHeaderHeight = [delegate respondsToSelector:@selector(_webViewHeaderHeight:)];
-    m_delegateMethods.webViewFooterHeight = [delegate respondsToSelector:@selector(_webViewFooterHeight:)];
     m_delegateMethods.webViewMouseDidMoveOverElementWithFlagsUserInfo = [delegate respondsToSelector:@selector(_webView:mouseDidMoveOverElement:withFlags:userInfo:)];
     m_delegateMethods.webViewDidExceedBackgroundResourceLimitWhileInForeground = [delegate respondsToSelector:@selector(_webView:didExceedBackgroundResourceLimitWhileInForeground:)];
     m_delegateMethods.webViewSaveDataToFileSuggestedFilenameMimeTypeOriginatingURL = [delegate respondsToSelector:@selector(_webView:saveDataToFile:suggestedFilename:mimeType:originatingURL:)];
@@ -427,54 +423,6 @@ void UIDelegate::UIClient::runModal(WebPageProxy&)
     [(id <WKUIDelegatePrivate>)delegate _webViewRunModal:m_uiDelegate.m_webView];
 }
 
-float UIDelegate::UIClient::headerHeight(WebPageProxy&, WebFrameProxy& webFrameProxy)
-{
-    if (!m_uiDelegate.m_delegateMethods.webViewHeaderHeight)
-        return 0;
-    
-    auto delegate = m_uiDelegate.m_delegate.get();
-    if (!delegate)
-        return 0;
-    
-    return [(id <WKUIDelegatePrivate>)delegate _webViewHeaderHeight:m_uiDelegate.m_webView];
-}
-
-float UIDelegate::UIClient::footerHeight(WebPageProxy&, WebFrameProxy&)
-{
-    if (!m_uiDelegate.m_delegateMethods.webViewFooterHeight)
-        return 0;
-    
-    auto delegate = m_uiDelegate.m_delegate.get();
-    if (!delegate)
-        return 0;
-    
-    return [(id <WKUIDelegatePrivate>)delegate _webViewFooterHeight:m_uiDelegate.m_webView];
-}
-
-void UIDelegate::UIClient::drawHeader(WebPageProxy&, WebFrameProxy& frame, WebCore::FloatRect&& rect)
-{
-    if (!m_uiDelegate.m_delegateMethods.webViewDrawHeaderInRectForPageWithTitleURL)
-        return;
-    
-    auto delegate = m_uiDelegate.m_delegate.get();
-    if (!delegate)
-        return;
-    
-    [(id <WKUIDelegatePrivate>)delegate _webView:m_uiDelegate.m_webView drawHeaderInRect:rect forPageWithTitle:frame.title() URL:frame.url()];
-}
-
-void UIDelegate::UIClient::drawFooter(WebPageProxy&, WebFrameProxy& frame, WebCore::FloatRect&& rect)
-{
-    if (!m_uiDelegate.m_delegateMethods.webViewDrawFooterInRectForPageWithTitleURL)
-        return;
-    
-    auto delegate = m_uiDelegate.m_delegate.get();
-    if (!delegate)
-        return;
-    
-    [(id <WKUIDelegatePrivate>)delegate _webView:m_uiDelegate.m_webView drawFooterInRect:rect forPageWithTitle:frame.title() URL:frame.url()];
-}
-
 void UIDelegate::UIClient::pageDidScroll(WebPageProxy*)
 {
     if (!m_uiDelegate.m_delegateMethods.webViewDidScroll)
index 8018156..ec2ecc2 100644 (file)
@@ -69,7 +69,7 @@
     if (!webFrameProxy)
         return NO;
 
-    webFrameProxy->loadURL(WebCore::URL(WebCore::URL(), _urlString));
+    webFrameProxy->loadURL(_urlString);
     return YES;
 }
 
index 9980e15..8f72286 100644 (file)
@@ -1624,7 +1624,7 @@ bool WebViewImpl::canChangeFrameLayout(WebFrameProxy& frame)
 
 NSPrintOperation *WebViewImpl::printOperationWithPrintInfo(NSPrintInfo *printInfo, WebFrameProxy& frame)
 {
-    LOG(Printing, "Creating an NSPrintOperation for frame '%s'", frame.url().string().utf8().data());
+    LOG(Printing, "Creating an NSPrintOperation for frame '%s'", frame.url().utf8().data());
 
     // FIXME: If the frame cannot be printed (e.g. if it contains an encrypted PDF that disallows
     // printing), this function should return nil.
index 9fe3c76..d28f5c6 100644 (file)
 
 namespace WebKit {
 
+FrameLoadState::FrameLoadState()
+    : m_state(State::Finished)
+{
+}
+
 FrameLoadState::~FrameLoadState()
 {
 }
 
-void FrameLoadState::didStartProvisionalLoad(const WebCore::URL& url)
+void FrameLoadState::didStartProvisionalLoad(const String& url)
 {
     ASSERT(m_provisionalURL.isEmpty());
 
@@ -40,7 +45,7 @@ void FrameLoadState::didStartProvisionalLoad(const WebCore::URL& url)
     m_provisionalURL = url;
 }
 
-void FrameLoadState::didReceiveServerRedirectForProvisionalLoad(const WebCore::URL& url)
+void FrameLoadState::didReceiveServerRedirectForProvisionalLoad(const String& url)
 {
     ASSERT(m_state == State::Provisional);
 
@@ -52,7 +57,7 @@ void FrameLoadState::didFailProvisionalLoad()
     ASSERT(m_state == State::Provisional);
 
     m_state = State::Finished;
-    m_provisionalURL = { };
+    m_provisionalURL = String();
     m_unreachableURL = m_lastUnreachableURL;
 }
 
@@ -62,7 +67,7 @@ void FrameLoadState::didCommitLoad()
 
     m_state = State::Committed;
     m_url = m_provisionalURL;
-    m_provisionalURL = { };
+    m_provisionalURL = String();
 }
 
 void FrameLoadState::didFinishLoad()
@@ -81,12 +86,12 @@ void FrameLoadState::didFailLoad()
     m_state = State::Finished;
 }
 
-void FrameLoadState::didSameDocumentNotification(const WebCore::URL& url)
+void FrameLoadState::didSameDocumentNotification(const String& url)
 {
     m_url = url;
 }
 
-void FrameLoadState::setUnreachableURL(const WebCore::URL& unreachableURL)
+void FrameLoadState::setUnreachableURL(const String& unreachableURL)
 {
     m_lastUnreachableURL = m_unreachableURL;
     m_unreachableURL = unreachableURL;
index 98c325e..2d359b8 100644 (file)
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#pragma once
+#ifndef FrameLoadState_h
+#define FrameLoadState_h
 
-#include <WebCore/URL.h>
+#include <wtf/text/WTFString.h>
 
 namespace WebKit {
 
 class FrameLoadState {
 public:
+    FrameLoadState();
     ~FrameLoadState();
 
     enum class State {
@@ -39,29 +41,31 @@ public:
         Finished
     };
 
-    void didStartProvisionalLoad(const WebCore::URL&);
-    void didReceiveServerRedirectForProvisionalLoad(const WebCore::URL&);
+    void didStartProvisionalLoad(const String& url);
+    void didReceiveServerRedirectForProvisionalLoad(const String& url);
     void didFailProvisionalLoad();
 
     void didCommitLoad();
     void didFinishLoad();
     void didFailLoad();
 
-    void didSameDocumentNotification(const WebCore::URL&);
+    void didSameDocumentNotification(const String&);
 
     State state() const { return m_state; }
-    const WebCore::URL& url() const { return m_url; }
-    const WebCore::URL& provisionalURL() const { return m_provisionalURL; }
+    const String& url() const { return m_url; }
+    const String& provisionalURL() const { return m_provisionalURL; }
 
-    void setUnreachableURL(const WebCore::URL&);
-    const WebCore::URL& unreachableURL() const { return m_unreachableURL; }
+    void setUnreachableURL(const String&);
+    const String& unreachableURL() const { return m_unreachableURL; }
 
 private:
-    State m_state { State::Finished };
-    WebCore::URL m_url;
-    WebCore::URL m_provisionalURL;
-    WebCore::URL m_unreachableURL;
-    WebCore::URL m_lastUnreachableURL;
+    State m_state;
+    String m_url;
+    String m_provisionalURL;
+    String m_unreachableURL;
+    String m_lastUnreachableURL;
 };
 
 } // namespace WebKit
+
+#endif // FrameLoadState_h
index a91da4a..6bcc478 100644 (file)
@@ -76,7 +76,7 @@ bool WebFrameProxy::isMainFrame() const
     return this == m_page->mainFrame();
 }
 
-void WebFrameProxy::loadURL(const URL& url)
+void WebFrameProxy::loadURL(const String& url)
 {
     if (!m_page)
         return;
@@ -130,12 +130,12 @@ bool WebFrameProxy::isDisplayingPDFDocument() const
     return MIMETypeRegistry::isPDFOrPostScriptMIMEType(m_MIMEType);
 }
 
-void WebFrameProxy::didStartProvisionalLoad(const URL& url)
+void WebFrameProxy::didStartProvisionalLoad(const String& url)
 {
     m_frameLoadState.didStartProvisionalLoad(url);
 }
 
-void WebFrameProxy::didReceiveServerRedirectForProvisionalLoad(const URL& url)
+void WebFrameProxy::didReceiveServerRedirectForProvisionalLoad(const String& url)
 {
     m_frameLoadState.didReceiveServerRedirectForProvisionalLoad(url);
 }
@@ -166,7 +166,7 @@ void WebFrameProxy::didFailLoad()
     m_frameLoadState.didFailLoad();
 }
 
-void WebFrameProxy::didSameDocumentNavigation(const URL& url)
+void WebFrameProxy::didSameDocumentNavigation(const String& url)
 {
     m_frameLoadState.didSameDocumentNotification(url);
 }
@@ -176,7 +176,7 @@ void WebFrameProxy::didChangeTitle(const String& title)
     m_title = title;
 }
 
-void WebFrameProxy::receivedPolicyDecision(PolicyAction action, uint64_t listenerID, API::Navigation* navigation, const WebsitePolicies& websitePolicies)
+void WebFrameProxy::receivedPolicyDecision(WebCore::PolicyAction action, uint64_t listenerID, API::Navigation* navigation, const WebsitePolicies& websitePolicies)
 {
     if (!m_page)
         return;
@@ -232,13 +232,13 @@ void WebFrameProxy::getResourceData(API::URL* resourceURL, Function<void (API::D
     m_page->getResourceDataFromFrame(this, resourceURL, WTFMove(callbackFunction));
 }
 
-void WebFrameProxy::setUnreachableURL(const URL& unreachableURL)
+void WebFrameProxy::setUnreachableURL(const String& unreachableURL)
 {
     m_frameLoadState.setUnreachableURL(unreachableURL);
 }
 
 #if ENABLE(CONTENT_FILTERING)
-bool WebFrameProxy::didHandleContentFilterUnblockNavigation(const ResourceRequest& request)
+bool WebFrameProxy::didHandleContentFilterUnblockNavigation(const WebCore::ResourceRequest& request)
 {
     if (!m_contentFilterUnblockHandler.canHandleRequest(request)) {
         m_contentFilterUnblockHandler = { };
index b792d02..6a6da2e 100644 (file)
@@ -77,14 +77,14 @@ public:
 
     FrameLoadState& frameLoadState() { return m_frameLoadState; }
 
-    void loadURL(const WebCore::URL&);
+    void loadURL(const String&);
     void stopLoading() const;
 
-    const WebCore::URL& url() const { return m_frameLoadState.url(); }
-    const WebCore::URL& provisionalURL() const { return m_frameLoadState.provisionalURL(); }
+    const String& url() const { return m_frameLoadState.url(); }
+    const String& provisionalURL() const { return m_frameLoadState.provisionalURL(); }
 
-    void setUnreachableURL(const WebCore::URL&);
-    const WebCore::URL& unreachableURL() const { return m_frameLoadState.unreachableURL(); }
+    void setUnreachableURL(const String&);
+    const String& unreachableURL() const { return m_frameLoadState.unreachableURL(); }
 
     const String& mimeType() const { return m_MIMEType; }
     bool containsPluginDocument() const { return m_containsPluginDocument; }
@@ -105,13 +105,13 @@ public:
     void getMainResourceData(Function<void (API::Data*, CallbackBase::Error)>&&);
     void getResourceData(API::URL*, Function<void (API::Data*, CallbackBase::Error)>&&);
 
-    void didStartProvisionalLoad(const WebCore::URL&);
-    void didReceiveServerRedirectForProvisionalLoad(const WebCore::URL&);
+    void didStartProvisionalLoad(const String& url);
+    void didReceiveServerRedirectForProvisionalLoad(const String& url);
     void didFailProvisionalLoad();
     void didCommitLoad(const String& contentType, WebCertificateInfo&, bool containsPluginDocument);
     void didFinishLoad();
     void didFailLoad();
-    void didSameDocumentNavigation(const WebCore::URL&); // eg. anchor navigation, session state change.
+    void didSameDocumentNavigation(const String&); // eg. anchor navigation, session state change.
     void didChangeTitle(const String&);
 
     // Policy operations.
index 57cfbc0..9cc5efa 100644 (file)
@@ -961,7 +961,7 @@ RefPtr<API::Navigation> WebPageProxy::loadHTMLString(const String& htmlString, c
     return WTFMove(navigation);
 }
 
-void WebPageProxy::loadAlternateHTMLString(const String& htmlString, const WebCore::URL& baseURL, const WebCore::URL& unreachableURL, API::Object* userData)
+void WebPageProxy::loadAlternateHTMLString(const String& htmlString, const String& baseURL, const String& unreachableURL, API::Object* userData)
 {
     // When the UIProcess is in the process of handling a failing provisional load, do not attempt to
     // start a second alternative HTML load as this will prevent the page load state from being
@@ -3146,7 +3146,7 @@ void WebPageProxy::didDestroyNavigation(uint64_t navigationID)
     m_navigationState->didDestroyNavigation(navigationID);
 }
 
-void WebPageProxy::didStartProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::URL&& url, WebCore::URL&& unreachableURL, const UserData& userData)
+void WebPageProxy::didStartProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& url, const String& unreachableURL, const UserData& userData)
 {
     PageClientProtector protector(m_pageClient);
 
@@ -3180,7 +3180,7 @@ void WebPageProxy::didStartProvisionalLoadForFrame(uint64_t frameID, uint64_t na
         m_loaderClient->didStartProvisionalLoadForFrame(*this, *frame, navigation.get(), m_process->transformHandlesToObjects(userData.object()).get());
 }
 
-void WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::URL&& url, const UserData& userData)
+void WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& url, const UserData& userData)
 {
     PageClientProtector protector(m_pageClient);
 
@@ -3234,7 +3234,7 @@ void WebPageProxy::didCancelClientRedirectForFrame(uint64_t frameID)
     }
 }
 
-void WebPageProxy::didChangeProvisionalURLForFrame(uint64_t frameID, uint64_t, WebCore::URL&& url)
+void WebPageProxy::didChangeProvisionalURLForFrame(uint64_t frameID, uint64_t, const String& url)
 {
     PageClientProtector protector(m_pageClient);
 
@@ -3482,7 +3482,7 @@ void WebPageProxy::didFailLoadForFrame(uint64_t frameID, uint64_t navigationID,
         m_pageClient.didFailLoadForMainFrame();
 }
 
-void WebPageProxy::didSameDocumentNavigationForFrame(uint64_t frameID, uint64_t navigationID, uint32_t opaqueSameDocumentNavigationType, WebCore::URL&& url, const UserData& userData)
+void WebPageProxy::didSameDocumentNavigationForFrame(uint64_t frameID, uint64_t navigationID, uint32_t opaqueSameDocumentNavigationType, const String& url, const UserData& userData)
 {
     PageClientProtector protector(m_pageClient);
 
index a2c599a..e4337bc 100644 (file)
@@ -395,7 +395,7 @@ public:
     RefPtr<API::Navigation> loadFile(const String& fileURL, const String& resourceDirectoryURL, API::Object* userData = nullptr);
     RefPtr<API::Navigation> loadData(API::Data*, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData = nullptr);
     RefPtr<API::Navigation> loadHTMLString(const String& htmlString, const String& baseURL, API::Object* userData = nullptr);
-    void loadAlternateHTMLString(const String& htmlString, const WebCore::URL& baseURL, const WebCore::URL& unreachableURL, API::Object* userData = nullptr);
+    void loadAlternateHTMLString(const String& htmlString, const String& baseURL, const String& unreachableURL, API::Object* userData = nullptr);
     void loadPlainTextString(const String&, API::Object* userData = nullptr);
     void loadWebArchiveData(API::Data*, API::Object* userData = nullptr);
     void navigateToPDFLinkWithSimulatedClick(const String& url, WebCore::IntPoint documentPoint, WebCore::IntPoint screenPoint);
@@ -1248,17 +1248,17 @@ private:
     void didCreateMainFrame(uint64_t frameID);
     void didCreateSubframe(uint64_t frameID);
 
-    void didStartProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::URL&&, WebCore::URL&& unreachableURL, const UserData&);
-    void didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::URL&&, const UserData&);
+    void didStartProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& url, const String& unreachableURL, const UserData&);
+    void didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, const String&, const UserData&);
     void willPerformClientRedirectForFrame(uint64_t frameID, const String& url, double delay);
     void didCancelClientRedirectForFrame(uint64_t frameID);
-    void didChangeProvisionalURLForFrame(uint64_t frameID, uint64_t navigationID, WebCore::URL&&);
+    void didChangeProvisionalURLForFrame(uint64_t frameID, uint64_t navigationID, const String& url);
     void didFailProvisionalLoadForFrame(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const String& provisionalURL, const WebCore::ResourceError&, const UserData&);
     void didCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, uint32_t frameLoadType, const WebCore::CertificateInfo&, bool containsPluginDocument, std::optional<WebCore::HasInsecureContent> forcedHasInsecureContent, const UserData&);
     void didFinishDocumentLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&);
     void didFinishLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&);
     void didFailLoadForFrame(uint64_t frameID, uint64_t navigationID, const WebCore::ResourceError&, const UserData&);
-    void didSameDocumentNavigationForFrame(uint64_t frameID, uint64_t navigationID, uint32_t sameDocumentNavigationType, WebCore::URL&&, const UserData&);
+    void didSameDocumentNavigationForFrame(uint64_t frameID, uint64_t navigationID, uint32_t sameDocumentNavigationType, const String&, const UserData&);
     void didChangeMainDocument(uint64_t frameID);
 
     void didReceiveTitleForFrame(uint64_t frameID, const String&, const UserData&);
index ca2a0f2..1d04d72 100644 (file)
@@ -115,11 +115,11 @@ messages -> WebPageProxy {
     DidCreateSubframe(uint64_t frameID)
 
     # Frame load messages
-    DidStartProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::URL url, WebCore::URL unreachableURL, WebKit::UserData userData)
-    DidReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::URL url, WebKit::UserData userData)
+    DidStartProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, String url, String unreachableURL, WebKit::UserData userData)
+    DidReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, String url, WebKit::UserData userData)
     WillPerformClientRedirectForFrame(uint64_t frameID, String url, double delay)
     DidCancelClientRedirectForFrame(uint64_t frameID)
-    DidChangeProvisionalURLForFrame(uint64_t frameID, uint64_t navigationID, WebCore::URL url)
+    DidChangeProvisionalURLForFrame(uint64_t frameID, uint64_t navigationID, String url)
     DidFailProvisionalLoadForFrame(uint64_t frameID, struct WebCore::SecurityOriginData frameSecurityOrigin, uint64_t navigationID, String provisionalURL, WebCore::ResourceError error, WebKit::UserData userData)
     DidCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, String mimeType, bool hasCustomContentProvider, uint32_t loadType, WebCore::CertificateInfo certificateInfo, bool containsPluginDocument, std::optional<WebCore::HasInsecureContent> forcedHasInsecureContent, WebKit::UserData userData)
     DidFailLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::ResourceError error, WebKit::UserData userData)
@@ -132,7 +132,7 @@ messages -> WebPageProxy {
     DidDisplayInsecureContentForFrame(uint64_t frameID, WebKit::UserData userData)
     DidRunInsecureContentForFrame(uint64_t frameID, WebKit::UserData userData)
     DidDetectXSSForFrame(uint64_t frameID, WebKit::UserData userData)
-    DidSameDocumentNavigationForFrame(uint64_t frameID, uint64_t navigationID, uint32_t type, WebCore::URL url, WebKit::UserData userData)
+    DidSameDocumentNavigationForFrame(uint64_t frameID, uint64_t navigationID, uint32_t type, String url, WebKit::UserData userData)
     DidChangeMainDocument(uint64_t frameID);
     DidDestroyNavigation(uint64_t navigationID)
 
index ea7c329..090d678 100644 (file)
@@ -279,13 +279,14 @@ void WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad()
         return;
 
     WebDocumentLoader& documentLoader = static_cast<WebDocumentLoader&>(*m_frame->coreFrame()->loader().provisionalDocumentLoader());
+    const String& url = documentLoader.url().string();
     RefPtr<API::Object> userData;
 
     // Notify the bundle client.
     webPage->injectedBundleLoaderClient().didReceiveServerRedirectForProvisionalLoadForFrame(*webPage, *m_frame, userData);
 
     // Notify the UIProcess.
-    webPage->send(Messages::WebPageProxy::DidReceiveServerRedirectForProvisionalLoadForFrame(m_frame->frameID(), documentLoader.navigationID(), documentLoader.url(), UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
+    webPage->send(Messages::WebPageProxy::DidReceiveServerRedirectForProvisionalLoadForFrame(m_frame->frameID(), documentLoader.navigationID(), url, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
 }
 
 void WebFrameLoaderClient::dispatchDidChangeProvisionalURL()
@@ -295,7 +296,7 @@ void WebFrameLoaderClient::dispatchDidChangeProvisionalURL()
         return;
 
     WebDocumentLoader& documentLoader = static_cast<WebDocumentLoader&>(*m_frame->coreFrame()->loader().provisionalDocumentLoader());
-    webPage->send(Messages::WebPageProxy::DidChangeProvisionalURLForFrame(m_frame->frameID(), documentLoader.navigationID(), documentLoader.url()));
+    webPage->send(Messages::WebPageProxy::DidChangeProvisionalURLForFrame(m_frame->frameID(), documentLoader.navigationID(), documentLoader.url().string()));
 }
 
 void WebFrameLoaderClient::dispatchDidCancelClientRedirect()
@@ -338,7 +339,7 @@ void WebFrameLoaderClient::dispatchDidChangeLocationWithinPage()
     webPage->injectedBundleLoaderClient().didSameDocumentNavigationForFrame(*webPage, *m_frame, SameDocumentNavigationAnchorNavigation, userData);
 
     // Notify the UIProcess.
-    webPage->send(Messages::WebPageProxy::DidSameDocumentNavigationForFrame(m_frame->frameID(), navigationID, SameDocumentNavigationAnchorNavigation, m_frame->coreFrame()->document()->url(), UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
+    webPage->send(Messages::WebPageProxy::DidSameDocumentNavigationForFrame(m_frame->frameID(), navigationID, SameDocumentNavigationAnchorNavigation, m_frame->coreFrame()->document()->url().string(), UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
 }
 
 void WebFrameLoaderClient::dispatchDidChangeMainDocument()
@@ -364,7 +365,7 @@ void WebFrameLoaderClient::dispatchDidPushStateWithinPage()
     webPage->injectedBundleLoaderClient().didSameDocumentNavigationForFrame(*webPage, *m_frame, SameDocumentNavigationSessionStatePush, userData);
 
     // Notify the UIProcess.
-    webPage->send(Messages::WebPageProxy::DidSameDocumentNavigationForFrame(m_frame->frameID(), navigationID, SameDocumentNavigationSessionStatePush, m_frame->coreFrame()->document()->url(), UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
+    webPage->send(Messages::WebPageProxy::DidSameDocumentNavigationForFrame(m_frame->frameID(), navigationID, SameDocumentNavigationSessionStatePush, m_frame->coreFrame()->document()->url().string(), UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
 }
 
 void WebFrameLoaderClient::dispatchDidReplaceStateWithinPage()
@@ -381,7 +382,7 @@ void WebFrameLoaderClient::dispatchDidReplaceStateWithinPage()
     webPage->injectedBundleLoaderClient().didSameDocumentNavigationForFrame(*webPage, *m_frame, SameDocumentNavigationSessionStateReplace, userData);
 
     // Notify the UIProcess.
-    webPage->send(Messages::WebPageProxy::DidSameDocumentNavigationForFrame(m_frame->frameID(), navigationID, SameDocumentNavigationSessionStateReplace, m_frame->coreFrame()->document()->url(), UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
+    webPage->send(Messages::WebPageProxy::DidSameDocumentNavigationForFrame(m_frame->frameID(), navigationID, SameDocumentNavigationSessionStateReplace, m_frame->coreFrame()->document()->url().string(), UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
 }
 
 void WebFrameLoaderClient::dispatchDidPopStateWithinPage()
@@ -398,7 +399,7 @@ void WebFrameLoaderClient::dispatchDidPopStateWithinPage()
     webPage->injectedBundleLoaderClient().didSameDocumentNavigationForFrame(*webPage, *m_frame, SameDocumentNavigationSessionStatePop, userData);
 
     // Notify the UIProcess.
-    webPage->send(Messages::WebPageProxy::DidSameDocumentNavigationForFrame(m_frame->frameID(), navigationID, SameDocumentNavigationSessionStatePop, m_frame->coreFrame()->document()->url(), UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
+    webPage->send(Messages::WebPageProxy::DidSameDocumentNavigationForFrame(m_frame->frameID(), navigationID, SameDocumentNavigationSessionStatePop, m_frame->coreFrame()->document()->url().string(), UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
 }
 
 void WebFrameLoaderClient::dispatchWillClose()
@@ -422,13 +423,13 @@ void WebFrameLoaderClient::dispatchDidStartProvisionalLoad()
     webPage->sandboxExtensionTracker().didStartProvisionalLoad(m_frame);
 
     WebDocumentLoader& provisionalLoader = static_cast<WebDocumentLoader&>(*m_frame->coreFrame()->loader().provisionalDocumentLoader());
-    auto& url = provisionalLoader.url();
+    const String& url = provisionalLoader.url().string();
     RefPtr<API::Object> userData;
 
     // Notify the bundle client.
     webPage->injectedBundleLoaderClient().didStartProvisionalLoadForFrame(*webPage, *m_frame, userData);
 
-    auto& unreachableURL = provisionalLoader.unreachableURL();
+    String unreachableURL = provisionalLoader.unreachableURL().string();
 
     // Notify the UIProcess.
     webPage->send(Messages::WebPageProxy::DidStartProvisionalLoadForFrame(m_frame->frameID(), provisionalLoader.navigationID(), url, unreachableURL, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
index 27ee723..bc24ba2 100644 (file)
@@ -1176,13 +1176,13 @@ void WebPage::sendClose()
     send(Messages::WebPageProxy::ClosePage(false));
 }
 
-void WebPage::loadURLInFrame(WebCore::URL&& url, uint64_t frameID)
+void WebPage::loadURLInFrame(const String& url, uint64_t frameID)
 {
     WebFrame* frame = WebProcess::singleton().webFrame(frameID);
     if (!frame)
         return;
 
-    frame->coreFrame()->loader().load(FrameLoadRequest(*frame->coreFrame(), ResourceRequest(url), ShouldOpenExternalURLsPolicy::ShouldNotAllow));
+    frame->coreFrame()->loader().load(FrameLoadRequest(*frame->coreFrame(), ResourceRequest(URL(URL(), url)), ShouldOpenExternalURLsPolicy::ShouldNotAllow));
 }
 
 #if !PLATFORM(COCOA)
index 43154a6..318fe4d 100644 (file)
@@ -1095,7 +1095,7 @@ private:
     static bool scroll(WebCore::Page*, WebCore::ScrollDirection, WebCore::ScrollGranularity);
     static bool logicalScroll(WebCore::Page*, WebCore::ScrollLogicalDirection, WebCore::ScrollGranularity);
 
-    void loadURLInFrame(WebCore::URL&&, uint64_t frameID);
+    void loadURLInFrame(const String&, uint64_t frameID);
 
     enum class WasRestoredByAPIRequest { No, Yes };
     void restoreSessionInternal(const Vector<BackForwardListItemState>&, WasRestoredByAPIRequest);
index b017647..feaa768 100644 (file)
@@ -132,7 +132,7 @@ messages -> WebPage LegacyReceiver {
     GoToBackForwardItem(uint64_t navigationID, uint64_t backForwardItemID)
     TryRestoreScrollPosition()
 
-    LoadURLInFrame(WebCore::URL url, uint64_t frameID)
+    LoadURLInFrame(String url, uint64_t frameID)
     LoadRequest(struct WebKit::LoadParameters loadParameters)
     LoadData(struct WebKit::LoadParameters loadParameters)
     LoadString(struct WebKit::LoadParameters loadParameters)
index 5f74b60..983ac52 100644 (file)
@@ -1,3 +1,16 @@
+2017-09-14  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r222033.
+
+        This change caused API test WebKit.PrintFrame to time out.
+
+        Reverted changeset:
+
+        "Add WKUIDelegatePrivate equivalent of WKPageUIClient's
+        drawHeader, drawFooter, headerHeight, and footerHeight"
+        https://bugs.webkit.org/show_bug.cgi?id=176889
+        http://trac.webkit.org/changeset/222033
+
 2017-09-14  Youenn Fablet  <youenn@apple.com>
 
         Allow WTF::map to take function as parameter
index d689c55..160b81b 100644 (file)
@@ -41,7 +41,6 @@
 #import <WebKit/WKWebViewPrivate.h>
 #import <WebKit/_WKHitTestResult.h>
 #import <wtf/RetainPtr.h>
-#import <wtf/Vector.h>
 
 #if PLATFORM(MAC)
 #import <Carbon/Carbon.h>
@@ -283,93 +282,6 @@ TEST(WebKit, WindowFrame)
     TestWebKitAPI::Util::run(&done);
 }
 
-enum class Callback {
-    HeaderHeight,
-    FooterHeight,
-    DrawHeader,
-    DrawFooter,
-};
-
-static Vector<Callback> callbacks;
-
-@interface PrintDelegate : NSObject <WKUIDelegatePrivate>
-@end
-
-@implementation PrintDelegate
-
-- (void)_webView:(WKWebView *)webView printFrame:(_WKFrameHandle *)frame
-{
-    done = true;
-}
-
-- (CGFloat)_webViewHeaderHeight:(WKWebView *)webView
-{
-    callbacks.append(Callback::HeaderHeight);
-    return 3.14159;
-}
-
-- (CGFloat)_webViewFooterHeight:(WKWebView *)webView
-{
-    callbacks.append(Callback::FooterHeight);
-    return 2.71828;
-}
-
-- (void)_webView:(WKWebView *)webView drawHeaderInRect:(CGRect)rect forPageWithTitle:(NSString *)title URL:(NSURL *)url
-{
-    EXPECT_EQ(rect.origin.x, 72);
-    EXPECT_TRUE(fabs(rect.origin.y - 698.858398) < .00001);
-    EXPECT_TRUE(fabs(rect.size.height - 3.141590) < .00001);
-    EXPECT_EQ(rect.size.width, 468.000000);
-    EXPECT_STREQ(title.UTF8String, "test_title");
-    EXPECT_STREQ(url.absoluteString.UTF8String, "http://example.com/");
-    callbacks.append(Callback::DrawHeader);
-}
-
-- (void)_webView:(WKWebView *)webView drawFooterInRect:(CGRect)rect forPageWithTitle:(NSString *)title URL:(NSURL *)url
-{
-    EXPECT_EQ(rect.origin.x, 72);
-    EXPECT_EQ(rect.origin.y, 90);
-    EXPECT_TRUE(fabs(rect.size.height - 2.718280) < .00001);
-    EXPECT_EQ(rect.size.width, 468.000000);
-    EXPECT_STREQ(url.absoluteString.UTF8String, "http://example.com/");
-    callbacks.append(Callback::DrawFooter);
-    const size_t expectedFinalCallbackSize = 39;
-    if (callbacks.size() == expectedFinalCallbackSize)
-        done = true;
-}
-
-@end
-
-bool callbacksEqual(const Vector<Callback> a, const Vector<Callback> b)
-{
-    if (a.size() != b.size())
-        return false;
-    for (size_t i = 0; i < a.size(); ++i) {
-        if (a[i] != b[i])
-            return false;
-    }
-    return true;
-}
-
-TEST(WebKit, PrintFrame)
-{
-    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]);
-    auto delegate = adoptNS([[PrintDelegate alloc] init]);
-    [webView setUIDelegate:delegate.get()];
-    [webView loadHTMLString:@"<head><title>test_title</title></head><body onload='print()'>hello world!</body>" baseURL:[NSURL URLWithString:@"http://example.com/"]];
-    TestWebKitAPI::Util::run(&done);
-
-    done = false;
-    NSPrintOperation *operation = [webView _printOperationWithPrintInfo:[NSPrintInfo sharedPrintInfo]];
-    EXPECT_TRUE(operation.canSpawnSeparateThread);
-    EXPECT_STREQ(operation.jobTitle.UTF8String, "test_title");
-
-    [operation runOperationModalForWindow:[webView hostWindow] delegate:nil didRunSelector:nil contextInfo:nil];
-    TestWebKitAPI::Util::run(&done);
-
-    EXPECT_TRUE(callbacksEqual(callbacks, { Callback::HeaderHeight, Callback::FooterHeight, Callback::HeaderHeight, Callback::FooterHeight, Callback::HeaderHeight, Callback::FooterHeight, Callback::HeaderHeight, Callback::FooterHeight, Callback::HeaderHeight, Callback::FooterHeight, Callback::HeaderHeight, Callback::FooterHeight, Callback::HeaderHeight, Callback::FooterHeight, Callback::HeaderHeight, Callback::FooterHeight, Callback::HeaderHeight, Callback::FooterHeight, Callback::HeaderHeight, Callback::FooterHeight, Callback::FooterHeight, Callback::FooterHeight, Callback::HeaderHeight, Callback::DrawHeader, Callback::DrawFooter, Callback::HeaderHeight, Callback::FooterHeight, Callback::FooterHeight, Callback::FooterHeight, Callback::HeaderHeight, Callback::DrawHeader, Callback::DrawFooter, Callback::HeaderHeight, Callback::FooterHeight, Callback::FooterHeight, Callback::FooterHeight, Callback::HeaderHeight, Callback::DrawHeader, Callback::DrawFooter }));
-}
-
 @interface NotificationDelegate : NSObject <WKUIDelegatePrivate> {
     bool _allowNotifications;
 }
index d6f6578..63bc532 100644 (file)
@@ -66,7 +66,6 @@
 - (void)mouseMoveToPoint:(NSPoint)point withFlags:(NSEventModifierFlags)flags;
 - (void)sendClicksAtPoint:(NSPoint)point numberOfClicks:(NSUInteger)numberOfClicks;
 - (void)typeCharacter:(char)character;
-- (NSWindow *)hostWindow;
 @end
 #endif
 
index dc1a45d..a5fefc4 100644 (file)
@@ -349,11 +349,6 @@ NSEventMask __simulated_forceClickAssociatedEventsMask(id self, SEL _cmd)
     }
 }
 
-- (NSWindow *)hostWindow
-{
-    return _hostWindow.get();
-}
-
 - (void)typeCharacter:(char)character {
     NSString *characterAsString = [NSString stringWithFormat:@"%c" , character];
     NSEventType keyDownEventType = NSEventTypeKeyDown;