Changeset 41361 in webkit
- Timestamp:
- Mar 2, 2009 10:26:55 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/qt/Api/qwebframe.cpp
r40973 r41361 105 105 else 106 106 controller->disableProfiler(); 107 } 108 109 // Pause a given CSS animation or transition on the target node at a specific time. 110 // If the animation or transition is already paused, it will update its pause time. 111 // This method is only intended to be used for testing the CSS animation and transition system. 112 bool QWEBKIT_EXPORT qt_drt_pauseAnimation(QWebFrame *qframe, const QString &animationName, double time, const QString &elementId) 113 { 114 Frame* frame = QWebFramePrivate::core(qframe); 115 if (!frame) 116 return false; 117 118 AnimationController* controller = frame->animation(); 119 if (!controller) 120 return false; 121 122 Document* doc = frame->document(); 123 Q_ASSERT(doc); 124 125 Node* coreNode = doc->getElementById(elementId); 126 if (!coreNode || !coreNode->renderer()) 127 return false; 128 129 return controller->pauseAnimationAtTime(coreNode->renderer(), animationName, time); 130 } 131 132 bool QWEBKIT_EXPORT qt_drt_pauseTransitionOfProperty(QWebFrame *qframe, const QString &propertyName, double time, const QString &elementId) 133 { 134 Frame* frame = QWebFramePrivate::core(qframe); 135 if (!frame) 136 return false; 137 138 AnimationController* controller = frame->animation(); 139 if (!controller) 140 return false; 141 142 Document* doc = frame->document(); 143 Q_ASSERT(doc); 144 145 Node* coreNode = doc->getElementById(elementId); 146 if (!coreNode || !coreNode->renderer()) 147 return false; 148 149 return controller->pauseTransitionAtTime(coreNode->renderer(), propertyName, time); 150 } 151 152 // Returns the total number of currently running animations (includes both CSS transitions and CSS animations). 153 int QWEBKIT_EXPORT qt_drt_numberOfActiveAnimations(QWebFrame *qframe) 154 { 155 Frame* frame = QWebFramePrivate::core(qframe); 156 if (!frame) 157 return false; 158 159 AnimationController* controller = frame->animation(); 160 if (!controller) 161 return false; 162 163 return controller->numberOfActiveAnimations(); 107 164 } 108 165 -
trunk/WebKit/qt/ChangeLog
r41360 r41361 1 2009-03-02 Adam Treat <adam.treat@torchmobile.com> 2 3 Reviewed by Eric Seidel. 4 5 Add three new drt helper functions that enable all of the tests in 6 LayoutTests/animation/* and LayoutTests/transitions/* to now pass. 7 8 * Api/qwebframe.cpp: 9 (qt_drt_pauseAnimation): 10 (qt_drt_pauseTransitionOfProperty): 11 (qt_drt_numberOfActiveAnimations): 12 1 13 2009-03-02 Benjamin C Meyer <benjamin.meyer@torchmobile.com> 2 14 -
trunk/WebKitTools/ChangeLog
r41354 r41361 1 2009-03-02 Adam Treat <adam.treat@torchmobile.com> 2 3 Reviewed by Eric Seidel. 4 5 Add three new drt helper functions that enable all of the tests in 6 LayoutTests/animation/* and LayoutTests/transitions/* to now pass. 7 8 * DumpRenderTree/qt/jsobjects.cpp: 9 (LayoutTestController::pauseAnimationAtTimeOnElementWithId): 10 (LayoutTestController::pauseTransitionAtTimeOnElementWithId): 11 (LayoutTestController::numberOfActiveAnimations): 12 * DumpRenderTree/qt/jsobjects.h: 13 1 14 2009-03-02 Adam Roben <aroben@apple.com> 2 15 -
trunk/WebKitTools/DumpRenderTree/qt/jsobjects.cpp
r41211 r41361 42 42 extern void qt_dump_resource_load_callbacks(bool b); 43 43 extern void qt_drt_setJavaScriptProfilingEnabled(QWebFrame*, bool enabled); 44 extern bool qt_drt_pauseAnimation(QWebFrame*, const QString &name, double time, const QString &elementId); 45 extern bool qt_drt_pauseTransitionOfProperty(QWebFrame*, const QString &name, double time, const QString &elementId); 46 extern int qt_drt_numberOfActiveAnimations(QWebFrame*); 44 47 45 48 QWebFrame *findFrameNamed(const QString &frameName, QWebFrame *frame) … … 273 276 { 274 277 m_topLoadingFrame->page()->setUseFixedLayout(enable); 278 } 279 280 bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(const QString &animationName, 281 double time, 282 const QString &elementId) 283 { 284 QWebFrame *frame = m_drt->webPage()->mainFrame(); 285 Q_ASSERT(frame); 286 return qt_drt_pauseAnimation(frame, animationName, time, elementId); 287 } 288 289 bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(const QString &propertyName, 290 double time, 291 const QString &elementId) 292 { 293 QWebFrame *frame = m_drt->webPage()->mainFrame(); 294 Q_ASSERT(frame); 295 return qt_drt_pauseTransitionOfProperty(frame, propertyName, time, elementId); 296 } 297 298 unsigned LayoutTestController::numberOfActiveAnimations() const 299 { 300 QWebFrame *frame = m_drt->webPage()->mainFrame(); 301 Q_ASSERT(frame); 302 return qt_drt_numberOfActiveAnimations(frame); 275 303 } 276 304 -
trunk/WebKitTools/DumpRenderTree/qt/jsobjects.h
r41211 r41361 92 92 void setUseFixedLayout(bool enable); 93 93 94 bool pauseAnimationAtTimeOnElementWithId(const QString &animationName, double time, const QString &elementId); 95 bool pauseTransitionAtTimeOnElementWithId(const QString &propertyName, double time, const QString &elementId); 96 unsigned numberOfActiveAnimations() const; 97 94 98 private slots: 95 99 void processWork();
Note: See TracChangeset
for help on using the changeset viewer.