Changeset 73714 in webkit


Ignore:
Timestamp:
Dec 10, 2010 3:04:34 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

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.
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r73713 r73714  
     12010-12-10  Joone Hur  <joone@kldp.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        [GTK] Add DRT support for pageProperty, isPageBoxVisible, pageSizeAndMarginsInPixels, and addUserStyleSheet
     6        https://bugs.webkit.org/show_bug.cgi?id=50783
     7
     8        Unskip the following test cases:
     9        printing/page-rule-selection.html
     10        printing/page-format-data.html
     11        * platform/gtk/Skipped:
     12
    1132010-12-10  Pavel Feldman  <pfeldman@chromium.org>
    214
  • trunk/LayoutTests/platform/gtk/Skipped

    r73700 r73714  
    51215121fast/dom/HTMLLinkElement/prefetch-onload.html
    51225122
    5123 # LayoutTestController::pageProperty is not implemented for GTK yet.
    5124 printing/page-rule-selection.html
    5125 
    5126 # LayoutTestController::isPageBoxVisible, pageAreaRectInPixels, and preferredPageSizeInPixels are not implemented yet for GTK.
    5127 printing/page-format-data.html
    5128 
    51295123# Gtk seems to be pumping the lexer an extra time revealed by turning on the
    51305124# HTML5 Lexer in r61234.
  • trunk/WebKit/gtk/ChangeLog

    r73702 r73714  
     12010-12-10  Joone Hur  <joone@kldp.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        [GTK] Add DRT support for pageProperty, isPageBoxVisible, pageSizeAndMarginsInPixels, and addUserStyleSheet
     6        https://bugs.webkit.org/show_bug.cgi?id=50783
     7       
     8        This patch allows to unskip the following test cases:
     9        printing/page-rule-selection.html
     10        printing/page-format-data.html
     11
     12        * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
     13        (DumpRenderTreeSupportGtk::pageProperty): Added.
     14        (DumpRenderTreeSupportGtk::isPageBoxVisible): Ditto.
     15        (DumpRenderTreeSupportGtk::pageSizeAndMarginsInPixels): Ditto.
     16        (DumpRenderTreeSupportGtk::addUserStyleSheet): Ditto.
     17        * WebCoreSupport/DumpRenderTreeSupportGtk.h:
     18
    1192010-12-09  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
    220
  • trunk/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp

    r73696 r73714  
    4040#include "JSValue.h"
    4141#include "NodeList.h"
     42#include "PageGroup.h"
    4243#include "PlatformString.h"
    4344#include "PrintContext.h"
     
    5556#include "webkitwebview.h"
    5657#include "webkitwebframe.h"
     58#include "DOMWrapperWorld.h"
    5759#include <JavaScriptCore/APICast.h>
    5860
     
    239241
    240242    return PrintContext::numberOfPages(coreFrame, FloatSize(pageWidth, pageHeight));
     243}
     244
     245/**
     246 * pageProperty
     247 * @frame: a #WebKitWebFrame
     248 * @propertyName: name of a property
     249 * @pageNumber: number of a page
     250 *
     251 * Return value: The value of the given property name.
     252 */
     253CString DumpRenderTreeSupportGtk::pageProperty(WebKitWebFrame* frame, const char* propertyName, int pageNumber)
     254{
     255    g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), CString());
     256
     257    Frame* coreFrame = core(frame);
     258    if (!coreFrame)
     259        return CString();
     260
     261    return PrintContext::pageProperty(coreFrame, propertyName, pageNumber).utf8();
     262}
     263
     264/**
     265 * isPageBoxVisible
     266 * @frame: a #WebKitWebFrame
     267 * @pageNumber: number of a page
     268 *
     269 * Return value: TRUE if a page box is visible.
     270 */
     271bool DumpRenderTreeSupportGtk::isPageBoxVisible(WebKitWebFrame* frame, int pageNumber)
     272{
     273    g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), false);
     274
     275    Frame* coreFrame = core(frame);
     276    if (!coreFrame)
     277        return false;
     278
     279    return coreFrame->document()->isPageBoxVisible(pageNumber);
     280}
     281
     282/**
     283 * pageSizeAndMarginsInPixels
     284 * @frame: a #WebKitWebFrame
     285 * @pageNumber: number of a page
     286 * @width: width of a page
     287 * @height: height of a page
     288 * @marginTop: top margin of a page
     289 * @marginRight: right margin of a page
     290 * @marginBottom: bottom margin of a page
     291 * @marginLeft: left margin of a page
     292 *
     293 * Return value: The value of page size and margin.
     294 */
     295CString DumpRenderTreeSupportGtk::pageSizeAndMarginsInPixels(WebKitWebFrame* frame, int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft)
     296{
     297    g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), CString());
     298
     299    Frame* coreFrame = core(frame);
     300    if (!coreFrame)
     301        return CString();
     302
     303    return PrintContext::pageSizeAndMarginsInPixels(coreFrame, pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft).utf8();
     304}
     305
     306/**
     307 * addUserStyleSheet
     308 * @frame: a #WebKitWebFrame
     309 * @sourceCode: code of a user stylesheet
     310 *
     311 */
     312void DumpRenderTreeSupportGtk::addUserStyleSheet(WebKitWebFrame* frame, const char* sourceCode)
     313{
     314    g_return_if_fail(WEBKIT_IS_WEB_FRAME(frame));
     315
     316    Frame* coreFrame = core(frame);
     317    if (!coreFrame)
     318        return;
     319
     320    WebKitWebView* webView = getViewFromFrame(frame);
     321    Page* page = core(webView);
     322    page->group().addUserStyleSheetToWorld(mainThreadNormalWorld(), sourceCode, KURL(), 0, 0, WebCore::InjectInAllFrames);
    241323}
    242324
  • trunk/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h

    r73628 r73714  
    5151    static int pageNumberForElementById(WebKitWebFrame* frame, const char* id, float pageWidth, float pageHeight);
    5252    static int numberOfPagesForFrame(WebKitWebFrame* frame, float pageWidth, float pageHeight);
     53    static WTF::CString pageProperty(WebKitWebFrame* frame, const char* propertyName, int pageNumber);
     54    static bool isPageBoxVisible(WebKitWebFrame* frame, int pageNumber);
     55    static WTF::CString pageSizeAndMarginsInPixels(WebKitWebFrame* mainFrame, int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft);
     56    static void addUserStyleSheet(WebKitWebFrame* mainFrame, const char* sourceCode);
    5357    static guint getPendingUnloadEventCount(WebKitWebFrame* frame);
    5458    static bool pauseAnimation(WebKitWebFrame* frame, const char* name, double time, const char* element);
  • trunk/WebKitTools/ChangeLog

    r73712 r73714  
     12010-12-10  Joone Hur  <joone@kldp.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        [GTK] Add DRT support for pageProperty, isPageBoxVisible, pageSizeAndMarginsInPixels, and addUserStyleSheet
     6        https://bugs.webkit.org/show_bug.cgi?id=50783
     7
     8        This patch allows to unskip the following test cases:
     9        printing/page-rule-selection.html
     10        printing/page-format-data.html
     11
     12        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
     13        (LayoutTestController::pageProperty): Added.
     14        (LayoutTestController::isPageBoxVisible): Ditto.
     15        (LayoutTestController::pageSizeAndMarginsInPixels): Ditto.
     16        (LayoutTestController::addUserStyleSheet): Ditto.
     17
    1182010-12-10  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
    219
  • trunk/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp

    r73628 r73714  
    153153JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const
    154154{
    155     // FIXME: implement
    156     return JSRetainPtr<JSStringRef>();
     155    JSRetainPtr<JSStringRef> propertyValue(Adopt, JSStringCreateWithUTF8CString(DumpRenderTreeSupportGtk::pageProperty(mainFrame, propertyName, pageNumber).data()));
     156    return propertyValue;
    157157}
    158158
    159159bool LayoutTestController::isPageBoxVisible(int pageNumber) const
    160160{
    161     // FIXME: implement
    162     return false;
     161    return DumpRenderTreeSupportGtk::isPageBoxVisible(mainFrame, pageNumber);
    163162}
    164163
    165164JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const
    166165{
    167     // FIXME: implement
    168     return JSRetainPtr<JSStringRef>();
     166    JSRetainPtr<JSStringRef> propertyValue(Adopt, JSStringCreateWithUTF8CString(DumpRenderTreeSupportGtk::pageSizeAndMarginsInPixels(mainFrame, pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft).data()));
     167    return propertyValue;
    169168}
    170169
     
    717716void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames)
    718717{
    719     printf("LayoutTestController::addUserStyleSheet not implemented.\n");
     718    GOwnPtr<gchar> sourceCode(JSStringCopyUTF8CString(source));
     719    DumpRenderTreeSupportGtk::addUserStyleSheet(mainFrame, sourceCode.get());
    720720}
    721721
Note: See TracChangeset for help on using the changeset viewer.