Title: [150046] trunk
Revision
150046
Author
[email protected]
Date
2013-05-13 19:00:00 -0700 (Mon, 13 May 2013)

Log Message

Added testRunner.setPrinting.
https://bugs.webkit.org/show_bug.cgi?id=42693
rdar://problem/8213845

Patch by Alex Christensen <[email protected]> on 2013-05-13
Reviewed by Darin Adler.

Source/WebKit2:

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageCopyRenderTreeExternalRepresentationForPrinting): Added.
* WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
Added WKBundlePageCopyRenderTreeExternalRepresentationForPrinting declaration.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::renderTreeExternalRepresentationForPrinting): Added.
* WebProcess/WebPage/WebPage.h:
Added renderTreeExternalRepresentationForPrinting declaration.

Tools:

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
Added setPrinting _javascript_ function.
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::dump):
Dump the external representation for printing if setPrinting has been called.
* WebKitTestRunner/InjectedBundle/TestRunner.h:
(WTR::TestRunner::isPrinting): Added.
(WTR::TestRunner::setPrinting): Added.
Added and initialized m_isPrinting member boolean.

LayoutTests:

* platform/wk2/TestExpectations:
Unskipped printing tests.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (150045 => 150046)


--- trunk/LayoutTests/ChangeLog	2013-05-14 00:59:48 UTC (rev 150045)
+++ trunk/LayoutTests/ChangeLog	2013-05-14 02:00:00 UTC (rev 150046)
@@ -1,3 +1,14 @@
+2013-05-13  Alex Christensen  <[email protected]>
+
+        Added testRunner.setPrinting.
+        https://bugs.webkit.org/show_bug.cgi?id=42693
+        rdar://problem/8213845
+
+        Reviewed by Darin Adler.
+
+        * platform/wk2/TestExpectations:
+        Unskipped printing tests.
+
 2013-05-13  Christophe Dumez  <[email protected]>
 
         Rename BarInfo to BarProp and remove [NoInterfaceObject]

Modified: trunk/LayoutTests/platform/wk2/TestExpectations (150045 => 150046)


--- trunk/LayoutTests/platform/wk2/TestExpectations	2013-05-14 00:59:48 UTC (rev 150045)
+++ trunk/LayoutTests/platform/wk2/TestExpectations	2013-05-14 02:00:00 UTC (rev 150046)
@@ -183,17 +183,6 @@
 # <https://bugs.webkit.org/show_bug.cgi?id=69548>
 fast/events/show-modal-dialog-onblur-onfocus.html
 
-# WebKitTestRunner needs layoutTestController.setPrinting
-# <https://bugs.webkit.org/show_bug.cgi?id=42693>
-printing/compositing-layer-printing.html
-printing/iframe-print.html
-printing/media-queries-print.html
-printing/page-rule-in-media-query.html
-printing/setPrinting.html
-printing/single-line-must-not-be-split-into-two-pages.html
-printing/simultaneous-position-float-change.html
-printing/width-overflow.html
-
 # WebKitTestRunner needs layoutTestController.setWillSendRequestClearHeader
 # <https://bugs.webkit.org/show_bug.cgi?id=42699>
 http/tests/security/no-referrer.html

Modified: trunk/Source/WebKit2/ChangeLog (150045 => 150046)


--- trunk/Source/WebKit2/ChangeLog	2013-05-14 00:59:48 UTC (rev 150045)
+++ trunk/Source/WebKit2/ChangeLog	2013-05-14 02:00:00 UTC (rev 150046)
@@ -1,3 +1,20 @@
+2013-05-13  Alex Christensen  <[email protected]>
+
+        Added testRunner.setPrinting.
+        https://bugs.webkit.org/show_bug.cgi?id=42693
+        rdar://problem/8213845
+
+        Reviewed by Darin Adler.
+
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
+        (WKBundlePageCopyRenderTreeExternalRepresentationForPrinting): Added.
+        * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
+        Added WKBundlePageCopyRenderTreeExternalRepresentationForPrinting declaration.
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::renderTreeExternalRepresentationForPrinting): Added.
+        * WebProcess/WebPage/WebPage.h:
+        Added renderTreeExternalRepresentationForPrinting declaration.
+
 2013-05-13  Timothy Hatcher  <[email protected]>
 
         Add support for updating the Web Inspector toolbar height.

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp (150045 => 150046)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp	2013-05-14 00:59:48 UTC (rev 150045)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp	2013-05-14 02:00:00 UTC (rev 150046)
@@ -250,6 +250,11 @@
     return toCopiedAPI(toImpl(pageRef)->renderTreeExternalRepresentation());
 }
 
+WKStringRef WKBundlePageCopyRenderTreeExternalRepresentationForPrinting(WKBundlePageRef pageRef)
+{
+    return toCopiedAPI(toImpl(pageRef)->renderTreeExternalRepresentationForPrinting());
+}
+
 void WKBundlePageExecuteEditingCommand(WKBundlePageRef pageRef, WKStringRef name, WKStringRef argument)
 {
     toImpl(pageRef)->executeEditingCommand(toWTFString(name), toWTFString(argument));

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h (150045 => 150046)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h	2013-05-14 00:59:48 UTC (rev 150045)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h	2013-05-14 02:00:00 UTC (rev 150046)
@@ -38,6 +38,7 @@
 WK_EXPORT void WKBundlePageClearMainFrameName(WKBundlePageRef page);
 WK_EXPORT void WKBundlePageClose(WKBundlePageRef page);
 WK_EXPORT WKStringRef WKBundlePageCopyRenderTreeExternalRepresentation(WKBundlePageRef page);
+WK_EXPORT WKStringRef WKBundlePageCopyRenderTreeExternalRepresentationForPrinting(WKBundlePageRef page);
 WK_EXPORT void WKBundlePageExecuteEditingCommand(WKBundlePageRef page, WKStringRef commandName, WKStringRef argument);
 
 WK_EXPORT double WKBundlePageGetTextZoomFactor(WKBundlePageRef page);

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (150045 => 150046)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2013-05-14 00:59:48 UTC (rev 150045)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2013-05-14 02:00:00 UTC (rev 150046)
@@ -681,6 +681,11 @@
     return externalRepresentation(m_mainFrame->coreFrame(), RenderAsTextBehaviorNormal);
 }
 
+String WebPage::renderTreeExternalRepresentationForPrinting() const
+{
+    return externalRepresentation(m_mainFrame->coreFrame(), RenderAsTextPrintingMode);
+}
+
 uint64_t WebPage::renderTreeSize() const
 {
     if (!m_page)

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (150045 => 150046)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2013-05-14 00:59:48 UTC (rev 150045)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2013-05-14 02:00:00 UTC (rev 150046)
@@ -295,6 +295,7 @@
     EditorState editorState() const;
 
     String renderTreeExternalRepresentation() const;
+    String renderTreeExternalRepresentationForPrinting() const;
     uint64_t renderTreeSize() const;
 
     void setTracksRepaints(bool);

Modified: trunk/Tools/ChangeLog (150045 => 150046)


--- trunk/Tools/ChangeLog	2013-05-14 00:59:48 UTC (rev 150045)
+++ trunk/Tools/ChangeLog	2013-05-14 02:00:00 UTC (rev 150046)
@@ -1,3 +1,21 @@
+2013-05-13  Alex Christensen  <[email protected]>
+
+        Added testRunner.setPrinting.
+        https://bugs.webkit.org/show_bug.cgi?id=42693
+        rdar://problem/8213845
+
+        Reviewed by Darin Adler.
+
+        * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
+        Added setPrinting _javascript_ function.
+        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+        (WTR::InjectedBundlePage::dump):
+        Dump the external representation for printing if setPrinting has been called.
+        * WebKitTestRunner/InjectedBundle/TestRunner.h:
+        (WTR::TestRunner::isPrinting): Added.
+        (WTR::TestRunner::setPrinting): Added.
+        Added and initialized m_isPrinting member boolean.
+
 2013-05-13  Csaba Osztrogonác  <[email protected]>
 
         [webkitpy] Make FileInfo.repository_name support SVN version > 1.6

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl (150045 => 150046)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl	2013-05-14 00:59:48 UTC (rev 150045)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl	2013-05-14 02:00:00 UTC (rev 150046)
@@ -73,6 +73,7 @@
     void dispatchPendingLoadRequests();
     void setCacheModel(int model);
     void setAsynchronousSpellCheckingEnabled(boolean value);
+    void setPrinting();
 
     // Special DOM functions.
     void clearBackForwardList();

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp (150045 => 150046)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp	2013-05-14 00:59:48 UTC (rev 150045)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp	2013-05-14 02:00:00 UTC (rev 150046)
@@ -874,8 +874,10 @@
 
     switch (InjectedBundle::shared().testRunner()->whatToDump()) {
     case TestRunner::RenderTree: {
-        WKRetainPtr<WKStringRef> text(AdoptWK, WKBundlePageCopyRenderTreeExternalRepresentation(m_page));
-        stringBuilder.append(toWTFString(text));
+        if (InjectedBundle::shared().testRunner()->isPrinting())
+            stringBuilder.append(toWTFString(adoptWK(WKBundlePageCopyRenderTreeExternalRepresentationForPrinting(m_page)).get()));
+        else
+            stringBuilder.append(toWTFString(adoptWK(WKBundlePageCopyRenderTreeExternalRepresentation(m_page)).get()));
         break;
     }
     case TestRunner::MainFrameText:

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (150045 => 150046)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp	2013-05-14 00:59:48 UTC (rev 150045)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp	2013-05-14 02:00:00 UTC (rev 150046)
@@ -85,6 +85,7 @@
     , m_waitToDump(false)
     , m_testRepaint(false)
     , m_testRepaintSweepHorizontally(false)
+    , m_isPrinting(false)
     , m_willSendRequestReturnsNull(false)
     , m_willSendRequestReturnsNullOnRedirect(false)
     , m_shouldStopProvisionalFrameLoads(false)

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (150045 => 150046)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h	2013-05-14 00:59:48 UTC (rev 150045)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h	2013-05-14 02:00:00 UTC (rev 150046)
@@ -153,6 +153,8 @@
 
     // Printing
     bool isPageBoxVisible(int pageIndex);
+    bool isPrinting() { return m_isPrinting; }
+    void setPrinting() { m_isPrinting = true; }
 
     // Authentication
     void setHandlesAuthenticationChallenges(bool);
@@ -303,6 +305,7 @@
     bool m_waitToDump; // True if waitUntilDone() has been called, but notifyDone() has not yet been called.
     bool m_testRepaint;
     bool m_testRepaintSweepHorizontally;
+    bool m_isPrinting;
 
     bool m_willSendRequestReturnsNull;
     bool m_willSendRequestReturnsNullOnRedirect;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to