summaryrefslogtreecommitdiffstats
path: root/webkit/glue/dom_operations.cc
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/dom_operations.cc
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/dom_operations.cc')
-rw-r--r--webkit/glue/dom_operations.cc48
1 files changed, 47 insertions, 1 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