Changeset 83071 in webkit


Ignore:
Timestamp:
Apr 6, 2011 11:12:30 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-04-06 Chang Shu <cshu@webkit.org>

Reviewed by Darin Adler.

WebKitTestRunner needs layoutTestController.pageNumberForElementById
https://bugs.webkit.org/show_bug.cgi?id=42329

Unskip passed tests.

  • platform/mac-wk2/Skipped:
  • platform/qt-wk2/Skipped:

2011-04-06 Chang Shu <cshu@webkit.org>

Reviewed by Darin Adler.

WebKitTestRunner needs layoutTestController.pageNumberForElementById
https://bugs.webkit.org/show_bug.cgi?id=42329

  • WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundlePageNumberForElementById):
  • WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
  • WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::pageNumberForElementById):
  • WebProcess/InjectedBundle/InjectedBundle.h:

2011-04-06 Chang Shu <cshu@webkit.org>

Reviewed by Darin Adler.

WebKitTestRunner needs layoutTestController.pageNumberForElementById
https://bugs.webkit.org/show_bug.cgi?id=42329

  • WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
  • WebKitTestRunner/InjectedBundle/LayoutTestController.cpp: (WTR::LayoutTestController::pageNumberForElementById):
  • WebKitTestRunner/InjectedBundle/LayoutTestController.h:
Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r83069 r83071  
     12011-04-06  Chang Shu  <cshu@webkit.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        WebKitTestRunner needs layoutTestController.pageNumberForElementById
     6        https://bugs.webkit.org/show_bug.cgi?id=42329
     7
     8        Unskip passed tests.
     9
     10        * platform/mac-wk2/Skipped:
     11        * platform/qt-wk2/Skipped:
     12
    1132011-04-06  Steve Lacey  <sjl@chromium.org>
    214
  • trunk/LayoutTests/platform/mac-wk2/Skipped

    r83010 r83071  
    10091009fast/profiler
    10101010
    1011 # WebKitTestRunner needs to support layoutTestController.pageNumberForElementById
    1012 # <https://bugs.webkit.org/show_bug.cgi?id=42329>
    1013 printing/page-count-percentage-height.html
    1014 printing/allowed-page-breaks.html
    1015 printing/css2.1/page-break-after-000.html
    1016 printing/css2.1/page-break-after-001.html
    1017 printing/css2.1/page-break-after-002.html
    1018 printing/css2.1/page-break-after-003.html
    1019 printing/css2.1/page-break-after-004.html
    1020 printing/css2.1/page-break-before-000.html
    1021 printing/css2.1/page-break-before-001.html
    1022 printing/css2.1/page-break-before-002.html
    1023 printing/css2.1/page-break-inside-000.html
    1024 printing/no-content-empty-pages.html
    1025 printing/page-break-after-avoid.html
    1026 printing/page-break-always.html
    1027 printing/page-break-avoid.html
    1028 printing/page-break-before-avoid.html
    1029 printing/page-break-display-none.html
    1030 printing/page-break-inside-avoid.html
    1031 printing/page-break-margin-collapsed.html
    1032 printing/page-break-orphans-and-widows.html
    1033 printing/page-break-orphans.html
    1034 printing/page-break-widows.html
    1035 printing/pageNumerForElementById.html
    1036 printing/return-from-printing-mode.html
    1037 printing/page-count-layout-overflow.html
    1038 
    10391011# WebKitTestRunner needs layoutTestController.waitForPolicyDelegate
    10401012# <https://bugs.webkit.org/show_bug.cgi?id=42330>
  • trunk/LayoutTests/platform/qt-wk2/Skipped

    r83010 r83071  
    14981498fast/profiler
    14991499
    1500 # WebKitTestRunner needs to support layoutTestController.pageNumberForElementById
    1501 # <https://bugs.webkit.org/show_bug.cgi?id=42329>
    1502 printing/allowed-page-breaks.html
    1503 printing/css2.1/page-break-after-000.html
    1504 printing/css2.1/page-break-after-001.html
    1505 printing/css2.1/page-break-after-002.html
    1506 printing/css2.1/page-break-after-003.html
    1507 printing/css2.1/page-break-after-004.html
    1508 printing/css2.1/page-break-before-000.html
    1509 printing/css2.1/page-break-before-001.html
    1510 printing/css2.1/page-break-before-002.html
    1511 printing/css2.1/page-break-inside-000.html
    1512 printing/no-content-empty-pages.html
    1513 printing/page-break-after-avoid.html
    1514 printing/page-break-always.html
    1515 printing/page-break-avoid.html
    1516 printing/page-break-before-avoid.html
    1517 printing/page-break-display-none.html
    1518 printing/page-break-inside-avoid.html
    1519 printing/page-break-margin-collapsed.html
    1520 printing/page-break-orphans-and-widows.html
    1521 printing/page-break-orphans.html
    1522 printing/page-break-widows.html
    1523 printing/pageNumerForElementById.html
    1524 printing/return-from-printing-mode.html
    1525 
    15261500# WebKitTestRunner needs layoutTestController.waitForPolicyDelegate
    15271501# <https://bugs.webkit.org/show_bug.cgi?id=42330>
  • trunk/Source/WebKit2/ChangeLog

    r83070 r83071  
     12011-04-06  Chang Shu  <cshu@webkit.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        WebKitTestRunner needs layoutTestController.pageNumberForElementById
     6        https://bugs.webkit.org/show_bug.cgi?id=42329
     7
     8        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
     9        (WKBundlePageNumberForElementById):
     10        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
     11        * WebProcess/InjectedBundle/InjectedBundle.cpp:
     12        (WebKit::InjectedBundle::pageNumberForElementById):
     13        * WebProcess/InjectedBundle/InjectedBundle.h:
     14
    1152011-04-05  Enrica Casucci  <enrica@apple.com>
    216
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp

    r83010 r83071  
    158158    return toImpl(bundleRef)->numberOfPages(toImpl(frameRef), pageWidthInPixels, pageHeightInPixels);
    159159}
     160
     161int WKBundlePageNumberForElementById(WKBundleRef bundleRef, WKBundleFrameRef frameRef, WKStringRef idRef, double pageWidthInPixels, double pageHeightInPixels)
     162{
     163    return toImpl(bundleRef)->pageNumberForElementById(toImpl(frameRef), toImpl(idRef)->string(), pageWidthInPixels, pageHeightInPixels);
     164}
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h

    r83010 r83071  
    7171WK_EXPORT void WKBundleSetDatabaseQuota(WKBundleRef bundle, uint64_t);
    7272WK_EXPORT int WKBundleNumberOfPages(WKBundleRef bundle, WKBundleFrameRef frameRef, double pageWidthInPixels, double pageHeightInPixels);
     73WK_EXPORT int WKBundlePageNumberForElementById(WKBundleRef bundle, WKBundleFrameRef frameRef, WKStringRef idRef, double pageWidthInPixels, double pageHeightInPixels);
    7374
    7475#ifdef __cplusplus
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp

    r83010 r83071  
    159159}
    160160
     161int InjectedBundle::pageNumberForElementById(WebFrame* frame, const String& id, double pageWidthInPixels, double pageHeightInPixels)
     162{
     163    Frame* coreFrame = frame ? frame->coreFrame() : 0;
     164    if (!coreFrame)
     165        return -1;
     166
     167    Element* element = coreFrame->document()->getElementById(AtomicString(id));
     168    if (!element)
     169        return -1;
     170
     171    if (!pageWidthInPixels)
     172        pageWidthInPixels = coreFrame->view()->width();
     173    if (!pageHeightInPixels)
     174        pageHeightInPixels = coreFrame->view()->height();
     175
     176    return PrintContext::pageNumberForElement(element, FloatSize(pageWidthInPixels, pageHeightInPixels));
     177}
     178
    161179static PassOwnPtr<Vector<String> > toStringVector(ImmutableArray* patterns)
    162180{
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h

    r83010 r83071  
    9595    void setAllowFileAccessFromFileURLs(WebPageGroupProxy*, bool);
    9696    int numberOfPages(WebFrame*, double, double);
     97    int pageNumberForElementById(WebFrame*, const String&, double, double);
    9798
    9899    // UserContent API
  • trunk/Tools/ChangeLog

    r83068 r83071  
     12011-04-06  Chang Shu  <cshu@webkit.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        WebKitTestRunner needs layoutTestController.pageNumberForElementById
     6        https://bugs.webkit.org/show_bug.cgi?id=42329
     7
     8        * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
     9        * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
     10        (WTR::LayoutTestController::pageNumberForElementById):
     11        * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
     12
    1132011-04-06  Sergio Villar Senin  <svillar@igalia.com>
    214
  • trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl

    r83010 r83071  
    6767        // Printing
    6868        int numberOfPages(in double pageWidthInPixels, in double pageHeightInPixels);
     69        int pageNumberForElementById(in DOMString id, in double pageWidthInPixels, in double pageHeightInPixels);
    6970
    7071        // Animation testing.
  • trunk/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp

    r83010 r83071  
    332332}
    333333
     334int LayoutTestController::pageNumberForElementById(JSStringRef id, double pageWidthInPixels, double pageHeightInPixels)
     335{
     336    WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
     337    return WKBundlePageNumberForElementById(InjectedBundle::shared().bundle(), mainFrame, toWK(id).get(), pageWidthInPixels, pageHeightInPixels);
     338}
     339
    334340unsigned LayoutTestController::windowCount()
    335341{
  • trunk/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h

    r83010 r83071  
    115115    // Printing
    116116    int numberOfPages(double pageWidthInPixels, double pageHeightInPixels);
     117    int pageNumberForElementById(JSStringRef, double pageWidthInPixels, double pageHeightInPixels);
    117118
    118119    enum WhatToDump { RenderTree, MainFrameText, AllFramesText };
Note: See TracChangeset for help on using the changeset viewer.