2011-04-06 Chang Shu <cshu@webkit.org>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Apr 2011 03:59:58 +0000 (03:59 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Apr 2011 03:59:58 +0000 (03:59 +0000)
        Reviewed by Darin Adler.

        WebKitTestRunner needs layoutTestController.pageSizeAndMarginsInPixels
        https://bugs.webkit.org/show_bug.cgi?id=57984

        Unskip passed tests.

        * platform/mac-wk2/Skipped:
2011-04-06  Chang Shu  <cshu@webkit.org>

        Reviewed by Darin Adler.

        WebKitTestRunner needs layoutTestController.pageSizeAndMarginsInPixels
        https://bugs.webkit.org/show_bug.cgi?id=57984

        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
        (WKBundlePageSizeAndMarginsInPixels):
        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::pageSizeAndMarginsInPixels):
        * WebProcess/InjectedBundle/InjectedBundle.h:
2011-04-06  Chang Shu  <cshu@webkit.org>

        Reviewed by Darin Adler.

        WebKitTestRunner needs layoutTestController.pageSizeAndMarginsInPixels
        https://bugs.webkit.org/show_bug.cgi?id=57984

        * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
        * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
        (WTR::LayoutTestController::pageSizeAndMarginsInPixels):
        * WebKitTestRunner/InjectedBundle/LayoutTestController.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@83139 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/mac-wk2/Skipped
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h

index d7c442a..1a09820 100644 (file)
@@ -1,3 +1,14 @@
+2011-04-06  Chang Shu  <cshu@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        WebKitTestRunner needs layoutTestController.pageSizeAndMarginsInPixels
+        https://bugs.webkit.org/show_bug.cgi?id=57984
+
+        Unskip passed tests.
+
+        * platform/mac-wk2/Skipped:
+
 2011-04-06  Benjamin Poulain  <benjamin.poulain@nokia.com>
 
         Reviewed by Kenneth Rohde Christiansen.
index e31a69c..fe37f25 100644 (file)
@@ -1654,9 +1654,6 @@ fast/dom/nodesFromRect-links-and-text.html
 # WebKitTestRunner needs layoutTestController.setSpatialNavigationEnabled
 fast/spatial-navigation
 
-# WebKitTestRunner needs layoutTestController.pageSizeAndMarginsInPixels
-printing/page-format-data-display-none.html
-
 # WebKitTestRunner needs layoutTestController.dumpUserGestureInFrameLoadCallbacks
 fast/frames/location-redirect-user-gesture.html
 fast/frames/meta-refresh-user-gesture.html
index 3398bf9..a72e66f 100644 (file)
@@ -1,3 +1,17 @@
+2011-04-06  Chang Shu  <cshu@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        WebKitTestRunner needs layoutTestController.pageSizeAndMarginsInPixels
+        https://bugs.webkit.org/show_bug.cgi?id=57984
+
+        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
+        (WKBundlePageSizeAndMarginsInPixels):
+        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::pageSizeAndMarginsInPixels):
+        * WebProcess/InjectedBundle/InjectedBundle.h:
+
 2011-04-06  Siddharth Mathur  <siddharth.mathur@nokia.com>
 
         Reviewed by Benjamin Poulain.
index 87ec365..4568825 100644 (file)
@@ -162,3 +162,8 @@ int WKBundlePageNumberForElementById(WKBundleRef bundleRef, WKBundleFrameRef fra
 {
     return toImpl(bundleRef)->pageNumberForElementById(toImpl(frameRef), toImpl(idRef)->string(), pageWidthInPixels, pageHeightInPixels);
 }
+
+WKStringRef WKBundlePageSizeAndMarginsInPixels(WKBundleRef bundleRef, WKBundleFrameRef frameRef, int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft)
+{
+    return toCopiedAPI(toImpl(bundleRef)->pageSizeAndMarginsInPixels(toImpl(frameRef), pageIndex, width, height, marginTop, marginRight, marginBottom, marginLeft));
+}
index f4ace79..fa3ec75 100644 (file)
@@ -71,6 +71,7 @@ WK_EXPORT void WKBundleClearAllDatabases(WKBundleRef bundle);
 WK_EXPORT void WKBundleSetDatabaseQuota(WKBundleRef bundle, uint64_t);
 WK_EXPORT int WKBundleNumberOfPages(WKBundleRef bundle, WKBundleFrameRef frameRef, double pageWidthInPixels, double pageHeightInPixels);
 WK_EXPORT int WKBundlePageNumberForElementById(WKBundleRef bundle, WKBundleFrameRef frameRef, WKStringRef idRef, double pageWidthInPixels, double pageHeightInPixels);
+WK_EXPORT WKStringRef WKBundlePageSizeAndMarginsInPixels(WKBundleRef bundle, WKBundleFrameRef frameRef, int, int, int, int, int, int, int);
 
 #ifdef __cplusplus
 }
index 5157965..0966c0e 100644 (file)
@@ -176,6 +176,15 @@ int InjectedBundle::pageNumberForElementById(WebFrame* frame, const String& id,
     return PrintContext::pageNumberForElement(element, FloatSize(pageWidthInPixels, pageHeightInPixels));
 }
 
+String InjectedBundle::pageSizeAndMarginsInPixels(WebFrame* frame, int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft)
+{
+    Frame* coreFrame = frame ? frame->coreFrame() : 0;
+    if (!coreFrame)
+        return String();
+
+    return PrintContext::pageSizeAndMarginsInPixels(coreFrame, pageIndex, width, height, marginTop, marginRight, marginBottom, marginLeft);
+}
+
 static PassOwnPtr<Vector<String> > toStringVector(ImmutableArray* patterns)
 {
     if (!patterns)
index 74fc7b0..ae0be42 100644 (file)
@@ -95,6 +95,7 @@ public:
     void setAllowFileAccessFromFileURLs(WebPageGroupProxy*, bool);
     int numberOfPages(WebFrame*, double, double);
     int pageNumberForElementById(WebFrame*, const String&, double, double);
+    String pageSizeAndMarginsInPixels(WebFrame*, int, int, int, int, int, int, int);
 
     // UserContent API
     void addUserScript(WebPageGroupProxy*, InjectedBundleScriptWorld*, const String& source, const String& url, ImmutableArray* whitelist, ImmutableArray* blacklist, WebCore::UserScriptInjectionTime, WebCore::UserContentInjectedFrames);
index 2b61e7a..2d946f7 100644 (file)
@@ -1,3 +1,15 @@
+2011-04-06  Chang Shu  <cshu@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        WebKitTestRunner needs layoutTestController.pageSizeAndMarginsInPixels
+        https://bugs.webkit.org/show_bug.cgi?id=57984
+
+        * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+        * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+        (WTR::LayoutTestController::pageSizeAndMarginsInPixels):
+        * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+
 2011-04-06  Chris Rogers  <crogers@google.com>
 
         Reviewed by Tony Chang.
index 7b803a3..644aec3 100644 (file)
@@ -67,6 +67,7 @@ module WTR {
         // Printing
         int numberOfPages(in double pageWidthInPixels, in double pageHeightInPixels);
         int pageNumberForElementById(in DOMString id, in double pageWidthInPixels, in double pageHeightInPixels);
+        DOMString pageSizeAndMarginsInPixels(in int pageIndex, in int width, in int height, in int marginTop, in int marginRight, in int marginBottom, in int marginLeft);
 
         // Animation testing.
         int numberOfActiveAnimations();
index 0283c1a..2064f69 100644 (file)
@@ -337,6 +337,12 @@ int LayoutTestController::pageNumberForElementById(JSStringRef id, double pageWi
     return WKBundlePageNumberForElementById(InjectedBundle::shared().bundle(), mainFrame, toWK(id).get(), pageWidthInPixels, pageHeightInPixels);
 }
 
+JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft)
+{
+    WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
+    return toJS(WKBundlePageSizeAndMarginsInPixels(InjectedBundle::shared().bundle(), mainFrame, pageIndex, width, height, marginTop, marginRight, marginBottom, marginLeft));
+}
+
 unsigned LayoutTestController::windowCount()
 {
     return InjectedBundle::shared().pageCount();
index 2aef8b7..54d9c57 100644 (file)
@@ -115,6 +115,7 @@ public:
     // Printing
     int numberOfPages(double pageWidthInPixels, double pageHeightInPixels);
     int pageNumberForElementById(JSStringRef, double pageWidthInPixels, double pageHeightInPixels);
+    JSRetainPtr<JSStringRef> pageSizeAndMarginsInPixels(int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft);
 
     enum WhatToDump { RenderTree, MainFrameText, AllFramesText };
     WhatToDump whatToDump() const { return m_whatToDump; }