Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2036)

Unified Diff: webkit/glue/dom_operations.cc

Issue 16216: Adds support for pauseAnimationAtTimeOnElementWithId and... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/glue/dom_operations.h ('k') | webkit/tools/layout_tests/test_lists/tests_fixable.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/dom_operations.cc
===================================================================
--- webkit/glue/dom_operations.cc (revision 7359)
+++ webkit/glue/dom_operations.cc (working copy)
@@ -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,51 @@
}
}
+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
« no previous file with comments | « webkit/glue/dom_operations.h ('k') | webkit/tools/layout_tests/test_lists/tests_fixable.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698