summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/page
diff options
context:
space:
mode:
authorYida Wang <yidaw@codeaurora.org>2012-08-23 12:51:00 -0400
committerSteve Kondik <shade@chemlab.org>2013-01-20 18:38:31 -0800
commit77ab7f788fa2de43390a0ddb447c94a191284e88 (patch)
treeaa2021d922d649581c1473ee21cb509e0eb236ea /Source/WebCore/page
parent70f026a42cf1bee061389fa6ce790ea1186f0703 (diff)
downloadexternal_webkit-77ab7f788fa2de43390a0ddb447c94a191284e88.zip
external_webkit-77ab7f788fa2de43390a0ddb447c94a191284e88.tar.gz
external_webkit-77ab7f788fa2de43390a0ddb447c94a191284e88.tar.bz2
Implement requestAnimationFrame
Cherry-pick from webkit-org branch on Code Aurora Forum: requestAnimationFrame doesn't throttle on Mac https://www.codeaurora.org/gitweb/quic/la/?p=platform/external/webkit.git;a=commit;h=d9dca741b4762c433ae18f7a1bc59a3a81861fc8 Timestamp parameter to requestAnimationFrame is busted in USE(REQUEST_ANIMATION_FRAME_TIMER) path https://www.codeaurora.org/gitweb/quic/la/?p=platform/external/webkit.git;a=commit;h=f0909a46fa167c84062c63caffef340a6054bc1e Rename webkitCancelRequestAnimationFrame to webkitCancelAnimationFrame to match spec change https://www.codeaurora.org/gitweb/quic/la/?p=platform/external/webkit.git;a=commit;h=cd5d11d662d638b3e4dfda33f23cda907f007f12 Remove partially implemented per-Element visibility checks from requestAnimationFrame logic https://www.codeaurora.org/gitweb/quic/la/?p=platform/external/webkit.git;a=commit;h=9fb90af3cebd0e595990cded0941d230cf77dcc1 (cherry picked from commit 47ff59a279eab9ae5dd1fd17ce7057431750a0b5) Change-Id: I7e77200006bb0c4cd4b4209082296c425bd207c1
Diffstat (limited to 'Source/WebCore/page')
-rw-r--r--Source/WebCore/page/Chrome.cpp2
-rw-r--r--Source/WebCore/page/ChromeClient.h2
-rw-r--r--Source/WebCore/page/DOMWindow.cpp8
-rw-r--r--Source/WebCore/page/DOMWindow.h5
-rw-r--r--Source/WebCore/page/DOMWindow.idl7
5 files changed, 14 insertions, 10 deletions
diff --git a/Source/WebCore/page/Chrome.cpp b/Source/WebCore/page/Chrome.cpp
index dce7d33..33491fb 100644
--- a/Source/WebCore/page/Chrome.cpp
+++ b/Source/WebCore/page/Chrome.cpp
@@ -474,7 +474,9 @@ void Chrome::setCursor(const Cursor& cursor)
#if ENABLE(REQUEST_ANIMATION_FRAME)
void Chrome::scheduleAnimation()
{
+#if !USE(REQUEST_ANIMATION_FRAME_TIMER)
m_client->scheduleAnimation();
+#endif
}
#endif
diff --git a/Source/WebCore/page/ChromeClient.h b/Source/WebCore/page/ChromeClient.h
index 0ec366b..e422610 100644
--- a/Source/WebCore/page/ChromeClient.h
+++ b/Source/WebCore/page/ChromeClient.h
@@ -153,7 +153,7 @@ namespace WebCore {
virtual PlatformPageClient platformPageClient() const = 0;
virtual void scrollbarsModeDidChange() const = 0;
virtual void setCursor(const Cursor&) = 0;
-#if ENABLE(REQUEST_ANIMATION_FRAME)
+#if ENABLE(REQUEST_ANIMATION_FRAME) && !USE(REQUEST_ANIMATION_FRAME_TIMER)
virtual void scheduleAnimation() = 0;
#endif
// End methods used by HostWindow.
diff --git a/Source/WebCore/page/DOMWindow.cpp b/Source/WebCore/page/DOMWindow.cpp
index c7f162a..177c498 100644
--- a/Source/WebCore/page/DOMWindow.cpp
+++ b/Source/WebCore/page/DOMWindow.cpp
@@ -1517,17 +1517,17 @@ void DOMWindow::clearInterval(int timeoutId)
}
#if ENABLE(REQUEST_ANIMATION_FRAME)
-int DOMWindow::webkitRequestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback> callback, Element* e)
+int DOMWindow::webkitRequestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback> callback)
{
if (Document* d = document())
- return d->webkitRequestAnimationFrame(callback, e);
+ return d->webkitRequestAnimationFrame(callback);
return 0;
}
-void DOMWindow::webkitCancelRequestAnimationFrame(int id)
+void DOMWindow::webkitCancelAnimationFrame(int id)
{
if (Document* d = document())
- d->webkitCancelRequestAnimationFrame(id);
+ d->webkitCancelAnimationFrame(id);
}
#endif
diff --git a/Source/WebCore/page/DOMWindow.h b/Source/WebCore/page/DOMWindow.h
index 14ae79c..21c0f98 100644
--- a/Source/WebCore/page/DOMWindow.h
+++ b/Source/WebCore/page/DOMWindow.h
@@ -249,8 +249,9 @@ namespace WebCore {
// WebKit animation extensions
#if ENABLE(REQUEST_ANIMATION_FRAME)
- int webkitRequestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback>, Element*);
- void webkitCancelRequestAnimationFrame(int id);
+ int webkitRequestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback>);
+ void webkitCancelAnimationFrame(int id);
+ void webkitCancelRequestAnimationFrame(int id) { webkitCancelAnimationFrame(id); }
#endif
// Events
diff --git a/Source/WebCore/page/DOMWindow.idl b/Source/WebCore/page/DOMWindow.idl
index cbdd702..827c525 100644
--- a/Source/WebCore/page/DOMWindow.idl
+++ b/Source/WebCore/page/DOMWindow.idl
@@ -235,9 +235,10 @@ module window {
void clearInterval(in long handle);
#if defined(ENABLE_REQUEST_ANIMATION_FRAME)
- // WebKit animation extensions
- long webkitRequestAnimationFrame(in [Callback] RequestAnimationFrameCallback callback, in Element element);
- void webkitCancelRequestAnimationFrame(in long id);
+ // WebKit animation extensions, being standardized in the WebPerf WG
+ long webkitRequestAnimationFrame(in [Callback] RequestAnimationFrameCallback callback);
+ void webkitCancelAnimationFrame(in long id);
+ void webkitCancelRequestAnimationFrame(in long id); // This is a deprecated alias for webkitCancelAnimationFrame(). Remove this when removing vendor prefix.
#endif
// Base64