summaryrefslogtreecommitdiffstats
path: root/webkit/glue
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-22 22:08:40 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-22 22:08:40 +0000
commitaf91a57c0203abee45565f47b5d9086e42acafba (patch)
tree7cc4db4b0eec56b116d2e4e43cb98e629967cd2a /webkit/glue
parentfa2738d71ffcd2c451ecbb27fa35af8534d5482c (diff)
downloadchromium_src-af91a57c0203abee45565f47b5d9086e42acafba.zip
chromium_src-af91a57c0203abee45565f47b5d9086e42acafba.tar.gz
chromium_src-af91a57c0203abee45565f47b5d9086e42acafba.tar.bz2
Adds support for pauseAnimationAtTimeOnElementWithId and
pauseTransitionAtTimeOnElementWithId to layout test controller so that we can pass a couple of additional tests. BUG=5801 TEST=none Review URL: http://codereview.chromium.org/16216 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7379 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r--webkit/glue/dom_operations.cc48
-rw-r--r--webkit/glue/dom_operations.h17
2 files changed, 63 insertions, 2 deletions
diff --git a/webkit/glue/dom_operations.cc b/webkit/glue/dom_operations.cc
index a488573..da1a961 100644
--- a/webkit/glue/dom_operations.cc
+++ b/webkit/glue/dom_operations.cc
@@ -7,6 +7,7 @@
#include "base/compiler_specific.h"
MSVC_PUSH_WARNING_LEVEL(0);
+#include "AnimationController.h"
#include "FrameLoader.h"
#include "FrameTree.h"
#include "Document.h"
@@ -794,5 +795,50 @@ void GetApplicationInfo(WebView* view, WebApplicationInfo* app_info) {
}
}
-} // webkit_glue
+bool PauseAnimationAtTimeOnElementWithId(WebView* view,
+ const std::string& animation_name,
+ double time,
+ const std::string& element_id) {
+ WebFrame* web_frame = view->GetMainFrame();
+ if (!web_frame)
+ return false;
+ WebCore::Frame* frame = static_cast<WebFrameImpl*>(web_frame)->frame();
+ WebCore::AnimationController* controller = frame->animation();
+ if (!controller)
+ return false;
+
+ WebCore::Element* element =
+ frame->document()->getElementById(StdStringToString(element_id));
+ if (!element)
+ return false;
+
+ return controller->pauseAnimationAtTime(element->renderer(),
+ StdStringToString(animation_name),
+ time);
+}
+
+bool PauseTransitionAtTimeOnElementWithId(WebView* view,
+ const std::string& property_name,
+ double time,
+ const std::string& element_id) {
+ WebFrame* web_frame = view->GetMainFrame();
+ if (!web_frame)
+ return false;
+
+ WebCore::Frame* frame = static_cast<WebFrameImpl*>(web_frame)->frame();
+ WebCore::AnimationController* controller = frame->animation();
+ if (!controller)
+ return false;
+
+ WebCore::Element* element =
+ frame->document()->getElementById(StdStringToString(element_id));
+ if (!element)
+ return false;
+
+ return controller->pauseTransitionAtTime(element->renderer(),
+ StdStringToString(property_name),
+ time);
+}
+
+} // webkit_glue
diff --git a/webkit/glue/dom_operations.h b/webkit/glue/dom_operations.h
index 20d5585..d1512c1 100644
--- a/webkit/glue/dom_operations.h
+++ b/webkit/glue/dom_operations.h
@@ -171,7 +171,22 @@ bool ParseIconSizes(const std::wstring& text,
// WebApplicationInfo for details as to where each field comes from.
void GetApplicationInfo(WebView* view, WebApplicationInfo* app_info);
+// Invokes pauseAnimationAtTime on the AnimationController associated with the
+// |view|s main frame.
+// This is used by test shell.
+bool PauseAnimationAtTimeOnElementWithId(WebView* view,
+ const std::string& animation_name,
+ double time,
+ const std::string& element_id);
+
+// Invokes pauseTransitionAtTime on the AnimationController associated with the
+// |view|s main frame.
+// This is used by test shell.
+bool PauseTransitionAtTimeOnElementWithId(WebView* view,
+ const std::string& property_name,
+ double time,
+ const std::string& element_id);
+
} // namespace webkit_glue
#endif // WEBKIT_GLUE_DOM_OPERATIONS_H__
-