2010-12-10 Joone Hur <joone@kldp.org>

        Reviewed by Eric Seidel.

        [GTK] Add DRT support for pageProperty, isPageBoxVisible, pageSizeAndMarginsInPixels, and addUserStyleSheet
        https://bugs.webkit.org/show_bug.cgi?id=50783

        Unskip the following test cases:
        printing/page-rule-selection.html
        printing/page-format-data.html
        * platform/gtk/Skipped:
2010-12-10  Joone Hur  <joone@kldp.org>

        Reviewed by Eric Seidel.

        [GTK] Add DRT support for pageProperty, isPageBoxVisible, pageSizeAndMarginsInPixels, and addUserStyleSheet
        https://bugs.webkit.org/show_bug.cgi?id=50783

        This patch allows to unskip the following test cases:
        printing/page-rule-selection.html
        printing/page-format-data.html

        * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
        (DumpRenderTreeSupportGtk::pageProperty): Added.
        (DumpRenderTreeSupportGtk::isPageBoxVisible): Ditto.
        (DumpRenderTreeSupportGtk::pageSizeAndMarginsInPixels): Ditto.
        (DumpRenderTreeSupportGtk::addUserStyleSheet): Ditto.
        * WebCoreSupport/DumpRenderTreeSupportGtk.h:
2010-12-10  Joone Hur  <joone@kldp.org>

        Reviewed by Eric Seidel.

        [GTK] Add DRT support for pageProperty, isPageBoxVisible, pageSizeAndMarginsInPixels, and addUserStyleSheet
        https://bugs.webkit.org/show_bug.cgi?id=50783

        This patch allows to unskip the following test cases:
        printing/page-rule-selection.html
        printing/page-format-data.html

        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
        (LayoutTestController::pageProperty): Added.
        (LayoutTestController::isPageBoxVisible): Ditto.
        (LayoutTestController::pageSizeAndMarginsInPixels): Ditto.
        (LayoutTestController::addUserStyleSheet): Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73714 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent e9f9151b
2010-12-10 Joone Hur <joone@kldp.org>
Reviewed by Eric Seidel.
[GTK] Add DRT support for pageProperty, isPageBoxVisible, pageSizeAndMarginsInPixels, and addUserStyleSheet
https://bugs.webkit.org/show_bug.cgi?id=50783
Unskip the following test cases:
printing/page-rule-selection.html
printing/page-format-data.html
* platform/gtk/Skipped:
2010-12-10 Pavel Feldman <pfeldman@chromium.org>
Not reviewed. Updated chromium test expectations.
......
......@@ -5120,12 +5120,6 @@ fast/dom/HTMLLinkElement/link-and-subresource-test.html
fast/dom/HTMLLinkElement/prefetch.html
fast/dom/HTMLLinkElement/prefetch-onload.html
# LayoutTestController::pageProperty is not implemented for GTK yet.
printing/page-rule-selection.html
# LayoutTestController::isPageBoxVisible, pageAreaRectInPixels, and preferredPageSizeInPixels are not implemented yet for GTK.
printing/page-format-data.html
# Gtk seems to be pumping the lexer an extra time revealed by turning on the
# HTML5 Lexer in r61234.
# https://bugs.webkit.org/show_bug.cgi?id=40664
......
2010-12-10 Joone Hur <joone@kldp.org>
Reviewed by Eric Seidel.
[GTK] Add DRT support for pageProperty, isPageBoxVisible, pageSizeAndMarginsInPixels, and addUserStyleSheet
https://bugs.webkit.org/show_bug.cgi?id=50783
This patch allows to unskip the following test cases:
printing/page-rule-selection.html
printing/page-format-data.html
* WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
(DumpRenderTreeSupportGtk::pageProperty): Added.
(DumpRenderTreeSupportGtk::isPageBoxVisible): Ditto.
(DumpRenderTreeSupportGtk::pageSizeAndMarginsInPixels): Ditto.
(DumpRenderTreeSupportGtk::addUserStyleSheet): Ditto.
* WebCoreSupport/DumpRenderTreeSupportGtk.h:
2010-12-09 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
Reviewed by Martin Robinson.
......
......@@ -39,6 +39,7 @@
#include "JSNodeList.h"
#include "JSValue.h"
#include "NodeList.h"
#include "PageGroup.h"
#include "PlatformString.h"
#include "PrintContext.h"
#include "RenderListItem.h"
......@@ -54,6 +55,7 @@
#include "webkitwebviewprivate.h"
#include "webkitwebview.h"
#include "webkitwebframe.h"
#include "DOMWrapperWorld.h"
#include <JavaScriptCore/APICast.h>
using namespace JSC;
......@@ -240,6 +242,86 @@ int DumpRenderTreeSupportGtk::numberOfPagesForFrame(WebKitWebFrame* frame, float
return PrintContext::numberOfPages(coreFrame, FloatSize(pageWidth, pageHeight));
}
/**
* pageProperty
* @frame: a #WebKitWebFrame
* @propertyName: name of a property
* @pageNumber: number of a page
*
* Return value: The value of the given property name.
*/
CString DumpRenderTreeSupportGtk::pageProperty(WebKitWebFrame* frame, const char* propertyName, int pageNumber)
{
g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), CString());
Frame* coreFrame = core(frame);
if (!coreFrame)
return CString();
return PrintContext::pageProperty(coreFrame, propertyName, pageNumber).utf8();
}
/**
* isPageBoxVisible
* @frame: a #WebKitWebFrame
* @pageNumber: number of a page
*
* Return value: TRUE if a page box is visible.
*/
bool DumpRenderTreeSupportGtk::isPageBoxVisible(WebKitWebFrame* frame, int pageNumber)
{
g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), false);
Frame* coreFrame = core(frame);
if (!coreFrame)
return false;
return coreFrame->document()->isPageBoxVisible(pageNumber);
}
/**
* pageSizeAndMarginsInPixels
* @frame: a #WebKitWebFrame
* @pageNumber: number of a page
* @width: width of a page
* @height: height of a page
* @marginTop: top margin of a page
* @marginRight: right margin of a page
* @marginBottom: bottom margin of a page
* @marginLeft: left margin of a page
*
* Return value: The value of page size and margin.
*/
CString DumpRenderTreeSupportGtk::pageSizeAndMarginsInPixels(WebKitWebFrame* frame, int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft)
{
g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), CString());
Frame* coreFrame = core(frame);
if (!coreFrame)
return CString();
return PrintContext::pageSizeAndMarginsInPixels(coreFrame, pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft).utf8();
}
/**
* addUserStyleSheet
* @frame: a #WebKitWebFrame
* @sourceCode: code of a user stylesheet
*
*/
void DumpRenderTreeSupportGtk::addUserStyleSheet(WebKitWebFrame* frame, const char* sourceCode)
{
g_return_if_fail(WEBKIT_IS_WEB_FRAME(frame));
Frame* coreFrame = core(frame);
if (!coreFrame)
return;
WebKitWebView* webView = getViewFromFrame(frame);
Page* page = core(webView);
page->group().addUserStyleSheetToWorld(mainThreadNormalWorld(), sourceCode, KURL(), 0, 0, WebCore::InjectInAllFrames);
}
/**
* getPendingUnloadEventCount:
* @frame: a #WebKitWebFrame
......
......@@ -50,6 +50,10 @@ public:
static WTF::CString counterValueForElementById(WebKitWebFrame* frame, const char* id);
static int pageNumberForElementById(WebKitWebFrame* frame, const char* id, float pageWidth, float pageHeight);
static int numberOfPagesForFrame(WebKitWebFrame* frame, float pageWidth, float pageHeight);
static WTF::CString pageProperty(WebKitWebFrame* frame, const char* propertyName, int pageNumber);
static bool isPageBoxVisible(WebKitWebFrame* frame, int pageNumber);
static WTF::CString pageSizeAndMarginsInPixels(WebKitWebFrame* mainFrame, int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft);
static void addUserStyleSheet(WebKitWebFrame* mainFrame, const char* sourceCode);
static guint getPendingUnloadEventCount(WebKitWebFrame* frame);
static bool pauseAnimation(WebKitWebFrame* frame, const char* name, double time, const char* element);
static bool pauseTransition(WebKitWebFrame* frame, const char* name, double time, const char* element);
......
2010-12-10 Joone Hur <joone@kldp.org>
Reviewed by Eric Seidel.
[GTK] Add DRT support for pageProperty, isPageBoxVisible, pageSizeAndMarginsInPixels, and addUserStyleSheet
https://bugs.webkit.org/show_bug.cgi?id=50783
This patch allows to unskip the following test cases:
printing/page-rule-selection.html
printing/page-format-data.html
* DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
(LayoutTestController::pageProperty): Added.
(LayoutTestController::isPageBoxVisible): Ditto.
(LayoutTestController::pageSizeAndMarginsInPixels): Ditto.
(LayoutTestController::addUserStyleSheet): Ditto.
2010-12-10 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
Reviewed by Kenneth Rohde Christiansen.
......
......@@ -152,20 +152,19 @@ int LayoutTestController::numberOfPages(float pageWidth, float pageHeight)
JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const
{
// FIXME: implement
return JSRetainPtr<JSStringRef>();
JSRetainPtr<JSStringRef> propertyValue(Adopt, JSStringCreateWithUTF8CString(DumpRenderTreeSupportGtk::pageProperty(mainFrame, propertyName, pageNumber).data()));
return propertyValue;
}
bool LayoutTestController::isPageBoxVisible(int pageNumber) const
{
// FIXME: implement
return false;
return DumpRenderTreeSupportGtk::isPageBoxVisible(mainFrame, pageNumber);
}
JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const
{
// FIXME: implement
return JSRetainPtr<JSStringRef>();
JSRetainPtr<JSStringRef> propertyValue(Adopt, JSStringCreateWithUTF8CString(DumpRenderTreeSupportGtk::pageSizeAndMarginsInPixels(mainFrame, pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft).data()));
return propertyValue;
}
size_t LayoutTestController::webHistoryItemCount()
......@@ -716,7 +715,8 @@ void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bo
void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames)
{
printf("LayoutTestController::addUserStyleSheet not implemented.\n");
GOwnPtr<gchar> sourceCode(JSStringCopyUTF8CString(source));
DumpRenderTreeSupportGtk::addUserStyleSheet(mainFrame, sourceCode.get());
}
void LayoutTestController::setDeveloperExtrasEnabled(bool enabled)
......
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