Diff
Modified: trunk/Source/WebKit/ChangeLog (222046 => 222047)
--- trunk/Source/WebKit/ChangeLog 2017-09-14 19:55:02 UTC (rev 222046)
+++ trunk/Source/WebKit/ChangeLog 2017-09-14 20:12:03 UTC (rev 222047)
@@ -1,3 +1,16 @@
+2017-09-14 Ryan Haddad <[email protected]>
+
+ 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 <[email protected]>
Add WKUIDelegatePrivate equivalent of WKPageUIClient's drawHeader, drawFooter, headerHeight, and footerHeight
Modified: trunk/Source/WebKit/UIProcess/API/C/WKPage.cpp (222046 => 222047)
--- trunk/Source/WebKit/UIProcess/API/C/WKPage.cpp 2017-09-14 19:55:02 UTC (rev 222046)
+++ trunk/Source/WebKit/UIProcess/API/C/WKPage.cpp 2017-09-14 20:12:03 UTC (rev 222047)
@@ -209,12 +209,12 @@
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)
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextController.mm (222046 => 222047)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextController.mm 2017-09-14 19:55:02 UTC (rev 222046)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextController.mm 2017-09-14 20:12:03 UTC (rev 222047)
@@ -157,7 +157,7 @@
- (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
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h (222046 => 222047)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h 2017-09-14 19:55:02 UTC (rev 222046)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h 2017-09-14 20:12:03 UTC (rev 222047)
@@ -161,10 +161,6 @@
- (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));
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (222046 => 222047)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm 2017-09-14 19:55:02 UTC (rev 222046)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm 2017-09-14 20:12:03 UTC (rev 222047)
@@ -3839,7 +3839,7 @@
- (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
Modified: trunk/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp (222046 => 222047)
--- trunk/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp 2017-09-14 19:55:02 UTC (rev 222046)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp 2017-09-14 20:12:03 UTC (rev 222047)
@@ -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 @@
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 @@
{
g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
- getPage(webView).reload(ReloadOption::FromOrigin);
+ getPage(webView).reload(WebCore::ReloadOption::FromOrigin);
}
/**
@@ -3156,7 +3155,7 @@
return webView->priv->_javascript_GlobalContext.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 @@
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 @@
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());
});
}
Modified: trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.h (222046 => 222047)
--- trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.h 2017-09-14 19:55:02 UTC (rev 222046)
+++ trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.h 2017-09-14 20:12:03 UTC (rev 222047)
@@ -105,10 +105,6 @@
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,8 +160,6 @@
bool webViewRunModal : 1;
bool webViewTakeFocus : 1;
bool webViewDidScroll : 1;
- bool webViewHeaderHeight : 1;
- bool webViewFooterHeight : 1;
bool webViewSetResizable : 1;
bool webViewSetWindowFrame : 1;
bool webViewDidNotHandleWheelEvent : 1;
@@ -172,8 +166,6 @@
bool webViewHandleAutoplayEventWithFlags : 1;
bool webViewUnavailablePlugInButtonClicked : 1;
bool webViewDidClickAutoFillButtonWithUserInfo : 1;
- bool webViewDrawHeaderInRectForPageWithTitleURL : 1;
- bool webViewDrawFooterInRectForPageWithTitleURL : 1;
bool webViewGetWindowFrameWithCompletionHandler : 1;
bool webViewMouseDidMoveOverElementWithFlagsUserInfo : 1;
bool webViewGetToolbarsAreVisibleWithCompletionHandler : 1;
Modified: trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm (222046 => 222047)
--- trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm 2017-09-14 19:55:02 UTC (rev 222046)
+++ trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm 2017-09-14 20:12:03 UTC (rev 222047)
@@ -120,10 +120,6 @@
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 @@
[(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)
Modified: trunk/Source/WebKit/UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm (222046 => 222047)
--- trunk/Source/WebKit/UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm 2017-09-14 19:55:02 UTC (rev 222046)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm 2017-09-14 20:12:03 UTC (rev 222047)
@@ -69,7 +69,7 @@
if (!webFrameProxy)
return NO;
- webFrameProxy->loadURL(WebCore::URL(WebCore::URL(), _urlString));
+ webFrameProxy->loadURL(_urlString);
return YES;
}
Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm (222046 => 222047)
--- trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm 2017-09-14 19:55:02 UTC (rev 222046)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm 2017-09-14 20:12:03 UTC (rev 222047)
@@ -1624,7 +1624,7 @@
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.
Modified: trunk/Source/WebKit/UIProcess/FrameLoadState.cpp (222046 => 222047)
--- trunk/Source/WebKit/UIProcess/FrameLoadState.cpp 2017-09-14 19:55:02 UTC (rev 222046)
+++ trunk/Source/WebKit/UIProcess/FrameLoadState.cpp 2017-09-14 20:12:03 UTC (rev 222047)
@@ -28,11 +28,16 @@
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 @@
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 @@
ASSERT(m_state == State::Provisional);
m_state = State::Finished;
- m_provisionalURL = { };
+ m_provisionalURL = String();
m_unreachableURL = m_lastUnreachableURL;
}
@@ -62,7 +67,7 @@
m_state = State::Committed;
m_url = m_provisionalURL;
- m_provisionalURL = { };
+ m_provisionalURL = String();
}
void FrameLoadState::didFinishLoad()
@@ -81,12 +86,12 @@
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;
Modified: trunk/Source/WebKit/UIProcess/FrameLoadState.h (222046 => 222047)
--- trunk/Source/WebKit/UIProcess/FrameLoadState.h 2017-09-14 19:55:02 UTC (rev 222046)
+++ trunk/Source/WebKit/UIProcess/FrameLoadState.h 2017-09-14 20:12:03 UTC (rev 222047)
@@ -23,14 +23,16 @@
* 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,8 +41,8 @@
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();
@@ -47,21 +49,23 @@
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
Modified: trunk/Source/WebKit/UIProcess/WebFrameProxy.cpp (222046 => 222047)
--- trunk/Source/WebKit/UIProcess/WebFrameProxy.cpp 2017-09-14 19:55:02 UTC (rev 222046)
+++ trunk/Source/WebKit/UIProcess/WebFrameProxy.cpp 2017-09-14 20:12:03 UTC (rev 222047)
@@ -76,7 +76,7 @@
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 @@
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 @@
m_frameLoadState.didFailLoad();
}
-void WebFrameProxy::didSameDocumentNavigation(const URL& url)
+void WebFrameProxy::didSameDocumentNavigation(const String& url)
{
m_frameLoadState.didSameDocumentNotification(url);
}
@@ -176,7 +176,7 @@
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 @@
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 = { };
Modified: trunk/Source/WebKit/UIProcess/WebFrameProxy.h (222046 => 222047)
--- trunk/Source/WebKit/UIProcess/WebFrameProxy.h 2017-09-14 19:55:02 UTC (rev 222046)
+++ trunk/Source/WebKit/UIProcess/WebFrameProxy.h 2017-09-14 20:12:03 UTC (rev 222047)
@@ -77,14 +77,14 @@
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 @@
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.
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (222046 => 222047)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2017-09-14 19:55:02 UTC (rev 222046)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2017-09-14 20:12:03 UTC (rev 222047)
@@ -961,7 +961,7 @@
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 @@
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 @@
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::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 @@
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);
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (222046 => 222047)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.h 2017-09-14 19:55:02 UTC (rev 222046)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h 2017-09-14 20:12:03 UTC (rev 222047)
@@ -395,7 +395,7 @@
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 @@
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&);
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in (222046 => 222047)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in 2017-09-14 19:55:02 UTC (rev 222046)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in 2017-09-14 20:12:03 UTC (rev 222047)
@@ -115,11 +115,11 @@
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 @@
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)
Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (222046 => 222047)
--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2017-09-14 19:55:02 UTC (rev 222046)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2017-09-14 20:12:03 UTC (rev 222047)
@@ -279,6 +279,7 @@
return;
WebDocumentLoader& documentLoader = static_cast<WebDocumentLoader&>(*m_frame->coreFrame()->loader().provisionalDocumentLoader());
+ const String& url = ""
RefPtr<API::Object> userData;
// Notify the bundle client.
@@ -285,7 +286,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
webPage->sandboxExtensionTracker().didStartProvisionalLoad(m_frame);
WebDocumentLoader& provisionalLoader = static_cast<WebDocumentLoader&>(*m_frame->coreFrame()->loader().provisionalDocumentLoader());
- auto& url = ""
+ const String& url = ""
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())));
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (222046 => 222047)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2017-09-14 19:55:02 UTC (rev 222046)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2017-09-14 20:12:03 UTC (rev 222047)
@@ -1176,13 +1176,13 @@
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)
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (222046 => 222047)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2017-09-14 19:55:02 UTC (rev 222046)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2017-09-14 20:12:03 UTC (rev 222047)
@@ -1095,7 +1095,7 @@
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);
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in (222046 => 222047)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in 2017-09-14 19:55:02 UTC (rev 222046)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in 2017-09-14 20:12:03 UTC (rev 222047)
@@ -132,7 +132,7 @@
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)
Modified: trunk/Tools/ChangeLog (222046 => 222047)
--- trunk/Tools/ChangeLog 2017-09-14 19:55:02 UTC (rev 222046)
+++ trunk/Tools/ChangeLog 2017-09-14 20:12:03 UTC (rev 222047)
@@ -1,3 +1,16 @@
+2017-09-14 Ryan Haddad <[email protected]>
+
+ 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 <[email protected]>
Allow WTF::map to take function as parameter
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm (222046 => 222047)
--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm 2017-09-14 19:55:02 UTC (rev 222046)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm 2017-09-14 20:12:03 UTC (rev 222047)
@@ -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 @@
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;
}
Modified: trunk/Tools/TestWebKitAPI/cocoa/TestWKWebView.h (222046 => 222047)
--- trunk/Tools/TestWebKitAPI/cocoa/TestWKWebView.h 2017-09-14 19:55:02 UTC (rev 222046)
+++ trunk/Tools/TestWebKitAPI/cocoa/TestWKWebView.h 2017-09-14 20:12:03 UTC (rev 222047)
@@ -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
Modified: trunk/Tools/TestWebKitAPI/cocoa/TestWKWebView.mm (222046 => 222047)
--- trunk/Tools/TestWebKitAPI/cocoa/TestWKWebView.mm 2017-09-14 19:55:02 UTC (rev 222046)
+++ trunk/Tools/TestWebKitAPI/cocoa/TestWKWebView.mm 2017-09-14 20:12:03 UTC (rev 222047)
@@ -349,11 +349,6 @@
}
}
-- (NSWindow *)hostWindow
-{
- return _hostWindow.get();
-}
-
- (void)typeCharacter:(char)character {
NSString *characterAsString = [NSString stringWithFormat:@"%c" , character];
NSEventType keyDownEventType = NSEventTypeKeyDown;