From: benwells@chromium.org Date: Thu, 19 Jan 2012 20:47:22 +0000 (+0000) Subject: Add support for window.print to chromium DRT X-Git-Tag: 070512121124~14975 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2a69049df0a250ce63858c1b44000af931210e70;p=profile%2Fivi%2Fwebkit-efl.git Add support for window.print to chromium DRT https://bugs.webkit.org/show_bug.cgi?id=76479 When used in a test window.print goes into print mode and then straight out again. This will allow the afterprint event to be tested by having the afterprint event happen before the dump happens. Reviewed by Mihai Parparita. * DumpRenderTree/chromium/WebViewHost.cpp: (WebViewHost::printPage): * DumpRenderTree/chromium/WebViewHost.h: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105437 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/Tools/ChangeLog b/Tools/ChangeLog index 07b6b37..f44e585 100644 --- a/Tools/ChangeLog +++ b/Tools/ChangeLog @@ -1,3 +1,19 @@ +2012-01-19 Ben Wells + + Add support for window.print to chromium DRT + https://bugs.webkit.org/show_bug.cgi?id=76479 + + When used in a test window.print goes into print mode and then + straight out again. This will allow the afterprint event to be + tested by having the afterprint event happen before the dump + happens. + + Reviewed by Mihai Parparita. + + * DumpRenderTree/chromium/WebViewHost.cpp: + (WebViewHost::printPage): + * DumpRenderTree/chromium/WebViewHost.h: + 2012-01-18 Enrica Casucci editingAttributedStringFromRange in WebHTMLConverter does not handle NSUnderlineStyleAttributeName. diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.cpp b/Tools/DumpRenderTree/chromium/WebViewHost.cpp index 70beb9f..9acb0a2 100644 --- a/Tools/DumpRenderTree/chromium/WebViewHost.cpp +++ b/Tools/DumpRenderTree/chromium/WebViewHost.cpp @@ -1715,3 +1715,12 @@ void WebViewHost::displayRepaintMask() { canvas()->drawARGB(167, 0, 0, 0); } + +// Simulate a print by going into print mode and then exit straight away. +void WebViewHost::printPage(WebKit::WebFrame* frame) +{ + WebSize pageSizeInPixels = webWidget()->size(); + + frame->printBegin(pageSizeInPixels); + frame->printEnd(); +} diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.h b/Tools/DumpRenderTree/chromium/WebViewHost.h index 20da17c..d17cef5 100644 --- a/Tools/DumpRenderTree/chromium/WebViewHost.h +++ b/Tools/DumpRenderTree/chromium/WebViewHost.h @@ -157,6 +157,7 @@ class WebViewHost : public WebKit::WebSpellCheckClient, public WebKit::WebViewCl virtual WebKit::WebSpeechInputController* speechInputController(WebKit::WebSpeechInputListener*); virtual WebKit::WebDeviceOrientationClient* deviceOrientationClient(); virtual WebKit::WebUserMediaClient* userMediaClient(); + virtual void printPage(WebKit::WebFrame*); // WebKit::WebWidgetClient virtual void didInvalidateRect(const WebKit::WebRect&);