[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Thu Apr 8 00:54:06 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 6b1c0e8211e5429a7edf660ca27ad96a68a5a86e
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jan 5 01:21:08 2010 +0000

    2010-01-04  Yaar Schnitman  <yaar at chromium.org>
    
            Reviewed by Darin Fisher.
    
            Adding WebAnimationController to chromium's WebKit API.
    
            https://bugs.webkit.org/show_bug.cgi?id=32870
    
            * WebKit.gyp:
            * public/WebAnimationController.h: Added.
            (WebKit::WebAnimationController::~WebAnimationController):
            * public/WebFrame.h:
            * src/WebAnimationControllerImpl.cpp: Added.
            (WebKit::WebAnimationControllerImpl::WebAnimationControllerImpl):
            (WebKit::WebAnimationControllerImpl::pauseAnimationAtTime):
            (WebKit::WebAnimationControllerImpl::pauseTransitionAtTime):
            (WebKit::WebAnimationControllerImpl::numberOfActiveAnimations):
            * src/WebAnimationControllerImpl.h: Added.
            (WebKit::WebAnimationControllerImpl::~WebAnimationControllerImpl):
            * src/WebFrameImpl.cpp:
            (WebKit::WebFrameImpl::animationController):
            (WebKit::WebFrameImpl::WebFrameImpl):
            * src/WebFrameImpl.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52775 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index c034f98..9ceb0a2 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,27 @@
+2010-01-04  Yaar Schnitman  <yaar at chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Adding WebAnimationController to chromium's WebKit API.
+
+        https://bugs.webkit.org/show_bug.cgi?id=32870
+
+        * WebKit.gyp:
+        * public/WebAnimationController.h: Added.
+        (WebKit::WebAnimationController::~WebAnimationController):
+        * public/WebFrame.h:
+        * src/WebAnimationControllerImpl.cpp: Added.
+        (WebKit::WebAnimationControllerImpl::WebAnimationControllerImpl):
+        (WebKit::WebAnimationControllerImpl::pauseAnimationAtTime):
+        (WebKit::WebAnimationControllerImpl::pauseTransitionAtTime):
+        (WebKit::WebAnimationControllerImpl::numberOfActiveAnimations):
+        * src/WebAnimationControllerImpl.h: Added.
+        (WebKit::WebAnimationControllerImpl::~WebAnimationControllerImpl):
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::animationController):
+        (WebKit::WebFrameImpl::WebFrameImpl):
+        * src/WebFrameImpl.h:
+
 2010-01-04  Jay Campan  <jcampan at google.com>
 
         Reviewed by Darin Fisher
diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp
index 44c40b9..3c84cb4 100644
--- a/WebKit/chromium/WebKit.gyp
+++ b/WebKit/chromium/WebKit.gyp
@@ -86,6 +86,7 @@
                 'public/WebAccessibilityCache.h',
                 'public/WebAccessibilityObject.h',
                 'public/WebAccessibilityRole.h',
+                'public/WebAnimationController.h',
                 'public/WebApplicationCacheHost.h',
                 'public/WebApplicationCacheHostClient.h',
                 'public/WebBindings.h',
@@ -248,6 +249,8 @@
                 'src/WebAccessibilityCacheImpl.cpp',
                 'src/WebAccessibilityCacheImpl.h',
                 'src/WebAccessibilityObject.cpp',
+                'src/WebAnimationControllerImpl.cpp',
+                'src/WebAnimationControllerImpl.h',
                 'src/WebBindings.cpp',
                 'src/WebCache.cpp',
                 'src/WebColor.cpp',
diff --git a/WebKit/chromium/public/WebAnimationController.h b/WebKit/chromium/public/WebAnimationController.h
new file mode 100644
index 0000000..d727d70
--- /dev/null
+++ b/WebKit/chromium/public/WebAnimationController.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebAnimationController_h
+#define WebAnimationController_h
+
+#include "WebCommon.h"
+
+namespace WebKit {
+
+class WebElement;
+class WebString;
+class WebURL;
+
+// WebAnimationController can be used to control animations in a frame. It is
+// owned by a WebFrame and its life span is bound to that WebFrame.
+class WebAnimationController {
+public:
+    WEBKIT_API virtual bool pauseAnimationAtTime(WebElement&,
+                                                 const WebString& animationName,
+                                                 double time) = 0;
+    WEBKIT_API virtual bool pauseTransitionAtTime(WebElement&,
+                                                  const WebString& propertyName,
+                                                  double time) = 0;
+
+    WEBKIT_API virtual unsigned numberOfActiveAnimations() const = 0;
+protected:
+    ~WebAnimationController() { }
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebFrame.h b/WebKit/chromium/public/WebFrame.h
index 2601598..da92581 100644
--- a/WebKit/chromium/public/WebFrame.h
+++ b/WebKit/chromium/public/WebFrame.h
@@ -45,6 +45,7 @@ template <class T> class Local;
 
 namespace WebKit {
 
+class WebAnimationController;
 class WebData;
 class WebDataSource;
 class WebDocument;
@@ -176,6 +177,8 @@ public:
 
     virtual void forms(WebVector<WebFormElement>&) const = 0;
 
+    virtual WebAnimationController* animationController() = 0;
+
     // Scripting ----------------------------------------------------------
 
     // Returns the security origin of the current document.
diff --git a/WebKit/chromium/src/WebAnimationControllerImpl.cpp b/WebKit/chromium/src/WebAnimationControllerImpl.cpp
new file mode 100644
index 0000000..32a7a61
--- /dev/null
+++ b/WebKit/chromium/src/WebAnimationControllerImpl.cpp
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebAnimationControllerImpl.h"
+
+#include "AnimationController.h"
+#include "Element.h"
+
+#include "WebElement.h"
+#include "WebFrameImpl.h"
+#include "WebString.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+WebAnimationControllerImpl::WebAnimationControllerImpl(WebFrameImpl* frameImpl)
+    : m_frameImpl(frameImpl)
+{
+    ASSERT(m_frameImpl);
+}
+
+AnimationController* WebAnimationControllerImpl::animationController() const
+{
+    if (!m_frameImpl->frame())
+        return 0;
+    return m_frameImpl->frame()->animation();
+}
+
+bool WebAnimationControllerImpl::pauseAnimationAtTime(WebElement& element,
+                                                      const WebString& animationName,
+                                                      double time)
+{
+    AnimationController* controller = animationController();
+    if (!controller)
+        return 0;
+    return controller->pauseAnimationAtTime(PassRefPtr<Element>(element)->renderer(),
+                                            animationName,
+                                            time);
+}
+
+bool WebAnimationControllerImpl::pauseTransitionAtTime(WebElement& element,
+                                                       const WebString& propertyName,
+                                                       double time)
+{
+    AnimationController* controller = animationController();
+    if (!controller)
+        return 0;
+    return controller->pauseTransitionAtTime(PassRefPtr<Element>(element)->renderer(),
+                                             propertyName,
+                                             time);
+}
+
+unsigned WebAnimationControllerImpl::numberOfActiveAnimations() const
+{
+    AnimationController* controller = animationController();
+    if (!controller)
+        return 0;
+    return controller->numberOfActiveAnimations();
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/WebAnimationControllerImpl.h b/WebKit/chromium/src/WebAnimationControllerImpl.h
new file mode 100644
index 0000000..66dfe98
--- /dev/null
+++ b/WebKit/chromium/src/WebAnimationControllerImpl.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebAnimationControllerImpl_h
+#define WebAnimationControllerImpl_h
+
+#include "WebAnimationController.h"
+
+namespace WebCore {
+class AnimationController;
+}
+
+namespace WebKit {
+class WebFrameImpl;
+
+class WebAnimationControllerImpl : public WebAnimationController {
+public:
+    explicit WebAnimationControllerImpl(WebFrameImpl*);
+    virtual ~WebAnimationControllerImpl() { }
+
+    virtual bool pauseAnimationAtTime(WebElement&,
+                                      const WebString& animationName,
+                                      double time);
+    virtual bool pauseTransitionAtTime(WebElement&,
+                                       const WebString& propertyName,
+                                       double time);
+    virtual unsigned numberOfActiveAnimations() const;
+private:
+    WebFrameImpl* m_frameImpl;
+    WebCore::AnimationController* animationController() const;
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp
index 241cfe8..29d21d6 100644
--- a/WebKit/chromium/src/WebFrameImpl.cpp
+++ b/WebKit/chromium/src/WebFrameImpl.cpp
@@ -120,6 +120,7 @@
 #include "SubstituteData.h"
 #include "TextAffinity.h"
 #include "TextIterator.h"
+#include "WebAnimationControllerImpl.h"
 #include "WebConsoleMessage.h"
 #include "WebDataSourceImpl.h"
 #include "WebDocument.h"
@@ -552,6 +553,11 @@ void WebFrameImpl::forms(WebVector<WebFormElement>& results) const
     results.swap(temp);
 }
 
+WebAnimationController* WebFrameImpl::animationController()
+{
+    return &m_animationController;
+}
+
 WebSecurityOrigin WebFrameImpl::securityOrigin() const
 {
     if (!m_frame || !m_frame->document())
@@ -1482,6 +1488,7 @@ WebFrameImpl::WebFrameImpl(WebFrameClient* client)
     , m_framesScopingCount(-1)
     , m_scopingComplete(false)
     , m_nextInvalidateAfter(0)
+    , m_animationController(this)
 {
     ChromiumBridge::incrementStatsCounter(webFrameActiveCount);
     m_liveObjectCount++;
diff --git a/WebKit/chromium/src/WebFrameImpl.h b/WebKit/chromium/src/WebFrameImpl.h
index fbd0e2e..d42f961 100644
--- a/WebKit/chromium/src/WebFrameImpl.h
+++ b/WebKit/chromium/src/WebFrameImpl.h
@@ -39,6 +39,8 @@
 #include <wtf/OwnPtr.h>
 #include <wtf/RefCounted.h>
 
+#include "WebAnimationControllerImpl.h"
+
 namespace WebCore {
 class HistoryItem;
 class KURL;
@@ -85,6 +87,7 @@ public:
     virtual WebFrame* findChildByExpression(const WebString&) const;
     virtual WebDocument document() const;
     virtual void forms(WebVector<WebFormElement>&) const;
+    virtual WebAnimationController* animationController(); 
     virtual WebSecurityOrigin securityOrigin() const;
     virtual void grantUniversalAccess();
     virtual NPObject* windowObject() const;
@@ -348,6 +351,9 @@ private:
     typedef HashMap<RefPtr<WebCore::HTMLInputElement>,
                     WebPasswordAutocompleteListener*> PasswordListenerMap;
     PasswordListenerMap m_passwordListeners;
+
+    // Keeps a reference to the frame's WebAnimationController.
+    WebAnimationControllerImpl m_animationController;
 };
 
 } // namespace WebKit

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list