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

weinig at apple.com weinig at apple.com
Wed Dec 22 11:51:36 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 394d239db72a1df3621f514b333b313e6a7ab49a
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Aug 10 01:43:05 2010 +0000

    Add zoom support for injected bundle
    https://bugs.webkit.org/show_bug.cgi?id=43759
    
    Reviewed by Geoffrey Garen.
    
    WebKit2:
    
    Add SPI to change the zoom factor for a page.
    
    * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
    (toZoomMode):
    * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
    (WKBundlePageGetZoomFactor):
    (WKBundlePageSetZoomFactor):
    (WKBundlePageSetZoomMode):
    * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
    * WebProcess/WebPage/WebPage.cpp:
    (WebKit::WebPage::zoomFactor):
    (WebKit::WebPage::setZoomFactor):
    (WebKit::WebPage::setZoomMode):
    * WebProcess/WebPage/WebPage.h:
    
    WebKitTools:
    
    Use zoom factor SPI to implement zoom related eventSender functions.
    
    * WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl:
    * WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
    (WTR::EventSendingController::textZoomIn):
    (WTR::EventSendingController::textZoomOut):
    (WTR::EventSendingController::zoomPageIn):
    (WTR::EventSendingController::zoomPageOut):
    * WebKitTestRunner/InjectedBundle/EventSendingController.h:
    * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
    (WTR::InjectedBundlePage::reset): Reset zoom mode and level for each test.
    
    LayoutTests:
    
    * platform/mac-wk2/Skipped: Remove now passing tests.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65029 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index b42853f..9dda84e 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,12 @@
+2010-08-09  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Geoffrey Garen.
+
+        Add zoom support for injected bundle
+        https://bugs.webkit.org/show_bug.cgi?id=43759
+
+        * platform/mac-wk2/Skipped: Remove now passing tests.
+
 2010-08-09  Ryosuke Niwa  <rniwa at webkit.org>
 
         Reviewed by Justin Garcia.
diff --git a/LayoutTests/platform/mac-wk2/Skipped b/LayoutTests/platform/mac-wk2/Skipped
index 7c1c412..bf46ffe 100644
--- a/LayoutTests/platform/mac-wk2/Skipped
+++ b/LayoutTests/platform/mac-wk2/Skipped
@@ -233,7 +233,6 @@ fast/css/first-letter-first-line-hover.html
 fast/css/first-letter-hover.html
 fast/css/hover-affects-child.html
 fast/css/hover-subselector.html
-fast/css/ignore-text-zoom.html
 fast/css/layerZOrderCrash.html
 fast/css/list-item-pseudo-nocrash.html
 fast/css/nested-layers-with-hover.html
@@ -242,10 +241,7 @@ fast/css/resize-corner-tracking.html
 fast/css/resize-single-axis.html
 fast/css/universal-hover-quirk.html
 fast/css/user-drag-none.html
-fast/css/zoom-body-scroll.html
 fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-in-zoom-and-scroll.html
-fast/dom/Document/CaretRangeFromPoint/hittest-relative-to-viewport.html
-fast/dom/elementFromPoint-relative-to-viewport.html
 fast/dom/HTMLTableColElement/resize-table-using-col-width.html
 fast/dom/Node/mutation-blur.html
 fast/dom/replaced-image-map.html
@@ -515,8 +511,6 @@ platform/mac/fast/forms/input-appearance-spinbutton-up.html
 platform/mac/fast/forms/input-number-click.html
 platform/mac/fast/forms/listbox-scrollbar-hit-test.html
 platform/mac/fast/overflow/overflow-scrollbar-hit-test.html
-plugins/createScriptableObject-before-start.html
-plugins/destroy-during-npp-new.html
 plugins/resize-from-plugin.html
 scrollbars/overflow-custom-scrollbar-crash.html
 scrollbars/scrollbar-iframe-click-does-not-blur-content.html
@@ -579,7 +573,6 @@ svg/custom/resource-invalidate-on-target-update.svg
 svg/custom/scroll-hit-test.xhtml
 svg/custom/stroke-width-click.svg
 svg/custom/text-hit-test.svg
-svg/custom/text-zoom.xhtml
 svg/custom/use-clipped-hit.svg
 svg/custom/use-css-events.svg
 svg/custom/use-elementInstance-event-target.svg
@@ -806,24 +799,8 @@ svg/text/select-x-list-with-tspans-3.svg
 svg/text/select-x-list-with-tspans-4.svg
 svg/text/selection-doubleclick.svg
 svg/text/selection-tripleclick.svg
-svg/zoom/page/absolute-sized-document-no-scrollbars.svg
-svg/zoom/page/absolute-sized-document-scrollbars.svg
-svg/zoom/page/relative-sized-document-scrollbars.svg
 svg/zoom/page/zoom-coords-viewattr-01-b.svg
-svg/zoom/page/zoom-foreignObject.svg
-svg/zoom/page/zoom-hixie-mixed-008.xml
-svg/zoom/page/zoom-hixie-mixed-009.xml
-svg/zoom/page/zoom-hixie-rendering-model-004.xhtml
-svg/zoom/page/zoom-svg-float-border-padding.xml
-svg/zoom/text/absolute-sized-document-no-scrollbars.svg
-svg/zoom/text/absolute-sized-document-scrollbars.svg
-svg/zoom/text/relative-sized-document-scrollbars.svg
 svg/zoom/text/zoom-coords-viewattr-01-b.svg
-svg/zoom/text/zoom-foreignObject.svg
-svg/zoom/text/zoom-hixie-mixed-008.xml
-svg/zoom/text/zoom-hixie-mixed-009.xml
-svg/zoom/text/zoom-hixie-rendering-model-004.xhtml
-svg/zoom/text/zoom-svg-float-border-padding.xml
 
 # WebKitTestRunner needs to support layoutTestController.setXSSAuditorEnabled
 # <https://bugs.webkit.org/show_bug.cgi?id=42195>
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index ce5be33..c1ce162 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,25 @@
+2010-08-09  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Geoffrey Garen.
+
+        Add zoom support for injected bundle
+        https://bugs.webkit.org/show_bug.cgi?id=43759
+
+        Add SPI to change the zoom factor for a page.
+
+        * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
+        (toZoomMode):
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
+        (WKBundlePageGetZoomFactor):
+        (WKBundlePageSetZoomFactor):
+        (WKBundlePageSetZoomMode):
+        * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::zoomFactor):
+        (WebKit::WebPage::setZoomFactor):
+        (WebKit::WebPage::setZoomMode):
+        * WebProcess/WebPage/WebPage.h:
+
 2010-08-06  Gavin Barraclough  <barraclough at apple.com>
 
         Rubber stamped by Sam Weinig
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h
index fbc1a05..f5e3843 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h
@@ -28,8 +28,10 @@
 
 #include "WKBundleBase.h"
 #include "WKBundlePage.h"
+#include "WKBundlePagePrivate.h"
 #include <WebCore/EditorInsertAction.h>
 #include <WebCore/TextAffinity.h>
+#include <WebCore/ZoomMode.h>
 
 namespace WebCore {
     class CSSStyleDeclaration;
@@ -112,4 +114,17 @@ inline WKAffinityType toWK(WebCore::EAffinity affinity)
     return kWKAffinityUpstream;
 }
 
+inline WebCore::ZoomMode toZoomMode(WKBundlePageZoomMode wkZoomMode)
+{
+    switch (wkZoomMode) {
+    case kWKBundlePageZoomModeTextOnly:
+        return WebCore::ZoomTextOnly;
+    case kWKBundlePageZoomModePage:
+        return WebCore::ZoomPage;
+    }
+
+    ASSERT_NOT_REACHED();
+    return WebCore::ZoomTextOnly;
+}
+
 #endif // WKBundleAPICast_h
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
index 79cd84a..acaa48e 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
@@ -91,3 +91,18 @@ void WKBundlePageClose(WKBundlePageRef pageRef)
 {
     toWK(pageRef)->sendClose();
 }
+
+float WKBundlePageGetZoomFactor(WKBundlePageRef pageRef)
+{
+    return toWK(pageRef)->zoomFactor();
+}
+
+void WKBundlePageSetZoomFactor(WKBundlePageRef pageRef, float zoomFactor)
+{
+    toWK(pageRef)->setZoomFactor(zoomFactor);
+}
+
+void WKBundlePageSetZoomMode(WKBundlePageRef pageRef, WKBundlePageZoomMode zoomMode)
+{
+    toWK(pageRef)->setZoomMode(toZoomMode(zoomMode));
+}
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h
index 09391f9..58fe0e2 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h
@@ -33,12 +33,22 @@
 extern "C" {
 #endif
 
+enum WKBundlePageZoomMode {
+    kWKBundlePageZoomModePage = 0,
+    kWKBundlePageZoomModeTextOnly = 1
+};
+typedef enum WKBundlePageZoomMode WKBundlePageZoomMode;
+
 WK_EXPORT bool WKBundlePageIsEditingCommandEnabled(WKBundlePageRef page, WKStringRef commandName);
 WK_EXPORT void WKBundlePageClearMainFrameName(WKBundlePageRef page);
 WK_EXPORT void WKBundlePageClose(WKBundlePageRef page);
 WK_EXPORT WKStringRef WKBundlePageCopyRenderTreeExternalRepresentation(WKBundlePageRef page);
 WK_EXPORT void WKBundlePageExecuteEditingCommand(WKBundlePageRef page, WKStringRef commandName, WKStringRef argument);
 
+WK_EXPORT float WKBundlePageGetZoomFactor(WKBundlePageRef page);
+WK_EXPORT void WKBundlePageSetZoomFactor(WKBundlePageRef page, float zoomFactor);
+WK_EXPORT void WKBundlePageSetZoomMode(WKBundlePageRef page, WKBundlePageZoomMode zoomMode);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/WebKit2/WebProcess/WebPage/WebPage.cpp b/WebKit2/WebProcess/WebPage/WebPage.cpp
index f85ea9f..f06d51e 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -310,6 +310,29 @@ void WebPage::drawRect(GraphicsContext& graphicsContext, const IntRect& rect)
     graphicsContext.restore();
 }
 
+float WebPage::zoomFactor() const
+{
+    if (Frame* coreFrame = m_mainFrame->coreFrame()) {
+        if (FrameView* view = coreFrame->view())
+            return view->zoomFactor();
+    }
+    
+    return 1.0f;
+}
+
+void WebPage::setZoomFactor(float zoomFactor)
+{
+    if (Frame* coreFrame = m_mainFrame->coreFrame()) {
+        if (FrameView* view = coreFrame->view())
+            return view->setZoomFactor(zoomFactor, m_page->settings()->zoomMode());
+    }
+}
+
+void WebPage::setZoomMode(ZoomMode mode)
+{
+    m_page->settings()->setZoomMode(mode);
+}
+
 // Events 
 
 static const WebEvent* g_currentEvent = 0;
diff --git a/WebKit2/WebProcess/WebPage/WebPage.h b/WebKit2/WebProcess/WebPage/WebPage.h
index 660286f..348a7c3 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.h
+++ b/WebKit2/WebProcess/WebPage/WebPage.h
@@ -34,6 +34,7 @@
 #include "InjectedBundlePageUIClient.h"
 #include <WebCore/FrameLoaderTypes.h>
 #include <WebCore/IntRect.h>
+#include <WebCore/ZoomMode.h>
 #include <wtf/Forward.h>
 #include <wtf/HashMap.h>
 #include <wtf/OwnPtr.h>
@@ -113,6 +114,10 @@ public:
     bool isEditingCommandEnabled(const WTF::String& commandName);
     void clearMainFrameName();
     void sendClose();
+    
+    float zoomFactor() const;
+    void setZoomFactor(float);
+    void setZoomMode(WebCore::ZoomMode);
 
 #if USE(ACCELERATED_COMPOSITING)
     void changeAcceleratedCompositingMode(WebCore::GraphicsLayer*);
@@ -150,7 +155,7 @@ private:
     void preferencesDidChange(const WebPreferencesStore&);
     void platformPreferencesDidChange(const WebPreferencesStore&);
     void didReceivePolicyDecision(WebFrame*, uint64_t listenerID, WebCore::PolicyAction policyAction);
-    
+
     WebCore::Page* m_page;
     RefPtr<WebFrame> m_mainFrame;
     HashMap<uint64_t, WebFrame*> m_frameMap;
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 21f647f..616bd14 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,22 @@
+2010-08-09  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Geoffrey Garen.
+
+        Add zoom support for injected bundle
+        https://bugs.webkit.org/show_bug.cgi?id=43759
+
+        Use zoom factor SPI to implement zoom related eventSender functions.
+
+        * WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl:
+        * WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
+        (WTR::EventSendingController::textZoomIn):
+        (WTR::EventSendingController::textZoomOut):
+        (WTR::EventSendingController::zoomPageIn):
+        (WTR::EventSendingController::zoomPageOut):
+        * WebKitTestRunner/InjectedBundle/EventSendingController.h:
+        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+        (WTR::InjectedBundlePage::reset): Reset zoom mode and level for each test.
+
 2010-08-09  Gavin Barraclough  <barraclough at apple.com>
 
         Speculative chromium build fix III.
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl
index 55b1552..1e47772 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl
@@ -34,10 +34,10 @@ module WTR {
         [CustomArgumentHandling] void leapForward(/*in unsigned long delay*/); // CustomArgumentHandling only to throw exception while not implemented.
 
         // Zoom functions.
-        [CustomArgumentHandling] void textZoomIn(); // CustomArgumentHandling only to throw exception while not implemented.
-        [CustomArgumentHandling] void textZoomOut(); // CustomArgumentHandling only to throw exception while not implemented.
-        [CustomArgumentHandling] void zoomPageIn(); // CustomArgumentHandling only to throw exception while not implemented.
-        [CustomArgumentHandling] void zoomPageOut(); // CustomArgumentHandling only to throw exception while not implemented.
+        void textZoomIn();
+        void textZoomOut();
+        void zoomPageIn();
+        void zoomPageOut();
     };
 
 }
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp
index 25d9a7c..472cf6c 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp
@@ -26,11 +26,16 @@
 #include "EventSendingController.h"
 
 #include "InjectedBundle.h"
+#include "InjectedBundlePage.h"
 #include "JSEventSendingController.h"
+#include <WebKit2/WKBundlePage.h>
+#include <WebKit2/WKBundlePagePrivate.h>
 #include <WebKit2/WKBundlePrivate.h>
 
 namespace WTR {
 
+static const float ZoomMultiplierRatio = 1.2f;
+
 PassRefPtr<EventSendingController> EventSendingController::create()
 {
     return adoptRef(new EventSendingController);
@@ -85,24 +90,32 @@ void EventSendingController::leapForward(JSContextRef context, size_t argumentCo
     setExceptionForString(context, exception, "EventSender.leapForward is not yet supported.");
 }
 
-void EventSendingController::textZoomIn(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+void EventSendingController::textZoomIn()
 {
-    setExceptionForString(context, exception, "EventSender.textZoomIn is not yet supported.");
+    WKBundlePageSetZoomMode(InjectedBundle::shared().page()->page(), kWKBundlePageZoomModeTextOnly);
+    float zoomFactor = WKBundlePageGetZoomFactor(InjectedBundle::shared().page()->page());
+    WKBundlePageSetZoomFactor(InjectedBundle::shared().page()->page(), zoomFactor * ZoomMultiplierRatio);
 }
 
-void EventSendingController::textZoomOut(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+void EventSendingController::textZoomOut()
 {
-    setExceptionForString(context, exception, "EventSender.textZoomOut is not yet supported.");
+    WKBundlePageSetZoomMode(InjectedBundle::shared().page()->page(), kWKBundlePageZoomModeTextOnly);
+    float zoomFactor = WKBundlePageGetZoomFactor(InjectedBundle::shared().page()->page());
+    WKBundlePageSetZoomFactor(InjectedBundle::shared().page()->page(), zoomFactor / ZoomMultiplierRatio);
 }
 
-void EventSendingController::zoomPageIn(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+void EventSendingController::zoomPageIn()
 {
-    setExceptionForString(context, exception, "EventSender.zoomPageIn is not yet supported.");
+    WKBundlePageSetZoomMode(InjectedBundle::shared().page()->page(), kWKBundlePageZoomModePage);
+    float zoomFactor = WKBundlePageGetZoomFactor(InjectedBundle::shared().page()->page());
+    WKBundlePageSetZoomFactor(InjectedBundle::shared().page()->page(), zoomFactor * ZoomMultiplierRatio);
 }
 
-void EventSendingController::zoomPageOut(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+void EventSendingController::zoomPageOut()
 {
-    setExceptionForString(context, exception, "EventSender.zoomPageOut is not yet supported.");
+    WKBundlePageSetZoomMode(InjectedBundle::shared().page()->page(), kWKBundlePageZoomModePage);
+    float zoomFactor = WKBundlePageGetZoomFactor(InjectedBundle::shared().page()->page());
+    WKBundlePageSetZoomFactor(InjectedBundle::shared().page()->page(), zoomFactor / ZoomMultiplierRatio);
 }
 
 // Object Creation
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/EventSendingController.h b/WebKitTools/WebKitTestRunner/InjectedBundle/EventSendingController.h
index 17eefd7..400f60d 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/EventSendingController.h
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/EventSendingController.h
@@ -48,10 +48,11 @@ public:
     void contextClick(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
     void leapForward(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
 
-    void textZoomIn(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
-    void textZoomOut(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
-    void zoomPageIn(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
-    void zoomPageOut(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
+    // Zoom functions.
+    void textZoomIn();
+    void textZoomOut();
+    void zoomPageIn();
+    void zoomPageOut();
 
 private:
     EventSendingController();
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
index b862305..40a098e 100644
--- a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
@@ -150,6 +150,9 @@ InjectedBundlePage::~InjectedBundlePage()
 void InjectedBundlePage::reset()
 {
     WKBundlePageClearMainFrameName(m_page);
+
+    WKBundlePageSetZoomFactor(m_page, 1.0f);
+    WKBundlePageSetZoomMode(m_page, kWKBundlePageZoomModePage);
 }
 
 // Loader Client Callbacks

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list