[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.20-204-g221d8e8

hamaji at chromium.org hamaji at chromium.org
Wed Feb 10 22:10:35 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit bfa853e5cd88dc9e2cf812fe5ba530ac5eb191f1
Author: hamaji at chromium.org <hamaji at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Feb 3 04:20:05 2010 +0000

    2010-02-02  Shinichiro Hamaji  <hamaji at chromium.org>
    
            Reviewed by Dimitri Glazkov.
    
            [Chromium] Implement WebFrameImpl::pageNumberForElementById
            https://bugs.webkit.org/show_bug.cgi?id=34471
    
            * public/WebFrame.h:
            * src/WebFrameImpl.cpp:
            (WebKit::WebFrameImpl::pageNumberForElementById):
            * src/WebFrameImpl.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54270 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 4f62309..2e72c60 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,15 @@
+2010-02-02  Shinichiro Hamaji  <hamaji at chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [Chromium] Implement WebFrameImpl::pageNumberForElementById
+        https://bugs.webkit.org/show_bug.cgi?id=34471
+
+        * public/WebFrame.h:
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::pageNumberForElementById):
+        * src/WebFrameImpl.h:
+
 2010-02-02  Yury Semikhatsky  <yurys at chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/WebKit/chromium/public/WebFrame.h b/WebKit/chromium/public/WebFrame.h
index 575dae6..a56e6cb 100644
--- a/WebKit/chromium/public/WebFrame.h
+++ b/WebKit/chromium/public/WebFrame.h
@@ -483,6 +483,13 @@ public:
     // used to support layout tests.
     virtual WebString counterValueForElementById(const WebString& id) const = 0;
 
+
+    // Returns the number of page where the specified element will be put.
+    // This method is used to support layout tests.
+    virtual int pageNumberForElementById(const WebString& id,
+                                         float pageWidthInPixels,
+                                         float pageHeightInPixels) const = 0;
+
 protected:
     ~WebFrame() { }
 };
diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp
index 7947c19..2f911f1 100644
--- a/WebKit/chromium/src/WebFrameImpl.cpp
+++ b/WebKit/chromium/src/WebFrameImpl.cpp
@@ -1518,6 +1518,21 @@ WebString WebFrameImpl::counterValueForElementById(const WebString& id) const
     return counterValueForElement(element);
 }
 
+int WebFrameImpl::pageNumberForElementById(const WebString& id,
+                                           float pageWidthInPixels,
+                                           float pageHeightInPixels) const
+{
+    if (!m_frame)
+        return -1;
+
+    Element* element = m_frame->document()->getElementById(id);
+    if (!element)
+        return -1;
+
+    FloatSize pageSize(pageWidthInPixels, pageHeightInPixels);
+    return PrintContext::pageNumberForElement(element, pageSize);
+}
+
 // WebFrameImpl public ---------------------------------------------------------
 
 PassRefPtr<WebFrameImpl> WebFrameImpl::create(WebFrameClient* client)
diff --git a/WebKit/chromium/src/WebFrameImpl.h b/WebKit/chromium/src/WebFrameImpl.h
index be12dbf..ccba6d4 100644
--- a/WebKit/chromium/src/WebFrameImpl.h
+++ b/WebKit/chromium/src/WebFrameImpl.h
@@ -164,6 +164,9 @@ public:
     virtual WebString contentAsMarkup() const;
     virtual WebString renderTreeAsText() const;
     virtual WebString counterValueForElementById(const WebString& id) const;
+    virtual int pageNumberForElementById(const WebString& id,
+                                         float pageWidthInPixels,
+                                         float pageHeightInPixels) const;
 
     static PassRefPtr<WebFrameImpl> create(WebFrameClient* client);
     ~WebFrameImpl();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list