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  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: svn://svn.chromium.org/blink/trunk@83139 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 15c9564c
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.
......@@ -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
......
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.
......
......@@ -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));
}
......@@ -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
}
......
......@@ -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)
......
......@@ -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);
......
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.
......
......@@ -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();
......
......@@ -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();
......
......@@ -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; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment