Changeset 41361 in webkit


Ignore:
Timestamp:
Mar 2, 2009 10:26:55 AM (15 years ago)
Author:
treat@webkit.org
Message:

2009-03-02 Adam Treat <adam.treat@torchmobile.com>

Reviewed by Eric Seidel.

Add three new drt helper functions that enable all of the tests in
LayoutTests/animation/* and LayoutTests/transitions/* to now pass.

  • Api/qwebframe.cpp: (qt_drt_pauseAnimation): (qt_drt_pauseTransitionOfProperty): (qt_drt_numberOfActiveAnimations):
  • DumpRenderTree/qt/jsobjects.cpp: (LayoutTestController::pauseAnimationAtTimeOnElementWithId): (LayoutTestController::pauseTransitionAtTimeOnElementWithId): (LayoutTestController::numberOfActiveAnimations):
  • DumpRenderTree/qt/jsobjects.h:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/qt/Api/qwebframe.cpp

    r40973 r41361  
    105105    else
    106106        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.
     112bool 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
     132bool 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).
     153int 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();
    107164}
    108165
  • trunk/WebKit/qt/ChangeLog

    r41360 r41361  
     12009-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
    1132009-03-02  Benjamin C Meyer  <benjamin.meyer@torchmobile.com>
    214
  • trunk/WebKitTools/ChangeLog

    r41354 r41361  
     12009-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
    1142009-03-02  Adam Roben  <aroben@apple.com>
    215
  • trunk/WebKitTools/DumpRenderTree/qt/jsobjects.cpp

    r41211 r41361  
    4242extern void qt_dump_resource_load_callbacks(bool b);
    4343extern void qt_drt_setJavaScriptProfilingEnabled(QWebFrame*, bool enabled);
     44extern bool qt_drt_pauseAnimation(QWebFrame*, const QString &name, double time, const QString &elementId);
     45extern bool qt_drt_pauseTransitionOfProperty(QWebFrame*, const QString &name, double time, const QString &elementId);
     46extern int qt_drt_numberOfActiveAnimations(QWebFrame*);
    4447
    4548QWebFrame *findFrameNamed(const QString &frameName, QWebFrame *frame)
     
    273276{
    274277    m_topLoadingFrame->page()->setUseFixedLayout(enable);
     278}
     279
     280bool 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
     289bool 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
     298unsigned LayoutTestController::numberOfActiveAnimations() const
     299{
     300    QWebFrame *frame = m_drt->webPage()->mainFrame();
     301    Q_ASSERT(frame);
     302    return qt_drt_numberOfActiveAnimations(frame);
    275303}
    276304
  • trunk/WebKitTools/DumpRenderTree/qt/jsobjects.h

    r41211 r41361  
    9292    void setUseFixedLayout(bool enable);
    9393
     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
    9498private slots:
    9599    void processWork();
Note: See TracChangeset for help on using the changeset viewer.