[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198
ap at apple.com
ap at apple.com
Sun Feb 20 23:30:33 UTC 2011
The following commit has been merged in the webkit-1.3 branch:
commit 0231522689536ba104fbb0b1114d6eccbe8b0ee2
Author: ap at apple.com <ap at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Jan 21 00:19:33 2011 +0000
Reviewed by Darin Adler.
https://bugs.webkit.org/show_bug.cgi?id=52849
Make window.print work with WebKit2
* UIProcess/API/qt/qwkpage.cpp:
(QWKPage::QWKPage):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::printFrame):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebUIClient.cpp:
(WebKit::WebUIClient::printFrame):
* UIProcess/WebUIClient.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::print):
Just pass through deelagte call to a WebKit2 client.
* UIProcess/API/C/WKPage.h: Also added "Callback" suffix to other printing related function
types.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76306 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog
index 9dff9d9..dafe1bc 100644
--- a/Source/WebKit2/ChangeLog
+++ b/Source/WebKit2/ChangeLog
@@ -1,3 +1,26 @@
+2011-01-20 Alexey Proskuryakov <ap at apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=52849
+ Make window.print work with WebKit2
+
+ * UIProcess/API/qt/qwkpage.cpp:
+ (QWKPage::QWKPage):
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::printFrame):
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/WebPageProxy.messages.in:
+ * UIProcess/WebUIClient.cpp:
+ (WebKit::WebUIClient::printFrame):
+ * UIProcess/WebUIClient.h:
+ * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+ (WebKit::WebChromeClient::print):
+ Just pass through deelagte call to a WebKit2 client.
+
+ * UIProcess/API/C/WKPage.h: Also added "Callback" suffix to other printing related function
+ types.
+
2011-01-20 Anders Carlsson <andersca at apple.com>
Reviewed by Darin Adler.
diff --git a/Source/WebKit2/UIProcess/API/C/WKPage.h b/Source/WebKit2/UIProcess/API/C/WKPage.h
index 6a007e7..fe37646 100644
--- a/Source/WebKit2/UIProcess/API/C/WKPage.h
+++ b/Source/WebKit2/UIProcess/API/C/WKPage.h
@@ -177,10 +177,11 @@ typedef void (*WKPageDidScrollCallback)(WKPageRef page, const void *clientInfo);
typedef unsigned long long (*WKPageExceededDatabaseQuotaCallback)(WKPageRef page, WKFrameRef frame, WKSecurityOriginRef origin, WKStringRef databaseName, WKStringRef displayName, unsigned long long currentQuota, unsigned long long currentUsage, unsigned long long expectedUsage, const void *clientInfo);
typedef void (*WKPageRunOpenPanelCallback)(WKPageRef page, WKFrameRef frame, WKOpenPanelParametersRef parameters, WKOpenPanelResultListenerRef listener, const void *clientInfo);
typedef void (*WKPageDecidePolicyForGeolocationPermissionRequestCallback)(WKPageRef page, WKFrameRef frame, WKSecurityOriginRef origin, WKGeolocationPermissionRequestRef permissionRequest, const void* clientInfo);
-typedef float (*WKPageHeaderHeight)(WKPageRef page, WKFrameRef frame, const void* clientInfo);
-typedef float (*WKPageFooterHeight)(WKPageRef page, WKFrameRef frame, const void* clientInfo);
-typedef void (*WKPageDrawHeader)(WKPageRef page, WKFrameRef frame, WKRect rect, const void* clientInfo);
-typedef void (*WKPageDrawFooter)(WKPageRef page, WKFrameRef frame, WKRect rect, const void* clientInfo);
+typedef float (*WKPageHeaderHeightCallback)(WKPageRef page, WKFrameRef frame, const void* clientInfo);
+typedef float (*WKPageFooterHeightCallback)(WKPageRef page, WKFrameRef frame, const void* clientInfo);
+typedef void (*WKPageDrawHeaderCallback)(WKPageRef page, WKFrameRef frame, WKRect rect, const void* clientInfo);
+typedef void (*WKPageDrawFooterCallback)(WKPageRef page, WKFrameRef frame, WKRect rect, const void* clientInfo);
+typedef void (*WKPagePrintFrameCallback)(WKPageRef page, WKFrameRef frame, const void* clientInfo);
struct WKPageUIClient {
int version;
@@ -211,10 +212,11 @@ struct WKPageUIClient {
WKPageExceededDatabaseQuotaCallback exceededDatabaseQuota;
WKPageRunOpenPanelCallback runOpenPanel;
WKPageDecidePolicyForGeolocationPermissionRequestCallback decidePolicyForGeolocationPermissionRequest;
- WKPageHeaderHeight headerHeight;
- WKPageFooterHeight footerHeight;
- WKPageDrawHeader drawHeader;
- WKPageDrawFooter drawFooter;
+ WKPageHeaderHeightCallback headerHeight;
+ WKPageFooterHeightCallback footerHeight;
+ WKPageDrawHeaderCallback drawHeader;
+ WKPageDrawFooterCallback drawFooter;
+ WKPagePrintFrameCallback printFrame;
};
typedef struct WKPageUIClient WKPageUIClient;
diff --git a/Source/WebKit2/UIProcess/API/qt/qwkpage.cpp b/Source/WebKit2/UIProcess/API/qt/qwkpage.cpp
index 807044b..0cb8eb3 100644
--- a/Source/WebKit2/UIProcess/API/qt/qwkpage.cpp
+++ b/Source/WebKit2/UIProcess/API/qt/qwkpage.cpp
@@ -457,7 +457,8 @@ QWKPage::QWKPage(QWKContext* context)
0, /* headerHeight */
0, /* footerHeight */
0, /* drawHeader */
- 0 /* drawFooter */
+ 0, /* drawFooter */
+ 0 /* printFrame */
};
WKPageSetPageUIClient(pageRef(), &uiClient);
}
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.cpp b/Source/WebKit2/UIProcess/WebPageProxy.cpp
index cca2d7c..f85d824 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebPageProxy.cpp
@@ -1672,6 +1672,14 @@ void WebPageProxy::runOpenPanel(uint64_t frameID, const WebOpenPanelParameters::
didCancelForOpenPanel();
}
+void WebPageProxy::printFrame(uint64_t frameID)
+{
+ WebFrameProxy* frame = process()->webFrame(frameID);
+ MESSAGE_CHECK(frame);
+
+ m_uiClient.printFrame(this, frame);
+}
+
#if PLATFORM(QT)
void WebPageProxy::didChangeContentsSize(const WebCore::IntSize& size)
{
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.h b/Source/WebKit2/UIProcess/WebPageProxy.h
index ad8424e..962a68d 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.h
+++ b/Source/WebKit2/UIProcess/WebPageProxy.h
@@ -438,6 +438,7 @@ private:
void didChangeViewportData(const WebCore::ViewportArguments&);
void pageDidScroll();
void runOpenPanel(uint64_t frameID, const WebOpenPanelParameters::Data&);
+ void printFrame(uint64_t frameID);
void exceededDatabaseQuota(uint64_t frameID, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentUsage, uint64_t expectedUsage, uint64_t& newQuota);
void requestGeolocationPermissionForFrame(uint64_t geolocationID, uint64_t frameID, String originIdentifier);
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.messages.in b/Source/WebKit2/UIProcess/WebPageProxy.messages.in
index 7b63eff..1f7243d 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.messages.in
+++ b/Source/WebKit2/UIProcess/WebPageProxy.messages.in
@@ -53,6 +53,7 @@ messages -> WebPageProxy {
RunBeforeUnloadConfirmPanel(WTF::String message, uint64_t frameID) -> (bool shouldClose)
PageDidScroll()
RunOpenPanel(uint64_t frameID, WebKit::WebOpenPanelParameters::Data parameters)
+ PrintFrame(uint64_t frameID) -> ()
#if ENABLE(TILED_BACKING_STORE)
PageDidRequestScroll(WebCore::IntSize delta)
diff --git a/Source/WebKit2/UIProcess/WebUIClient.cpp b/Source/WebKit2/UIProcess/WebUIClient.cpp
index 90c7e56..65f4ac3 100644
--- a/Source/WebKit2/UIProcess/WebUIClient.cpp
+++ b/Source/WebKit2/UIProcess/WebUIClient.cpp
@@ -305,4 +305,12 @@ void WebUIClient::drawFooter(WebPageProxy* page, WebFrameProxy* frame, const Web
m_client.drawFooter(toAPI(page), toAPI(frame), toAPI(rect), m_client.clientInfo);
}
+void WebUIClient::printFrame(WebPageProxy* page, WebFrameProxy* frame)
+{
+ if (!m_client.printFrame)
+ return;
+
+ m_client.printFrame(toAPI(page), toAPI(frame), m_client.clientInfo);
+}
+
} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/WebUIClient.h b/Source/WebKit2/UIProcess/WebUIClient.h
index 802848c..0acfb47 100644
--- a/Source/WebKit2/UIProcess/WebUIClient.h
+++ b/Source/WebKit2/UIProcess/WebUIClient.h
@@ -92,6 +92,7 @@ public:
float footerHeight(WebPageProxy*, WebFrameProxy*);
void drawHeader(WebPageProxy*, WebFrameProxy*, const WebCore::FloatRect&);
void drawFooter(WebPageProxy*, WebFrameProxy*, const WebCore::FloatRect&);
+ void printFrame(WebPageProxy*, WebFrameProxy*);
};
} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
index b3b32cd..b10846f 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
@@ -466,9 +466,10 @@ void WebChromeClient::setToolTip(const String& toolTip, TextDirection)
m_page->send(Messages::WebPageProxy::SetToolTip(m_cachedToolTip));
}
-void WebChromeClient::print(Frame*)
+void WebChromeClient::print(Frame* frame)
{
- notImplemented();
+ WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
+ m_page->sendSync(Messages::WebPageProxy::PrintFrame(webFrame->frameID()), Messages::WebPageProxy::PrintFrame::Reply());
}
#if ENABLE(DATABASE)
diff --git a/Tools/ChangeLog b/Tools/ChangeLog
index c764d22..685630c 100644
--- a/Tools/ChangeLog
+++ b/Tools/ChangeLog
@@ -1,3 +1,17 @@
+2011-01-20 Alexey Proskuryakov <ap at apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=52849
+ Make window.print work with WebKit2
+
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController awakeFromNib]):
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::createOtherPage):
+ (WTR::TestController::initialize):
+ Added zeroes to WKPageUIClient structures to avoid build failures.
+
2011-01-20 Dirk Pranke <dpranke at chromium.org>
Reviewed by Eric Seidel.
diff --git a/Tools/MiniBrowser/mac/BrowserWindowController.m b/Tools/MiniBrowser/mac/BrowserWindowController.m
index 7331957..1a733ce 100644
--- a/Tools/MiniBrowser/mac/BrowserWindowController.m
+++ b/Tools/MiniBrowser/mac/BrowserWindowController.m
@@ -643,6 +643,7 @@ static void runOpenPanel(WKPageRef page, WKFrameRef frame, WKOpenPanelParameters
0, // footerHeight
0, // drawHeader
0, // drawFooter
+ 0, // printFrame
};
WKPageSetPageUIClient(_webView.pageRef, &uiClient);
}
diff --git a/Tools/WebKitTestRunner/TestController.cpp b/Tools/WebKitTestRunner/TestController.cpp
index de99271..1a68426 100644
--- a/Tools/WebKitTestRunner/TestController.cpp
+++ b/Tools/WebKitTestRunner/TestController.cpp
@@ -150,6 +150,7 @@ static WKPageRef createOtherPage(WKPageRef oldPage, WKDictionaryRef, WKEventModi
0, // footerHeight
0, // drawHeader
0, // drawFooter
+ 0, // printFrame
};
WKPageSetPageUIClient(newPage, &otherPageUIClient);
@@ -259,6 +260,7 @@ void TestController::initialize(int argc, const char* argv[])
0, // footerHeight
0, // drawHeader
0, // drawFooter
+ 0, // printFrame
};
WKPageSetPageUIClient(m_mainWebView->page(), &pageUIClient);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list