[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

bdakin at apple.com bdakin at apple.com
Wed Dec 22 15:43:25 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 8feda75deb60633cfff98858791aa69131eca0c2
Author: bdakin at apple.com <bdakin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Nov 11 02:00:57 2010 +0000

    Fix for https://bugs.webkit.org/show_bug.cgi?id=49356
    -[WebView _scaleWebView:] should take and origin and scroll the
    document
    -and corresponding-
    <rdar://problem/8643921>
    
    Reviewed by Simon Fraser.
    
    WebCore:
    
    Apply the scale to the origin, and set a new scroll position.
    * page/Frame.cpp:
    (WebCore::Frame::scalePage):
    * page/Frame.h:
    * WebCore.exp.in:
    
    WebKit/mac:
    
    * WebView/WebView.mm:
    (-[WebView _scaleWebView:atOrigin:]):
    * WebView/WebViewPrivate.h:
    
    WebKit2:
    
    * Shared/API/c/WKSharedAPICast.h:
    (WebKit::toImpl):
    * UIProcess/API/C/WKPage.cpp:
    (WKPageScaleWebView):
    * UIProcess/API/C/WKPage.h:
    * UIProcess/WebPageProxy.cpp:
    (WebKit::WebPageProxy::scaleWebView):
    * UIProcess/WebPageProxy.h:
    * WebProcess/WebPage/WebPage.cpp:
    (WebKit::WebPage::scaleWebView):
    * WebProcess/WebPage/WebPage.h:
    * WebProcess/WebPage/WebPage.messages.in:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71790 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index f581b59..269f7c3 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-11-10  Beth Dakin  <bdakin at apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Fix for https://bugs.webkit.org/show_bug.cgi?id=49356 
+        -[WebView _scaleWebView:] should take and origin and scroll the 
+        document
+        -and corresponding-
+        <rdar://problem/8643921>
+
+        Apply the scale to the origin, and set a new scroll position.
+        * page/Frame.cpp:
+        (WebCore::Frame::scalePage):
+        * page/Frame.h:
+        * WebCore.exp.in:
+
 2010-11-10  Dan Bernstein  <mitz at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/WebCore.exp.in b/WebCore/WebCore.exp.in
index 10494e2..a75fb98 100644
--- a/WebCore/WebCore.exp.in
+++ b/WebCore/WebCore.exp.in
@@ -645,7 +645,7 @@ __ZN7WebCore5Frame28searchForLabelsBeforeElementEP7NSArrayPNS_7ElementEPmPb
 __ZN7WebCore5Frame6createEPNS_4PageEPNS_21HTMLFrameOwnerElementEPNS_17FrameLoaderClientE
 __ZN7WebCore5Frame7setViewEN3WTF10PassRefPtrINS_9FrameViewEEE
 __ZN7WebCore5Frame9nodeImageEPNS_4NodeE
-__ZN7WebCore5Frame9scalePageEf
+__ZN7WebCore5Frame9scalePageEfRKNS_8IntPointE
 __ZN7WebCore5FrameD1Ev
 __ZN7WebCore5Image12supportsTypeERKN3WTF6StringE
 __ZN7WebCore5Image20loadPlatformResourceEPKc
diff --git a/WebCore/page/Frame.cpp b/WebCore/page/Frame.cpp
index 867b68e..eafcb71 100644
--- a/WebCore/page/Frame.cpp
+++ b/WebCore/page/Frame.cpp
@@ -969,7 +969,7 @@ void Frame::setPageAndTextZoomFactors(float pageZoomFactor, float textZoomFactor
     }
 }
 
-void Frame::scalePage(float scale)
+void Frame::scalePage(float scale, const IntPoint& origin)
 {
     if (m_pageScaleFactor == scale)
         return;
@@ -988,6 +988,9 @@ void Frame::scalePage(float scale)
     if (FrameView* view = this->view()) {
         if (document->renderer() && document->renderer()->needsLayout() && view->didFirstLayout())
             view->layout();
+        IntPoint scrollPosition = view->scrollPosition();
+        view->setScrollPosition(IntPoint(scrollPosition.x() + origin.x() * scale, 
+            scrollPosition.y() + origin.y() * scale));
     }
 }
 
diff --git a/WebCore/page/Frame.h b/WebCore/page/Frame.h
index 832a3c2..7fb9df5 100644
--- a/WebCore/page/Frame.h
+++ b/WebCore/page/Frame.h
@@ -144,7 +144,7 @@ namespace WebCore {
         float textZoomFactor() const { return m_textZoomFactor; }
         void setPageAndTextZoomFactors(float pageZoomFactor, float textZoomFactor);
 
-        void scalePage(float scale);
+        void scalePage(float scale, const IntPoint& origin);
         float pageScaleFactor() const { return m_pageScaleFactor; }
 
 #if ENABLE(ORIENTATION_EVENTS)
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index 6027211..cba9747 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,17 @@
+2010-11-10  Beth Dakin  <bdakin at apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Fix for https://bugs.webkit.org/show_bug.cgi?id=49356 
+        -[WebView _scaleWebView:] should take and origin and scroll the 
+        document
+        -and corresponding-
+        <rdar://problem/8643921>
+
+        * WebView/WebView.mm:
+        (-[WebView _scaleWebView:atOrigin:]):
+        * WebView/WebViewPrivate.h:
+
 2010-11-10  Csaba Osztrogonác  <ossy at webkit.org>
 
         Reviewed by David Hyatt.
diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm
index 4687cda..33ebc3d 100644
--- a/WebKit/mac/WebView/WebView.mm
+++ b/WebKit/mac/WebView/WebView.mm
@@ -2627,13 +2627,13 @@ static PassOwnPtr<Vector<String> > toStringVector(NSArray* patterns)
     SchemeRegistry::registerURLSchemeAsSecure(scheme);
 }
 
-- (void)_scaleWebView:(float)scale
+- (void)_scaleWebView:(float)scale atOrigin:(NSPoint)origin
 {
     Frame* coreFrame = [self _mainCoreFrame];
     if (!coreFrame)
         return;
 
-    coreFrame->scalePage(scale);
+    coreFrame->scalePage(scale, IntPoint(origin));
 }
 
 - (float)_viewScaleFactor
diff --git a/WebKit/mac/WebView/WebViewPrivate.h b/WebKit/mac/WebView/WebViewPrivate.h
index b951689..af594d9 100644
--- a/WebKit/mac/WebView/WebViewPrivate.h
+++ b/WebKit/mac/WebView/WebViewPrivate.h
@@ -542,7 +542,7 @@ Could be worth adding to the API.
 + (void)_setDomainRelaxationForbidden:(BOOL)forbidden forURLScheme:(NSString *)scheme;
 + (void)_registerURLSchemeAsSecure:(NSString *)scheme;
 
-- (void)_scaleWebView:(float)scale;
+- (void)_scaleWebView:(float)scale atOrigin:(NSPoint)origin;
 - (float)_viewScaleFactor;
 
 @end
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 3427c21..0b7642a 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,26 @@
+2010-11-10  Beth Dakin  <bdakin at apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Fix for https://bugs.webkit.org/show_bug.cgi?id=49356 
+        -[WebView _scaleWebView:] should take and origin and scroll the 
+        document
+        -and corresponding-
+        <rdar://problem/8643921>
+
+        * Shared/API/c/WKSharedAPICast.h:
+        (WebKit::toImpl):
+        * UIProcess/API/C/WKPage.cpp:
+        (WKPageScaleWebView):
+        * UIProcess/API/C/WKPage.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::scaleWebView):
+        * UIProcess/WebPageProxy.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::scaleWebView):
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+
 2010-11-10  Ada Chan  <adachan at apple.com>
         
         Fix Windows build.
diff --git a/WebKit2/Shared/API/c/WKSharedAPICast.h b/WebKit2/Shared/API/c/WKSharedAPICast.h
index 2daa96b..116fa1d 100644
--- a/WebKit2/Shared/API/c/WKSharedAPICast.h
+++ b/WebKit2/Shared/API/c/WKSharedAPICast.h
@@ -36,6 +36,7 @@
 #include "WebURL.h"
 #include <WebCore/IntRect.h>
 #include <WebCore/FloatRect.h>
+#include <WebCore/IntPoint.h>
 #include <wtf/TypeTraits.h>
 
 namespace WebKit {
@@ -167,6 +168,11 @@ inline WebCore::FloatRect toImpl(const WKRect& wkRect)
                               static_cast<float>(wkRect.size.width), static_cast<float>(wkRect.size.height));
 }
 
+inline WebCore::IntPoint toImpl(const WKPoint& wkPoint)
+{
+    return WebCore::IntPoint(static_cast<int>(wkPoint.x), static_cast<int>(wkPoint.y));
+}
+
 inline WKRect toAPI(const WebCore::FloatRect& rect)
 {
     WKRect wkRect;
diff --git a/WebKit2/UIProcess/API/C/WKPage.cpp b/WebKit2/UIProcess/API/C/WKPage.cpp
index 57c0836..c661e5c 100644
--- a/WebKit2/UIProcess/API/C/WKPage.cpp
+++ b/WebKit2/UIProcess/API/C/WKPage.cpp
@@ -213,9 +213,9 @@ void WKPageSetPageAndTextZoomFactors(WKPageRef pageRef, double pageZoomFactor, d
     toImpl(pageRef)->setPageAndTextZoomFactors(pageZoomFactor, textZoomFactor);
 }
 
-void WKPageScaleWebView(WKPageRef pageRef, double scale)
+void WKPageScaleWebView(WKPageRef pageRef, double scale, WKPoint origin)
 {
-    toImpl(pageRef)->scaleWebView(scale);
+    toImpl(pageRef)->scaleWebView(scale, toImpl(origin));
 }
 
 double WKPageGetViewScaleFactor(WKPageRef pageRef)
diff --git a/WebKit2/UIProcess/API/C/WKPage.h b/WebKit2/UIProcess/API/C/WKPage.h
index d7c96d6..8c618c3 100644
--- a/WebKit2/UIProcess/API/C/WKPage.h
+++ b/WebKit2/UIProcess/API/C/WKPage.h
@@ -253,7 +253,7 @@ WK_EXPORT double WKPageGetPageZoomFactor(WKPageRef page);
 WK_EXPORT void WKPageSetPageZoomFactor(WKPageRef page, double zoomFactor);
 WK_EXPORT void WKPageSetPageAndTextZoomFactors(WKPageRef page, double pageZoomFactor, double textZoomFactor);
 
-WK_EXPORT void WKPageScaleWebView(WKPageRef page, double scale);
+WK_EXPORT void WKPageScaleWebView(WKPageRef page, double scale, WKPoint origin);
 WK_EXPORT double WKPageGetViewScaleFactor(WKPageRef page);
 
 // Find.
diff --git a/WebKit2/UIProcess/WebPageProxy.cpp b/WebKit2/UIProcess/WebPageProxy.cpp
index d480707..629b0dc 100644
--- a/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/WebKit2/UIProcess/WebPageProxy.cpp
@@ -534,7 +534,7 @@ void WebPageProxy::setPageAndTextZoomFactors(double pageZoomFactor, double textZ
     process()->send(Messages::WebPage::SetPageAndTextZoomFactors(m_pageZoomFactor, m_textZoomFactor), m_pageID); 
 }
 
-void WebPageProxy::scaleWebView(double scale)
+void WebPageProxy::scaleWebView(double scale, const IntPoint& origin)
 {
     if (!isValid())
         return;
@@ -543,7 +543,7 @@ void WebPageProxy::scaleWebView(double scale)
         return;
 
     m_viewScaleFactor = scale;
-    process()->send(Messages::WebPage::ScaleWebView(scale), m_pageID);
+    process()->send(Messages::WebPage::ScaleWebView(scale, origin), m_pageID);
 }
 
 void WebPageProxy::findString(const String& string, FindDirection findDirection, FindOptions findOptions, unsigned maxMatchCount)
diff --git a/WebKit2/UIProcess/WebPageProxy.h b/WebKit2/UIProcess/WebPageProxy.h
index f86f013..e6086a0 100644
--- a/WebKit2/UIProcess/WebPageProxy.h
+++ b/WebKit2/UIProcess/WebPageProxy.h
@@ -191,7 +191,7 @@ public:
     void setPageZoomFactor(double);
     void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
 
-    void scaleWebView(double scale);
+    void scaleWebView(double scale, const WebCore::IntPoint& origin);
     double viewScaleFactor() const { return m_viewScaleFactor; }
 
     // Find.
diff --git a/WebKit2/WebProcess/WebPage/WebPage.cpp b/WebKit2/WebProcess/WebPage/WebPage.cpp
index 6058274..03995bd 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -458,12 +458,12 @@ void WebPage::setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFa
     return frame->setPageAndTextZoomFactors(static_cast<float>(pageZoomFactor), static_cast<float>(textZoomFactor));
 }
 
-void WebPage::scaleWebView(double scale)
+void WebPage::scaleWebView(double scale, const IntPoint& origin)
 {
     Frame* frame = m_mainFrame->coreFrame();
     if (!frame)
         return;
-    frame->scalePage(scale);
+    frame->scalePage(scale, origin);
 }
 
 double WebPage::viewScaleFactor() const
diff --git a/WebKit2/WebProcess/WebPage/WebPage.h b/WebKit2/WebProcess/WebPage/WebPage.h
index daab869..dd946a2 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.h
+++ b/WebKit2/WebProcess/WebPage/WebPage.h
@@ -160,7 +160,7 @@ public:
     void setPageZoomFactor(double);
     void setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFactor);
 
-    void scaleWebView(double scale);
+    void scaleWebView(double scale, const WebCore::IntPoint& origin);
     double viewScaleFactor() const;
 
     void stopLoading();
diff --git a/WebKit2/WebProcess/WebPage/WebPage.messages.in b/WebKit2/WebProcess/WebPage/WebPage.messages.in
index af07dcc..f301bee 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.messages.in
+++ b/WebKit2/WebProcess/WebPage/WebPage.messages.in
@@ -70,7 +70,7 @@ messages -> WebPage {
     SetPageZoomFactor(double zoomFactor)
     SetTextZoomFactor(double zoomFactor)
 
-    ScaleWebView(double scale)
+    ScaleWebView(double scale, WebCore::IntPoint origin)
 
     # Find.
     FindString(WTF::String string, uint32_t findDirection, uint32_t findOptions, unsigned maxMatchCount)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list