summaryrefslogtreecommitdiffstats
path: root/webkit/glue
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/glue')
-rw-r--r--webkit/glue/dom_operations.cc13
-rw-r--r--webkit/glue/dom_operations.h2
2 files changed, 15 insertions, 0 deletions
diff --git a/webkit/glue/dom_operations.cc b/webkit/glue/dom_operations.cc
index 6fc79b9..d972263 100644
--- a/webkit/glue/dom_operations.cc
+++ b/webkit/glue/dom_operations.cc
@@ -860,4 +860,17 @@ bool ElementDoesAutoCompleteForElementWithId(WebView* view,
return input_element->autoComplete();
}
+int NumberOfActiveAnimations(WebView* view) {
+ WebFrame* web_frame = view->GetMainFrame();
+ if (!web_frame)
+ return -1;
+
+ WebCore::Frame* frame = static_cast<WebFrameImpl*>(web_frame)->frame();
+ WebCore::AnimationController* controller = frame->animation();
+ if (!controller)
+ return -1;
+
+ return controller->numberOfActiveAnimations();
+}
+
} // webkit_glue
diff --git a/webkit/glue/dom_operations.h b/webkit/glue/dom_operations.h
index 9c88e86..61af34e 100644
--- a/webkit/glue/dom_operations.h
+++ b/webkit/glue/dom_operations.h
@@ -192,6 +192,8 @@ bool PauseTransitionAtTimeOnElementWithId(WebView* view,
bool ElementDoesAutoCompleteForElementWithId(WebView* view,
const std::string& element_id);
+// Returns the number of animations currently running.
+int NumberOfActiveAnimations(WebView* view);
} // namespace webkit_glue