[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
cmarrin at apple.com
cmarrin at apple.com
Wed Dec 22 11:54:02 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 9843c7d553b92216444da6b927e67af293e91a18
Author: cmarrin at apple.com <cmarrin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Aug 11 01:03:58 2010 +0000
2010-08-10 Chris Marrin <cmarrin at apple.com>
Reviewed by Oliver Hunt.
Add suspendAnimations/resumeAnimation API to DRT
https://bugs.webkit.org/show_bug.cgi?id=43733
Qt specific API. Missing symbian symbol defines in:
WebKit/qt/symbian/bwins/QtWebKitu.def
WebKit/qt/symbian/eabi/QtWebKitu.def
* WebCoreSupport/DumpRenderTreeSupportQt.cpp:
(DumpRenderTreeSupportQt::suspendAnimations):
(DumpRenderTreeSupportQt::resumeAnimations):
* WebCoreSupport/DumpRenderTreeSupportQt.h:
2010-08-10 Chris Marrin <cmarrin at apple.com>
Reviewed by Oliver Hunt.
Add suspendAnimations/resumeAnimation API to DRT
https://bugs.webkit.org/show_bug.cgi?id=43733
Gtk specific API.
* webkit/webkitprivate.h:
* webkit/webkitwebframe.cpp:
(webkit_web_frame_suspend_animations):
(webkit_web_frame_resume_animations):
2010-08-10 Chris Marrin <cmarrin at apple.com>
Reviewed by Oliver Hunt.
Add suspendAnimations/resumeAnimation API to DRT
https://bugs.webkit.org/show_bug.cgi?id=43733
Win specific API
* Interfaces/IWebFramePrivate.idl:
* WebFrame.cpp:
(WebFrame::suspendAnimations):
(WebFrame::resumeAnimations):
* WebFrame.h:
2010-08-10 Chris Marrin <cmarrin at apple.com>
Reviewed by Oliver Hunt.
Add suspendAnimations/resumeAnimation API to DRT
https://bugs.webkit.org/show_bug.cgi?id=43733
Mac specific API. Plumbs suspendAnimations/resumeAnimations down to WebCore.
* WebView/WebFrame.mm:
(-[WebFrame _suspendAnimations]):
(-[WebFrame _resumeAnimations]):
* WebView/WebFramePrivate.h:
2010-08-10 Chris Marrin <cmarrin at apple.com>
Reviewed by Oliver Hunt.
Add suspendAnimations/resumeAnimation API to DRT
https://bugs.webkit.org/show_bug.cgi?id=43733
This tests suspend and resume of animations. Transitions are currently broken
due to https://bugs.webkit.org/show_bug.cgi?id=43792. I will add transition
tests and tests of transition and animation interaction with that fix.
* animations/animation-test-helpers.js:
(matrixStringToArray):
* animations/suspend-resume-animation-expected.txt: Added.
* animations/suspend-resume-animation.html: Added.
2010-08-10 Chris Marrin <cmarrin at apple.com>
Reviewed by Oliver Hunt.
Add suspendAnimations/resumeAnimation API to DRT
https://bugs.webkit.org/show_bug.cgi?id=43733
Adds suspendAnimations() and resumeAnimations() to LayoutTestController.
Calls functions with the same names on AnimationController for the
mainFrame.
* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
* DumpRenderTree/LayoutTestController.cpp:
(suspendAnimationsCallback):
(resumeAnimationsCallback):
(LayoutTestController::staticFunctions):
* DumpRenderTree/LayoutTestController.h:
* DumpRenderTree/chromium/LayoutTestController.cpp:
(LayoutTestController::LayoutTestController):
(LayoutTestController::suspendAnimations):
(LayoutTestController::resumeAnimations):
* DumpRenderTree/chromium/LayoutTestController.h:
* DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
(LayoutTestController::suspendAnimations):
(LayoutTestController::resumeAnimations):
* DumpRenderTree/mac/LayoutTestControllerMac.mm:
(LayoutTestController::suspendAnimations):
(LayoutTestController::resumeAnimations):
* DumpRenderTree/qt/LayoutTestControllerQt.cpp:
(LayoutTestController::suspendAnimations):
(LayoutTestController::resumeAnimations):
* DumpRenderTree/qt/LayoutTestControllerQt.h:
* DumpRenderTree/win/LayoutTestControllerWin.cpp:
(LayoutTestController::suspendAnimations):
(LayoutTestController::resumeAnimations):
* DumpRenderTree/wx/LayoutTestControllerWx.cpp:
(LayoutTestController::suspendAnimations):
(LayoutTestController::resumeAnimations):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65107 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index b42f223..5c8c2fb 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,19 @@
+2010-08-10 Chris Marrin <cmarrin at apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Add suspendAnimations/resumeAnimation API to DRT
+ https://bugs.webkit.org/show_bug.cgi?id=43733
+
+ This tests suspend and resume of animations. Transitions are currently broken
+ due to https://bugs.webkit.org/show_bug.cgi?id=43792. I will add transition
+ tests and tests of transition and animation interaction with that fix.
+
+ * animations/animation-test-helpers.js:
+ (matrixStringToArray):
+ * animations/suspend-resume-animation-expected.txt: Added.
+ * animations/suspend-resume-animation.html: Added.
+
2010-08-10 Stephen White <senorblanco at chromium.org>
Unreviewed; test expectations fix.
diff --git a/LayoutTests/animations/animation-test-helpers.js b/LayoutTests/animations/animation-test-helpers.js
index ab606aa..2a68ef8 100644
--- a/LayoutTests/animations/animation-test-helpers.js
+++ b/LayoutTests/animations/animation-test-helpers.js
@@ -38,6 +38,8 @@ function isCloseEnough(actual, desired, tolerance)
function matrixStringToArray(s)
{
+ if (s == "none")
+ return [ 1, 0, 0, 1, 0, 0 ];
var m = s.split("(");
m = m[1].split(")");
return m[0].split(",");
diff --git a/LayoutTests/animations/suspend-resume-animation-expected.txt b/LayoutTests/animations/suspend-resume-animation-expected.txt
new file mode 100644
index 0000000..b44151e
--- /dev/null
+++ b/LayoutTests/animations/suspend-resume-animation-expected.txt
@@ -0,0 +1,6 @@
+This test shows suspend and resume of a box moving to the right 500px. If running inside DumpRenderTest the box should stop at 200px after 500ms and then continue to complete the move in another 750ms
+
+PASS - "webkitTransform" property for "box" element at 0.6s saw something close to: 1,0,0,1,200,0
+PASS - "webkitTransform" property for "box" element at 0.9s saw something close to: 1,0,0,1,200,0
+PASS - "webkitTransform" property for "box" element at 1.5s saw something close to: 1,0,0,1,400,0
+
diff --git a/LayoutTests/animations/suspend-resume-animation.html b/LayoutTests/animations/suspend-resume-animation.html
new file mode 100644
index 0000000..cdfa0f9
--- /dev/null
+++ b/LayoutTests/animations/suspend-resume-animation.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <title>Test suspendAnimations()/resumeAnimations() for animations</title>
+ <style type="text/css" media="screen">
+ #box {
+ height: 100px;
+ width: 100px;
+ background-color: blue;
+ -webkit-animation-duration: 1.25s;
+ -webkit-animation-timing-function: linear;
+ -webkit-animation-name: "move";
+ }
+ @-webkit-keyframes "move" {
+ from { -webkit-transform: translateX(0); }
+ to { -webkit-transform: translateX(500px); }
+ }
+ </style>
+ <script src="animation-test-helpers.js" type="text/javascript" charset="utf-8"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ const expectedValues = [
+ // [animation-name, time, element-id, property, expected-value, tolerance]
+ ["rotate", 0.6, "box", "webkitTransform", [1,0,0,1, 200, 0], 30],
+ ["rotate", 0.9, "box", "webkitTransform", [1,0,0,1, 200, 0], 30],
+ ["rotate", 1.5, "box", "webkitTransform", [1,0,0,1, 400, 0], 30],
+ ];
+
+ function suspend()
+ {
+ if (window.layoutTestController)
+ layoutTestController.suspendAnimations();
+ }
+
+ function resume()
+ {
+ if (window.layoutTestController)
+ layoutTestController.resumeAnimations();
+ }
+
+ function setTimers()
+ {
+ setTimeout(suspend, 500);
+ setTimeout(resume, 1000);
+ }
+
+ runAnimationTest(expectedValues, setTimers, undefined, true);
+
+ </script>
+</head>
+<body>
+<p>
+This test shows suspend and resume of a box moving to the right 500px. If running inside DumpRenderTest the box should stop at 200px
+after 500ms and then continue to complete the move in another 750ms
+<div id="box">
+</div>
+<div id="result">
+</div>
+</body>
+</html>
diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index 1d9e0de..4cde462 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,3 +1,17 @@
+2010-08-10 Chris Marrin <cmarrin at apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Add suspendAnimations/resumeAnimation API to DRT
+ https://bugs.webkit.org/show_bug.cgi?id=43733
+
+ Gtk specific API.
+
+ * webkit/webkitprivate.h:
+ * webkit/webkitwebframe.cpp:
+ (webkit_web_frame_suspend_animations):
+ (webkit_web_frame_resume_animations):
+
2010-08-10 Gavin Barraclough <barraclough at apple.com>
Rubber stamped by Sam Weinig.
diff --git a/WebKit/gtk/webkit/webkitprivate.h b/WebKit/gtk/webkit/webkitprivate.h
index aa19bec..a6e0072 100644
--- a/WebKit/gtk/webkit/webkitprivate.h
+++ b/WebKit/gtk/webkit/webkitprivate.h
@@ -347,6 +347,12 @@ extern "C" {
webkit_web_frame_number_of_active_animations(WebKitWebFrame* frame);
WEBKIT_API void
+ webkit_web_frame_suspend_animations(WebKitWebFrame* frame);
+
+ WEBKIT_API void
+ webkit_web_frame_resume_animations(WebKitWebFrame* frame);
+
+ WEBKIT_API void
webkit_web_frame_clear_main_frame_name(WebKitWebFrame* frame);
WEBKIT_API AtkObject*
diff --git a/WebKit/gtk/webkit/webkitwebframe.cpp b/WebKit/gtk/webkit/webkitwebframe.cpp
index 5e82d57..88f0bb7 100644
--- a/WebKit/gtk/webkit/webkitwebframe.cpp
+++ b/WebKit/gtk/webkit/webkitwebframe.cpp
@@ -1053,6 +1053,32 @@ unsigned int webkit_web_frame_number_of_active_animations(WebKitWebFrame* frame)
return controller->numberOfActiveAnimations();
}
+void webkit_web_frame_suspend_animations(WebKitWebFrame* frame)
+{
+ Frame* coreFrame = core(frame);
+ if (!coreFrame)
+ return;
+
+ AnimationController* controller = coreFrame->animation();
+ if (!controller)
+ return;
+
+ controller->suspendAnimations(coreFrame->document());
+}
+
+void webkit_web_frame_resume_animations(WebKitWebFrame* frame)
+{
+ Frame* coreFrame = core(frame);
+ if (!coreFrame)
+ return;
+
+ AnimationController* controller = coreFrame->animation();
+ if (!controller)
+ return;
+
+ controller->resumeAnimations(coreFrame->document());
+}
+
gchar* webkit_web_frame_get_response_mime_type(WebKitWebFrame* frame)
{
Frame* coreFrame = core(frame);
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index 5f867ce..1f4a767 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,17 @@
+2010-08-10 Chris Marrin <cmarrin at apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Add suspendAnimations/resumeAnimation API to DRT
+ https://bugs.webkit.org/show_bug.cgi?id=43733
+
+ Mac specific API. Plumbs suspendAnimations/resumeAnimations down to WebCore.
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _suspendAnimations]):
+ (-[WebFrame _resumeAnimations]):
+ * WebView/WebFramePrivate.h:
+
2010-08-10 Gavin Barraclough <barraclough at apple.com>
Rubber stamped by Sam Weinig
diff --git a/WebKit/mac/WebView/WebFrame.mm b/WebKit/mac/WebView/WebFrame.mm
index b71d501..82df7bc 100644
--- a/WebKit/mac/WebView/WebFrame.mm
+++ b/WebKit/mac/WebView/WebFrame.mm
@@ -1193,6 +1193,32 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
return controller->numberOfActiveAnimations();
}
+- (void) _suspendAnimations
+{
+ Frame* frame = core(self);
+ if (!frame)
+ return;
+
+ AnimationController* controller = frame->animation();
+ if (!controller)
+ return;
+
+ controller->suspendAnimations(frame->document());
+}
+
+- (void) _resumeAnimations
+{
+ Frame* frame = core(self);
+ if (!frame)
+ return;
+
+ AnimationController* controller = frame->animation();
+ if (!controller)
+ return;
+
+ controller->resumeAnimations(frame->document());
+}
+
- (void)_replaceSelectionWithFragment:(DOMDocumentFragment *)fragment selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace matchStyle:(BOOL)matchStyle
{
if (_private->coreFrame->selection()->isNone() || !fragment)
diff --git a/WebKit/mac/WebView/WebFramePrivate.h b/WebKit/mac/WebView/WebFramePrivate.h
index 0bda966..3556ad8 100644
--- a/WebKit/mac/WebView/WebFramePrivate.h
+++ b/WebKit/mac/WebView/WebFramePrivate.h
@@ -113,6 +113,10 @@ typedef enum {
// Returns the total number of currently running animations (includes both CSS transitions and CSS animations).
- (unsigned) _numberOfActiveAnimations;
+// Suspend and resume animations (includes both CSS transitions and CSS animations).
+- (void) _suspendAnimations;
+- (void) _resumeAnimations;
+
- (void)_replaceSelectionWithFragment:(DOMDocumentFragment *)fragment selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace matchStyle:(BOOL)matchStyle;
- (void)_replaceSelectionWithText:(NSString *)text selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace;
- (void)_replaceSelectionWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace;
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index 4f2845f..4167bb1 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,20 @@
+2010-08-10 Chris Marrin <cmarrin at apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Add suspendAnimations/resumeAnimation API to DRT
+ https://bugs.webkit.org/show_bug.cgi?id=43733
+
+ Qt specific API. Missing symbian symbol defines in:
+
+ WebKit/qt/symbian/bwins/QtWebKitu.def
+ WebKit/qt/symbian/eabi/QtWebKitu.def
+
+ * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+ (DumpRenderTreeSupportQt::suspendAnimations):
+ (DumpRenderTreeSupportQt::resumeAnimations):
+ * WebCoreSupport/DumpRenderTreeSupportQt.h:
+
2010-08-06 Gavin Barraclough <barraclough at apple.com>
Rubber stamped by Sam Weinig
diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
index ddc9d7a..b6c3d51 100644
--- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
+++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
@@ -262,6 +262,32 @@ int DumpRenderTreeSupportQt::numberOfActiveAnimations(QWebFrame *frame)
return controller->numberOfActiveAnimations();
}
+void DumpRenderTreeSupportQt::suspendAnimations(QWebFrame *frame)
+{
+ Frame* coreFrame = QWebFramePrivate::core(frame);
+ if (!coreFrame)
+ return;
+
+ AnimationController* controller = coreFrame->animation();
+ if (!controller)
+ return;
+
+ controller->suspendAnimations(coreFrame->document());
+}
+
+void DumpRenderTreeSupportQt::resumeAnimations(QWebFrame *frame)
+{
+ Frame* coreFrame = QWebFramePrivate::core(frame);
+ if (!coreFrame)
+ return;
+
+ AnimationController* controller = coreFrame->animation();
+ if (!controller)
+ return;
+
+ controller->resumeAnimations(coreFrame->document());
+}
+
void DumpRenderTreeSupportQt::clearFrameName(QWebFrame* frame)
{
Frame* coreFrame = QWebFramePrivate::core(frame);
diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
index 3a92158..2069114 100644
--- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
+++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
@@ -79,6 +79,8 @@ public:
static void clearFrameName(QWebFrame* frame);
static void overwritePluginDirectories();
static int numberOfActiveAnimations(QWebFrame*);
+ static void suspendAnimations(QWebFrame*);
+ static void resumeAnimations(QWebFrame*);
static int numberOfPages(QWebFrame* frame, float width, float height);
static int pageNumberForElementById(QWebFrame* frame, const QString& id, float width, float height);
static bool hasDocumentElement(QWebFrame* frame);
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index acfeab7..9ceed26 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,18 @@
+2010-08-10 Chris Marrin <cmarrin at apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Add suspendAnimations/resumeAnimation API to DRT
+ https://bugs.webkit.org/show_bug.cgi?id=43733
+
+ Win specific API
+
+ * Interfaces/IWebFramePrivate.idl:
+ * WebFrame.cpp:
+ (WebFrame::suspendAnimations):
+ (WebFrame::resumeAnimations):
+ * WebFrame.h:
+
2010-08-06 Gavin Barraclough <barraclough at apple.com>
Rubber stamped by Sam Weinig
diff --git a/WebKit/win/Interfaces/IWebFramePrivate.idl b/WebKit/win/Interfaces/IWebFramePrivate.idl
index b04edfe..cf25204 100644
--- a/WebKit/win/Interfaces/IWebFramePrivate.idl
+++ b/WebKit/win/Interfaces/IWebFramePrivate.idl
@@ -90,6 +90,8 @@ interface IWebFramePrivate : IUnknown
HRESULT pauseAnimation([in] BSTR animationName, [in] IDOMNode* node, [in] double secondsFromNow, [out, retval] BOOL* animationWasRunning);
HRESULT pauseTransition([in] BSTR propertyName, [in] IDOMNode* node, [in] double secondsFromNow, [out, retval] BOOL* transitionWasRunning);
HRESULT numberOfActiveAnimations([out, retval] UINT* number);
+ HRESULT suspendAnimations();
+ HRESULT resumeAnimations();
HRESULT isDisplayingStandaloneImage([out, retval] BOOL* result);
diff --git a/WebKit/win/WebFrame.cpp b/WebKit/win/WebFrame.cpp
index f07821f..f68d373 100644
--- a/WebKit/win/WebFrame.cpp
+++ b/WebKit/win/WebFrame.cpp
@@ -1297,6 +1297,34 @@ HRESULT WebFrame::numberOfActiveAnimations(UINT* number)
return S_OK;
}
+HRESULT WebFrame::suspendAnimations()
+{
+ Frame* frame = core(this);
+ if (!frame)
+ return;
+
+ AnimationController* controller = frame->animation();
+ if (!controller)
+ return;
+
+ controller->suspendAnimations();
+ return S_OK;
+}
+
+HRESULT WebFrame::resumeAnimations()
+{
+ Frame* frame = core(this);
+ if (!frame)
+ return;
+
+ AnimationController* controller = frame->animation();
+ if (!controller)
+ return;
+
+ controller->resumeAnimations();
+ return S_OK;
+}
+
HRESULT WebFrame::isDisplayingStandaloneImage(BOOL* result)
{
if (!result)
diff --git a/WebKit/win/WebFrame.h b/WebKit/win/WebFrame.h
index 6f8b56a..24a7e2b 100644
--- a/WebKit/win/WebFrame.h
+++ b/WebKit/win/WebFrame.h
@@ -258,6 +258,8 @@ public:
virtual HRESULT STDMETHODCALLTYPE pauseTransition(BSTR propertyName, IDOMNode*, double secondsFromNow, BOOL* transitionWasRunning);
virtual HRESULT STDMETHODCALLTYPE pauseSVGAnimation(BSTR elementId, IDOMNode*, double secondsFromNow, BOOL* animationWasRunning);
virtual HRESULT STDMETHODCALLTYPE numberOfActiveAnimations(UINT*);
+ virtual HRESULT STDMETHODCALLTYPE suspendAnimations();
+ virtual HRESULT STDMETHODCALLTYPE resumeAnimations();
virtual HRESULT STDMETHODCALLTYPE isDisplayingStandaloneImage(BOOL*);
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 3bf303f..908bdb7 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,42 @@
+2010-08-10 Chris Marrin <cmarrin at apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Add suspendAnimations/resumeAnimation API to DRT
+ https://bugs.webkit.org/show_bug.cgi?id=43733
+
+ Adds suspendAnimations() and resumeAnimations() to LayoutTestController.
+ Calls functions with the same names on AnimationController for the
+ mainFrame.
+
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+ * DumpRenderTree/LayoutTestController.cpp:
+ (suspendAnimationsCallback):
+ (resumeAnimationsCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::suspendAnimations):
+ (LayoutTestController::resumeAnimations):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::suspendAnimations):
+ (LayoutTestController::resumeAnimations):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::suspendAnimations):
+ (LayoutTestController::resumeAnimations):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::suspendAnimations):
+ (LayoutTestController::resumeAnimations):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::suspendAnimations):
+ (LayoutTestController::resumeAnimations):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::suspendAnimations):
+ (LayoutTestController::resumeAnimations):
+
2010-08-10 Dimitri Glazkov <dglazkov at chromium.org>
Reviewed by Ojan Vafai.
diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/LayoutTestController.cpp
index 52b539c..700b44c 100644
--- a/WebKitTools/DumpRenderTree/LayoutTestController.cpp
+++ b/WebKitTools/DumpRenderTree/LayoutTestController.cpp
@@ -1545,6 +1545,20 @@ static JSValueRef numberOfActiveAnimationsCallback(JSContextRef context, JSObjec
return JSValueMakeNumber(context, controller->numberOfActiveAnimations());
}
+static JSValueRef suspendAnimationsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->suspendAnimations();
+ return JSValueMakeUndefined(context);
+}
+
+static JSValueRef resumeAnimationsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->resumeAnimations();
+ return JSValueMakeUndefined(context);
+}
+
static JSValueRef waitForPolicyDelegateCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t, const JSValueRef[], JSValueRef*)
{
LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
@@ -1850,6 +1864,8 @@ JSStaticFunction* LayoutTestController::staticFunctions()
{ "markerTextForListItem", markerTextForListItemCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "notifyDone", notifyDoneCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "numberOfActiveAnimations", numberOfActiveAnimationsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "suspendAnimations", suspendAnimationsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "resumeAnimations", resumeAnimationsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "overridePreference", overridePreferenceCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "pageNumberForElementById", pageNumberForElementByIdCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "pageSizeAndMarginsInPixels", pageSizeAndMarginsInPixelsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.h b/WebKitTools/DumpRenderTree/LayoutTestController.h
index f76870b..2bab542 100644
--- a/WebKitTools/DumpRenderTree/LayoutTestController.h
+++ b/WebKitTools/DumpRenderTree/LayoutTestController.h
@@ -251,6 +251,8 @@ public:
bool pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId);
bool sampleSVGAnimationForElementAtTime(JSStringRef animationId, double time, JSStringRef elementId);
unsigned numberOfActiveAnimations() const;
+ void suspendAnimations() const;
+ void resumeAnimations() const;
void addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains);
void removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains);
diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
index e82a65e..eda0601 100644
--- a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
@@ -117,6 +117,8 @@ LayoutTestController::LayoutTestController(TestShell* shell)
bindMethod("pauseTransitionAtTimeOnElementWithId", &LayoutTestController::pauseTransitionAtTimeOnElementWithId);
bindMethod("elementDoesAutoCompleteForElementWithId", &LayoutTestController::elementDoesAutoCompleteForElementWithId);
bindMethod("numberOfActiveAnimations", &LayoutTestController::numberOfActiveAnimations);
+ bindMethod("suspendAnimations", &LayoutTestController::suspendAnimations);
+ bindMethod("resumeAnimations", &LayoutTestController::resumeAnimations);
bindMethod("disableImageLoading", &LayoutTestController::disableImageLoading);
bindMethod("setIconDatabaseEnabled", &LayoutTestController::setIconDatabaseEnabled);
bindMethod("setCustomPolicyDelegate", &LayoutTestController::setCustomPolicyDelegate);
@@ -838,6 +840,32 @@ int LayoutTestController::numberOfActiveAnimations()
return controller->numberOfActiveAnimations();
}
+void LayoutTestController::suspendAnimations()
+{
+ WebFrame* webFrame = m_shell->webView()->mainFrame();
+ if (!webFrame)
+ return;
+
+ WebAnimationController* controller = webFrame->animationController();
+ if (!controller)
+ return;
+
+ controller->suspendAnimations(core(webFrame)->document());
+}
+
+void LayoutTestController::resumeAnimations()
+{
+ WebFrame* webFrame = m_shell->webView()->mainFrame();
+ if (!webFrame)
+ return;
+
+ WebAnimationController* controller = webFrame->animationController();
+ if (!controller)
+ return;
+
+ controller->resumeAnimations(core(webFrame)->document());
+}
+
void LayoutTestController::pauseAnimationAtTimeOnElementWithId(const CppArgumentList& arguments, CppVariant* result)
{
result->set(false);
@@ -875,6 +903,18 @@ void LayoutTestController::numberOfActiveAnimations(const CppArgumentList&, CppV
result->set(numberOfActiveAnimations());
}
+void LayoutTestController::suspendAnimations(const CppArgumentList&, CppVariant* result)
+{
+ suspendAnimations();
+ result->setNull();
+}
+
+void LayoutTestController::resumeAnimations(const CppArgumentList&, CppVariant* result)
+{
+ resumeAnimations();
+ result->setNull();
+}
+
void LayoutTestController::disableImageLoading(const CppArgumentList&, CppVariant* result)
{
m_shell->webView()->settings()->setLoadsImagesAutomatically(false);
diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
index fb91544..a2d5ea0 100644
--- a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
+++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
@@ -207,6 +207,8 @@ public:
void pauseTransitionAtTimeOnElementWithId(const CppArgumentList&, CppVariant*);
void elementDoesAutoCompleteForElementWithId(const CppArgumentList&, CppVariant*);
void numberOfActiveAnimations(const CppArgumentList&, CppVariant*);
+ void suspendAnimations(const CppArgumentList&, CppVariant*);
+ void resumeAnimations(const CppArgumentList&, CppVariant*);
void disableImageLoading(const CppArgumentList&, CppVariant*);
@@ -395,6 +397,8 @@ private:
bool pauseTransitionAtTimeOnElementWithId(const WebKit::WebString& propertyName, double time, const WebKit::WebString& elementId);
bool elementDoesAutoCompleteForElementWithId(const WebKit::WebString&);
int numberOfActiveAnimations();
+ void suspendAnimations();
+ void suspendAnimations();
// Used for test timeouts.
ScopedRunnableMethodFactory<LayoutTestController> m_timeoutFactory;
diff --git a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
index b0c1cba..2bc7b32 100644
--- a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
@@ -52,6 +52,8 @@ bool webkit_web_frame_pause_animation(WebKitWebFrame* frame, const gchar* name,
bool webkit_web_frame_pause_transition(WebKitWebFrame* frame, const gchar* name, double time, const gchar* element);
bool webkit_web_frame_pause_svg_animation(WebKitWebFrame* frame, const gchar* name, double time, const gchar* element);
unsigned int webkit_web_frame_number_of_active_animations(WebKitWebFrame* frame);
+void webkit_web_frame_suspend_animations(WebKitWebFrame* frame);
+void webkit_web_frame_resume_animations(WebKitWebFrame* frame);
void webkit_application_cache_set_maximum_size(unsigned long long size);
unsigned int webkit_worker_thread_count(void);
void webkit_white_list_access_from_origin(const gchar* sourceOrigin, const gchar* destinationProtocol, const gchar* destinationHost, bool allowDestinationSubdomains);
@@ -620,6 +622,16 @@ unsigned LayoutTestController::numberOfActiveAnimations() const
return webkit_web_frame_number_of_active_animations(mainFrame);
}
+void LayoutTestController::suspendAnimations() const
+{
+ return webkit_web_frame_suspend_animations(mainFrame);
+}
+
+void LayoutTestController::resumeAnimations() const
+{
+ return webkit_web_frame_resume_animations(mainFrame);
+}
+
void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value)
{
gchar* name = JSStringCopyUTF8CString(key);
diff --git a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
index c0eb722..a85ac2e 100644
--- a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
@@ -631,6 +631,16 @@ unsigned LayoutTestController::numberOfActiveAnimations() const
return [mainFrame _numberOfActiveAnimations];
}
+void LayoutTestController::suspendAnimations() const
+{
+ return [mainFrame _suspendAnimations];
+}
+
+void LayoutTestController::resumeAnimations() const
+{
+ return [mainFrame _resumeAnimations];
+}
+
void LayoutTestController::waitForPolicyDelegate()
{
setWaitToDump(true);
diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
index e682fd0..74baf37 100644
--- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
@@ -484,6 +484,20 @@ unsigned LayoutTestController::numberOfActiveAnimations() const
return DumpRenderTreeSupportQt::numberOfActiveAnimations(frame);
}
+void LayoutTestController::suspendAnimations() const
+{
+ QWebFrame* frame = m_drt->webPage()->mainFrame();
+ Q_ASSERT(frame);
+ DumpRenderTreeSupportQt::suspendAnimations(frame);
+}
+
+void LayoutTestController::resumeAnimations() const
+{
+ QWebFrame* frame = m_drt->webPage()->mainFrame();
+ Q_ASSERT(frame);
+ DumpRenderTreeSupportQt::resumeAnimations(frame);
+}
+
void LayoutTestController::disableImageLoading()
{
m_drt->webPage()->settings()->setAttribute(QWebSettings::AutoLoadImages, false);
diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
index f9986b1..207e093 100644
--- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
+++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
@@ -167,6 +167,8 @@ public slots:
bool elementDoesAutoCompleteForElementWithId(const QString& elementId);
unsigned numberOfActiveAnimations() const;
+ void suspendAnimations() const;
+ void resumeAnimations() const;
void addOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains);
void removeOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains);
diff --git a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
index 31bc6ce..1ff88e5 100644
--- a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
+++ b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
@@ -1060,6 +1060,24 @@ unsigned LayoutTestController::numberOfActiveAnimations() const
return number;
}
+void LayoutTestController::suspendAnimations() const
+{
+ COMPtr<IWebFramePrivate> framePrivate(Query, frame);
+ if (!framePrivate)
+ return;
+
+ framePrivate->suspendAnimations();
+}
+
+void LayoutTestController::resumeAnimations() const
+{
+ COMPtr<IWebFramePrivate> framePrivate(Query, frame);
+ if (!framePrivate)
+ return;
+
+ framePrivate->resumeAnimations();
+}
+
static _bstr_t bstrT(JSStringRef jsString)
{
// The false parameter tells the _bstr_t constructor to adopt the BSTR we pass it.
diff --git a/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp b/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
index 7c80ff2..9fee1e3 100644
--- a/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
+++ b/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
@@ -264,6 +264,16 @@ unsigned LayoutTestController::numberOfActiveAnimations() const
return 0;
}
+void LayoutTestController::suspendAnimations() const
+{
+ // FIXME: implement
+}
+
+void LayoutTestController::resumeAnimations() const
+{
+ // FIXME: implement
+}
+
unsigned LayoutTestController::workerThreadCount() const
{
// FIXME: implement
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list