Title: [105437] trunk/Tools
Revision
105437
Author
[email protected]
Date
2012-01-19 12:47:22 -0800 (Thu, 19 Jan 2012)

Log Message

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:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (105436 => 105437)


--- trunk/Tools/ChangeLog	2012-01-19 20:35:35 UTC (rev 105436)
+++ trunk/Tools/ChangeLog	2012-01-19 20:47:22 UTC (rev 105437)
@@ -1,3 +1,19 @@
+2012-01-19  Ben Wells  <[email protected]>
+
+        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  <[email protected]>
 
         editingAttributedStringFromRange in WebHTMLConverter does not handle NSUnderlineStyleAttributeName.

Modified: trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp (105436 => 105437)


--- trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp	2012-01-19 20:35:35 UTC (rev 105436)
+++ trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp	2012-01-19 20:47:22 UTC (rev 105437)
@@ -1715,3 +1715,12 @@
 {
     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();
+}

Modified: trunk/Tools/DumpRenderTree/chromium/WebViewHost.h (105436 => 105437)


--- trunk/Tools/DumpRenderTree/chromium/WebViewHost.h	2012-01-19 20:35:35 UTC (rev 105436)
+++ trunk/Tools/DumpRenderTree/chromium/WebViewHost.h	2012-01-19 20:47:22 UTC (rev 105437)
@@ -157,6 +157,7 @@
     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&);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to