Diff
Modified: trunk/Source/WebKit/chromium/ChangeLog (117679 => 117680)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-05-19 06:36:58 UTC (rev 117679)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-05-19 07:13:03 UTC (rev 117680)
@@ -1,3 +1,26 @@
+2012-05-19 Sheriff Bot <[email protected]>
+
+ Unreviewed, rolling out r117675.
+ http://trac.webkit.org/changeset/117675
+ https://bugs.webkit.org/show_bug.cgi?id=86938
+
+ Broke builds. You can't initialize members by members
+ themselves (Requested by rniwa on #webkit).
+
+ * public/WebFrame.h:
+ (WebFrame):
+ * public/WebPlugin.h:
+ (WebPlugin):
+ (WebKit::WebPlugin::printBegin):
+ * public/WebPrintParams.h:
+ * src/WebFrameImpl.cpp:
+ (WebKit):
+ (WebKit::WebFrameImpl::printBegin):
+ * src/WebFrameImpl.h:
+ (WebFrameImpl):
+ * src/WebPluginContainerImpl.cpp:
+ (WebKit::WebPluginContainerImpl::printBegin):
+
2012-05-18 Jochen Eisinger <[email protected]>
[chromium] remove obsolete WebViewClient::startDragging version
Modified: trunk/Source/WebKit/chromium/public/WebFrame.h (117679 => 117680)
--- trunk/Source/WebKit/chromium/public/WebFrame.h 2012-05-19 06:36:58 UTC (rev 117679)
+++ trunk/Source/WebKit/chromium/public/WebFrame.h 2012-05-19 07:13:03 UTC (rev 117680)
@@ -455,6 +455,23 @@
// Printing ------------------------------------------------------------
+ // Reformats the WebFrame for printing. printContentSize is the print
+ // content size in points (a point is 1/72 of an inch). If constrainToNode
+ // node is specified, then only the given node is printed (for now only
+ // plugins are supported), instead of the entire frame. printerDPI is the
+ // user selected, DPI for the printer. Returns the number of pages that can
+ // be printed at the given page size. The out param useBrowserOverlays
+ // specifies whether the browser process should use its overlays (header,
+ // footer, margins etc) or whether the renderer controls this.
+ //
+ // FIXME: This is a temporary interface to avoid the compile errors. Remove
+ // this interface after fixing crbug.com/85132. We will use the overloaded
+ // printBegin function.
+ virtual int printBegin(const WebSize& printContentSize,
+ const WebNode& constrainToNode = WebNode(),
+ int printerDPI = 72,
+ bool* useBrowserOverlays = 0) = 0;
+
// Reformats the WebFrame for printing. WebPrintParams specifies the printable
// content size, paper size, printable area size, printer DPI and print
// scaling option. If constrainToNode node is specified, then only the given node
Modified: trunk/Source/WebKit/chromium/public/WebPlugin.h (117679 => 117680)
--- trunk/Source/WebKit/chromium/public/WebPlugin.h 2012-05-19 06:36:58 UTC (rev 117679)
+++ trunk/Source/WebKit/chromium/public/WebPlugin.h 2012-05-19 07:13:03 UTC (rev 117680)
@@ -98,6 +98,12 @@
// the printer's printable area.
virtual bool isPrintScalingDisabled() { return false; }
+ // Sets up printing at the given print rect and printer DPI.
+ // printContentArea is in points ( a point is 1/72 of an inch). Returns the
+ // number of pages to be printed at these settings.
+ // FIXME: Remove this function after fixing crbug.com/85132. For detailed
+ // information, please refer to the comments in WebFrame.h
+ virtual int printBegin(const WebRect& printContentArea, int printerDPI) { return 0; }
// Sets up printing with the specified printParams. Returns the number of
// pages to be printed at these settings.
virtual int printBegin(const WebPrintParams& printParams) { return 0; }
Modified: trunk/Source/WebKit/chromium/public/WebPrintParams.h (117679 => 117680)
--- trunk/Source/WebKit/chromium/public/WebPrintParams.h 2012-05-19 06:36:58 UTC (rev 117679)
+++ trunk/Source/WebKit/chromium/public/WebPrintParams.h 2012-05-19 07:13:03 UTC (rev 117680)
@@ -59,13 +59,6 @@
: printerDPI(72)
, printScalingOption(WebPrintScalingOptionFitToPrintableArea) { }
- WebPrintParams(const WebSize& paperSize)
- : printContentArea(WebRect(0, 0, paperSize.width, paperSize.height))
- , printableArea(WebRect(0, 0, paperSize.width, paperSize.height))
- , paperSize(paperSize)
- , printerDPI(72)
- , printScalingOption(printScalingOption) { }
-
WebPrintParams(const WebRect& printContentArea, const WebRect& printableArea, const WebSize& paperSize, int printerDPI, WebPrintScalingOption printScalingOption)
: printContentArea(printContentArea)
, printableArea(printableArea)
Modified: trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp (117679 => 117680)
--- trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp 2012-05-19 06:36:58 UTC (rev 117679)
+++ trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp 2012-05-19 07:13:03 UTC (rev 117680)
@@ -1449,6 +1449,21 @@
return node->renderer()->positionForPoint(result.localPoint());
}
+// TODO([email protected]): Remove this function after fixing
+// crbug.com/85132. For more information, please refer to the comments in
+// WebFrame.h
+int WebFrameImpl::printBegin(const WebSize& printContentSize,
+ const WebNode& constrainToNode,
+ int printerDPI,
+ bool* useBrowserOverlays) {
+ WebRect printableArea(0, 0, printContentSize.width, printContentSize.height);
+ WebSize paperSize(printContentSize);
+ WebRect printContentArea(0, 0, printContentSize.width, printContentSize.height);
+ WebPrintParams printParams(printContentArea, printableArea, paperSize,
+ printerDPI, WebPrintScalingOptionSourceSize);
+ return printBegin(printParams, constrainToNode, useBrowserOverlays);
+}
+
int WebFrameImpl::printBegin(const WebPrintParams& printParams,
const WebNode& constrainToNode,
bool* useBrowserOverlays)
Modified: trunk/Source/WebKit/chromium/src/WebFrameImpl.h (117679 => 117680)
--- trunk/Source/WebKit/chromium/src/WebFrameImpl.h 2012-05-19 06:36:58 UTC (rev 117679)
+++ trunk/Source/WebKit/chromium/src/WebFrameImpl.h 2012-05-19 07:13:03 UTC (rev 117680)
@@ -178,6 +178,12 @@
virtual bool selectWordAroundCaret();
virtual void selectRange(const WebPoint& start, const WebPoint& end);
virtual void selectRange(const WebRange&);
+ // FIXME: Remove this function after fixing crbug.com/85132. For detailed
+ // information, please refer to the comments in WebFrame.h
+ virtual int printBegin(const WebSize& printContentSize,
+ const WebNode& constrainToNode,
+ int printerDPI,
+ bool* useBrowserOverlays);
virtual int printBegin(const WebPrintParams&,
const WebNode& constrainToNode,
bool* useBrowserOverlays);
Modified: trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp (117679 => 117680)
--- trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp 2012-05-19 06:36:58 UTC (rev 117679)
+++ trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp 2012-05-19 07:13:03 UTC (rev 117680)
@@ -254,7 +254,10 @@
int WebPluginContainerImpl::printBegin(const WebPrintParams& printParams) const
{
- return m_webPlugin->printBegin(printParams);
+ return m_webPlugin->printBegin(printParams.printContentArea, printParams.printerDPI);
+ // FIXME: After committing this CL, update the chrome plugin printBegin()
+ // function to use the overloaded printBegin function.
+ // return m_webPlugin->printBegin(printParams);
}
bool WebPluginContainerImpl::printPage(int pageNumber,
Modified: trunk/Tools/ChangeLog (117679 => 117680)
--- trunk/Tools/ChangeLog 2012-05-19 06:36:58 UTC (rev 117679)
+++ trunk/Tools/ChangeLog 2012-05-19 07:13:03 UTC (rev 117680)
@@ -1,3 +1,17 @@
+2012-05-19 Sheriff Bot <[email protected]>
+
+ Unreviewed, rolling out r117675.
+ http://trac.webkit.org/changeset/117675
+ https://bugs.webkit.org/show_bug.cgi?id=86938
+
+ Broke builds. You can't initialize members by members
+ themselves (Requested by rniwa on #webkit).
+
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::numberOfPages):
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::printPage):
+
2012-05-18 Kausalya Madhusudhanan <[email protected]>
[chromium] User overloaded printBegin() webkit API to support auto fit to page functionality.
Modified: trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp (117679 => 117680)
--- trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp 2012-05-19 06:36:58 UTC (rev 117679)
+++ trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp 2012-05-19 07:13:03 UTC (rev 117680)
@@ -54,7 +54,6 @@
#include "WebKit.h"
#include "WebNotificationPresenter.h"
#include "WebPermissions.h"
-#include "WebPrintParams.h"
#include "WebScriptSource.h"
#include "WebSecurityPolicy.h"
#include "platform/WebSerializedScriptValue.h"
@@ -1809,8 +1808,8 @@
WebFrame* frame = m_shell->webView()->mainFrame();
if (!frame)
return;
- WebPrintParams printParams(WebSize(pageWidthInPixels, pageHeightInPixels));
- int numberOfPages = frame->printBegin(printParams);
+ WebSize size(pageWidthInPixels, pageHeightInPixels);
+ int numberOfPages = frame->printBegin(size);
frame->printEnd();
result->set(numberOfPages);
}
Modified: trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp (117679 => 117680)
--- trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp 2012-05-19 06:36:58 UTC (rev 117679)
+++ trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp 2012-05-19 07:13:03 UTC (rev 117680)
@@ -55,7 +55,6 @@
#include "WebPluginParams.h"
#include "WebPopupMenu.h"
#include "WebPopupType.h"
-#include "WebPrintParams.h"
#include "WebRange.h"
#include "platform/WebRect.h"
#include "WebScreenInfo.h"
@@ -1842,7 +1841,7 @@
void WebViewHost::printPage(WebKit::WebFrame* frame)
{
WebSize pageSizeInPixels = webWidget()->size();
- WebPrintParams printParams(pageSizeInPixels);
- frame->printBegin(printParams);
+
+ frame->printBegin(pageSizeInPixels);
frame->printEnd();
}