[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.21-584-g1e41756

hamaji at chromium.org hamaji at chromium.org
Fri Feb 26 22:23:31 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit c2d2ebc166be894ce8ee3f97bc9b5eed6488303b
Author: hamaji at chromium.org <hamaji at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Feb 18 02:42:00 2010 +0000

    2010-02-17  Shinichiro Hamaji  <hamaji at chromium.org>
    
            Reviewed by Eric Seidel.
    
            [Win] Implement layoutTestController.pageNumberForElementById
            https://bugs.webkit.org/show_bug.cgi?id=34570
    
            * platform/win/Skipped:
    2010-02-17  Shinichiro Hamaji  <hamaji at chromium.org>
    
            Reviewed by Eric Seidel.
    
            [Win] Implement test functions for printing
            https://bugs.webkit.org/show_bug.cgi?id=34570
    
            * Interfaces/IWebFramePrivate.idl:
            * WebFrame.cpp:
            (WebFrame::pageNumberForElementById):
            (WebFrame::numberOfPages):
            * WebFrame.h:
    2010-02-17  Shinichiro Hamaji  <hamaji at chromium.org>
    
            Reviewed by Eric Seidel.
    
            [Win] Implement test functions for printing
            https://bugs.webkit.org/show_bug.cgi?id=34570
    
            * DumpRenderTree/win/LayoutTestControllerWin.cpp:
            (LayoutTestController::pageNumberForElementById):
            (LayoutTestController::numberOfPages):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54921 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 74eed2f..7cbdec5 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,12 @@
+2010-02-17  Shinichiro Hamaji  <hamaji at chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        [Win] Implement layoutTestController.pageNumberForElementById
+        https://bugs.webkit.org/show_bug.cgi?id=34570
+
+        * platform/win/Skipped:
+
 2010-02-17  Brian Weinstein  <bweinstein at apple.com>
 
         Rubber-stamped by Dan Bernstein.
diff --git a/LayoutTests/platform/win/Skipped b/LayoutTests/platform/win/Skipped
index cf4dcb8..2e784f8 100644
--- a/LayoutTests/platform/win/Skipped
+++ b/LayoutTests/platform/win/Skipped
@@ -744,11 +744,6 @@ fast/loader/crash-copying-backforwardlist.html
 # https://bugs.webkit.org/show_bug.cgi?id=34447
 http/tests/media/video-referer.html
 
-# Implement LayoutTestController::pageNumberForElementById().
-printing/page-break-always.html
-printing/pageNumerForElementById.html
-printing/css2.1
-
 # http/tests/security/xss-DENIED-window-open-javascript-url.html timed out on Windows Debug Bot
 # https://bugs.webkit.org/show_bug.cgi?id=33349
 http/tests/security/xss-DENIED-window-open-javascript-url.html
@@ -757,9 +752,6 @@ http/tests/security/xss-DENIED-window-open-javascript-url.html
 # https://bugs.webkit.org/show_bug.cgi?id=32717
 fast/frames/flattening/
 
-# Implement LayoutTestController::numberOfPages().
-printing/numberOfPages.html
-
 # https://bugs.webkit.org/show_bug.cgi?id=34933
 media/video-display-aspect-ratio.html
 
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index e9ea924..21f1e24 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,16 @@
+2010-02-17  Shinichiro Hamaji  <hamaji at chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        [Win] Implement test functions for printing
+        https://bugs.webkit.org/show_bug.cgi?id=34570
+
+        * Interfaces/IWebFramePrivate.idl:
+        * WebFrame.cpp:
+        (WebFrame::pageNumberForElementById):
+        (WebFrame::numberOfPages):
+        * WebFrame.h:
+
 2010-02-16  Darin Adler  <darin at apple.com>
 
         Reviewed by Sam Weinig.
diff --git a/WebKit/win/Interfaces/IWebFramePrivate.idl b/WebKit/win/Interfaces/IWebFramePrivate.idl
index b5a5502..4e26cfa 100644
--- a/WebKit/win/Interfaces/IWebFramePrivate.idl
+++ b/WebKit/win/Interfaces/IWebFramePrivate.idl
@@ -104,4 +104,8 @@ interface IWebFramePrivate : IUnknown
     HRESULT pauseSVGAnimation([in] BSTR elementId, [in] IDOMNode* node, [in] double secondsFromNow, [out, retval] BOOL* animationWasRunning);
 
     HRESULT visibleContentRect([out, retval] RECT*);
+
+    HRESULT pageNumberForElementById([in] BSTR id, [in] float pageWidthInPixels, [in] float pageHeightInPixels, [out, retval] int* pageNumber);
+
+    HRESULT numberOfPages([in] float pageWidthInPixels, [in] float pageHeightInPixels, [out, retval] int* pageNumber);
 }
diff --git a/WebKit/win/WebFrame.cpp b/WebKit/win/WebFrame.cpp
index ce06a0c..8e03794 100644
--- a/WebKit/win/WebFrame.cpp
+++ b/WebKit/win/WebFrame.cpp
@@ -86,6 +86,7 @@
 #include <WebCore/PluginInfoStore.h>
 #include <WebCore/PluginDatabase.h>
 #include <WebCore/PluginView.h>
+#include <WebCore/PrintContext.h>
 #include <WebCore/ResourceHandle.h>
 #include <WebCore/ResourceHandleWin.h>
 #include <WebCore/ResourceRequest.h>
@@ -849,6 +850,44 @@ HRESULT STDMETHODCALLTYPE WebFrame::counterValueForElementById(
     return S_OK;
 }
 
+HRESULT STDMETHODCALLTYPE WebFrame::pageNumberForElementById(
+    /* [in] */ BSTR id,
+    /* [in] */ float pageWidthInPixels,
+    /* [in] */ float pageHeightInPixels,
+    /* [retval][out] */ int* result)
+{
+    if (!result)
+        return E_POINTER;
+
+    Frame* coreFrame = core(this);
+    if (!coreFrame)
+        return E_FAIL;
+
+    String coreId = String(id, SysStringLen(id));
+
+    Element* element = coreFrame->document()->getElementById(coreId);
+    if (!element)
+        return E_FAIL;
+    *result = PrintContext::pageNumberForElement(element, FloatSize(pageWidthInPixels, pageHeightInPixels));
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebFrame::numberOfPages(
+    /* [in] */ float pageWidthInPixels,
+    /* [in] */ float pageHeightInPixels,
+    /* [retval][out] */ int* result)
+{
+    if (!result)
+        return E_POINTER;
+
+    Frame* coreFrame = core(this);
+    if (!coreFrame)
+        return E_FAIL;
+
+    *result = PrintContext::numberOfPages(coreFrame, FloatSize(pageWidthInPixels, pageHeightInPixels));
+    return S_OK;
+}
+
 HRESULT STDMETHODCALLTYPE WebFrame::scrollOffset(
         /* [retval][out] */ SIZE* offset)
 {
diff --git a/WebKit/win/WebFrame.h b/WebKit/win/WebFrame.h
index a10dcb2..f4973ea 100644
--- a/WebKit/win/WebFrame.h
+++ b/WebKit/win/WebFrame.h
@@ -162,6 +162,17 @@ public:
         /* [in] */ BSTR id,
         /* [retval][out] */ BSTR *result);
 
+    virtual HRESULT STDMETHODCALLTYPE pageNumberForElementById(
+        /* [in] */ BSTR id,
+        /* [in] */ float pageWidthInPixels,
+        /* [in] */ float pageHeightInPixels,
+        /* [retval][out] */ int* result);
+
+    virtual HRESULT STDMETHODCALLTYPE numberOfPages(
+        /* [in] */ float pageWidthInPixels,
+        /* [in] */ float pageHeightInPixels,
+        /* [retval][out] */ int* result);
+
     virtual HRESULT STDMETHODCALLTYPE scrollOffset(
         /* [retval][out] */ SIZE* offset);
 
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 57e1b96..32d9353 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,14 @@
+2010-02-17  Shinichiro Hamaji  <hamaji at chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        [Win] Implement test functions for printing
+        https://bugs.webkit.org/show_bug.cgi?id=34570
+
+        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+        (LayoutTestController::pageNumberForElementById):
+        (LayoutTestController::numberOfPages):
+
 2010-02-17  Fumitoshi Ukai  <ukai at chromium.org>
 
         Reviewed by Eric Seidel.
diff --git a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
index 4e91dfb..f717623 100644
--- a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
+++ b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
@@ -1138,14 +1138,29 @@ JSRetainPtr<JSStringRef> LayoutTestController::counterValueForElementById(JSStri
     return counterValueJS;
 }
 
-int LayoutTestController::pageNumberForElementById(JSStringRef, float, float)
+int LayoutTestController::pageNumberForElementById(JSStringRef id, float pageWidthInPixels, float pageHeightInPixels)
 {
-    // FIXME: implement
-    return -1;
+    COMPtr<IWebFramePrivate> framePrivate(Query, frame);
+    if (!framePrivate)
+        return 0;
+
+    wstring idWstring = jsStringRefToWString(id);
+    BSTR idBSTR = SysAllocStringLen((OLECHAR*)idWstring.c_str(), idWstring.length());
+    int pageNumber = -1;
+    if (FAILED(framePrivate->pageNumberForElementById(idBSTR, pageWidthInPixels, pageHeightInPixels, &pageNumber)))
+        pageNumber = -1;
+    SysFreeString(idBSTR);
+    return pageNumber;
 }
 
-int LayoutTestController::numberOfPages(float, float)
+int LayoutTestController::numberOfPages(float pageWidthInPixels, float pageHeightInPixels)
 {
-    // FIXME: implement
-    return -1;
+    COMPtr<IWebFramePrivate> framePrivate(Query, frame);
+    if (!framePrivate)
+        return 0;
+
+    int pageNumber = -1;
+    if (FAILED(framePrivate->numberOfPages(pageWidthInPixels, pageHeightInPixels, &pageNumber)))
+        pageNumber = -1;
+    return pageNumber;
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list