2011-05-20 Simon Fraser <simon.fraser@apple.com>
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 May 2011 21:00:46 +0000 (21:00 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 May 2011 21:00:46 +0000 (21:00 +0000)
        Reviewed by Sam Weinig.

        numberOfActiveAnimations() can include animations from documents in the page cache
        https://bugs.webkit.org/show_bug.cgi?id=53641

        Some transition tests using layoutTestController.numberOfActiveAnimations() failed
        in WebKit2 because numberOfActiveAnimations() could include those from other documents
        in the page cache.

        Fix by passing in the document for which we wish to count animations.

        * WebCore.exp.in:
        * page/animation/AnimationController.cpp:
        (WebCore::AnimationControllerPrivate::numberOfActiveAnimations):
        (WebCore::AnimationController::numberOfActiveAnimations):
        * page/animation/AnimationController.h:
        * page/animation/AnimationControllerPrivate.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@86981 268f45cc-cd09-0410-ab3c-d52691b4dbfc

19 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac-wk2/Skipped
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/page/animation/AnimationController.cpp
Source/WebCore/page/animation/AnimationController.h
Source/WebCore/page/animation/AnimationControllerPrivate.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebAnimationControllerImpl.cpp
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebFrame.mm
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebFrame.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/WebFrame.cpp

index 94b641b..7abfab3 100644 (file)
@@ -1,3 +1,14 @@
+2011-05-20  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        numberOfActiveAnimations() can include animations from documents in the page cache
+        https://bugs.webkit.org/show_bug.cgi?id=53641
+
+        Unskip tests that were broken because of bad numberOfActiveAnimations() behavior.
+        
+        * platform/mac-wk2/Skipped:
+
 2011-05-20  Dirk Schulze  <krit@webkit.org>
 
         Unreviewed rebaseline of Qt. One of the two tests doesn't even need a platform specific result anymore.
index fbbe923..7e0588d 100644 (file)
@@ -1462,13 +1462,6 @@ plugins/npruntime/plugin-scriptable-object-invoke-default.html
 fast/parser/remove-misnested-iframe-in-beforeload.html
 fast/parser/remove-misnested-iframe-parent-in-beforeload.html
 
-# Transitions sometimes don't stop when they should in WebKit2
-# <rdar://problem/8883326>
-transitions/hang-with-bad-transition-list.html
-transitions/remove-transition-style.html
-transitions/repeated-firing-background-color.html
-transitions/zero-duration-with-non-zero-delay-end.html
-
 # CSSValue and CSSPrimitiveValue prototypes are wrong
 # <rdar://problem/8772988>
 fast/dom/global-constructors.html
index b8d7b91..54bc165 100644 (file)
@@ -1,3 +1,23 @@
+2011-05-20  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        numberOfActiveAnimations() can include animations from documents in the page cache
+        https://bugs.webkit.org/show_bug.cgi?id=53641
+        
+        Some transition tests using layoutTestController.numberOfActiveAnimations() failed
+        in WebKit2 because numberOfActiveAnimations() could include those from other documents
+        in the page cache.
+        
+        Fix by passing in the document for which we wish to count animations.
+
+        * WebCore.exp.in:
+        * page/animation/AnimationController.cpp:
+        (WebCore::AnimationControllerPrivate::numberOfActiveAnimations):
+        (WebCore::AnimationController::numberOfActiveAnimations):
+        * page/animation/AnimationController.h:
+        * page/animation/AnimationControllerPrivate.h:
+
 2011-05-20  Adam Barth  <abarth@webkit.org>
 
         Reviewed by Alexey Proskuryakov.
index 95c382d..cd59a66 100644 (file)
@@ -1160,7 +1160,7 @@ __ZNK7WebCore16VisibleSelection19rootEditableElementEv
 __ZNK7WebCore16VisibleSelection23isContentRichlyEditableEv
 __ZNK7WebCore16VisibleSelection5isAllENS_27EditingBoundaryCrossingRuleE
 __ZNK7WebCore17ResourceErrorBase8lazyInitEv
-__ZNK7WebCore19AnimationController24numberOfActiveAnimationsEv
+__ZNK7WebCore19AnimationController24numberOfActiveAnimationsEPNS_8DocumentE
 __ZNK7WebCore19HTMLTextAreaElement21lastChangeWasUserEditEv
 __ZNK7WebCore19ResourceRequestBase10httpMethodEv
 __ZNK7WebCore19ResourceRequestBase15httpHeaderFieldEPKc
index 5b166d4..b443a10 100644 (file)
@@ -352,14 +352,16 @@ PassRefPtr<RenderStyle> AnimationControllerPrivate::getAnimatedStyleForRenderer(
     return animatingStyle.release();
 }
 
-unsigned AnimationControllerPrivate::numberOfActiveAnimations() const
+unsigned AnimationControllerPrivate::numberOfActiveAnimations(Document* document) const
 {
     unsigned count = 0;
     
     RenderObjectAnimationMap::const_iterator animationsEnd = m_compositeAnimations.end();
     for (RenderObjectAnimationMap::const_iterator it = m_compositeAnimations.begin(); it != animationsEnd; ++it) {
+        RenderObject* renderer = it->first;
         CompositeAnimation* compAnim = it->second.get();
-        count += compAnim->numberOfActiveAnimations();
+        if (renderer->document() == document)
+            count += compAnim->numberOfActiveAnimations();
     }
     
     return count;
@@ -525,9 +527,9 @@ bool AnimationController::pauseAnimationAtTime(RenderObject* renderer, const Str
     return m_data->pauseAnimationAtTime(renderer, name, t);
 }
 
-unsigned AnimationController::numberOfActiveAnimations() const
+unsigned AnimationController::numberOfActiveAnimations(Document* document) const
 {
-    return m_data->numberOfActiveAnimations();
+    return m_data->numberOfActiveAnimations(document);
 }
 
 bool AnimationController::pauseTransitionAtTime(RenderObject* renderer, const String& property, double t)
index a355f87..efe6d04 100644 (file)
@@ -58,7 +58,7 @@ public:
 
     bool pauseAnimationAtTime(RenderObject*, const String& name, double t); // To be used only for testing
     bool pauseTransitionAtTime(RenderObject*, const String& property, double t); // To be used only for testing
-    unsigned numberOfActiveAnimations() const; // To be used only for testing
+    unsigned numberOfActiveAnimations(Document*) const; // To be used only for testing
     
     bool isRunningAnimationOnRenderer(RenderObject*, CSSPropertyID, bool isRunningNow = true) const;
     bool isRunningAcceleratedAnimationOnRenderer(RenderObject*, CSSPropertyID, bool isRunningNow = true) const;
index 1146eba..41eebff 100644 (file)
@@ -80,7 +80,7 @@ public:
 
     bool pauseAnimationAtTime(RenderObject*, const String& name, double t);
     bool pauseTransitionAtTime(RenderObject*, const String& property, double t);
-    unsigned numberOfActiveAnimations() const;
+    unsigned numberOfActiveAnimations(Document*) const;
 
     PassRefPtr<RenderStyle> getAnimatedStyleForRenderer(RenderObject* renderer);
 
index 91ffc41..3b93ffe 100644 (file)
@@ -1,3 +1,15 @@
+2011-05-20  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        numberOfActiveAnimations() can include animations from documents in the page cache
+        https://bugs.webkit.org/show_bug.cgi?id=53641
+
+        Pass the Frame's document as the one to count animations on.
+
+        * src/WebAnimationControllerImpl.cpp:
+        (WebKit::WebAnimationControllerImpl::numberOfActiveAnimations):
+
 2011-05-19  Evan Martin  <evan@chromium.org>
 
         Reviewed by Tony Chang.
index e6eb828..df6119e 100644 (file)
@@ -84,7 +84,7 @@ unsigned WebAnimationControllerImpl::numberOfActiveAnimations() const
     AnimationController* controller = animationController();
     if (!controller)
         return 0;
-    return controller->numberOfActiveAnimations();
+    return controller->numberOfActiveAnimations(m_frameImpl->frame()->document());
 }
 
 void WebAnimationControllerImpl::suspendAnimations() const
index 073313e..05c6b20 100644 (file)
@@ -1,3 +1,15 @@
+2011-05-20  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        numberOfActiveAnimations() can include animations from documents in the page cache
+        https://bugs.webkit.org/show_bug.cgi?id=53641
+
+        Pass the Frame's document as the one to count animations on.
+
+        * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
+        (DumpRenderTreeSupportGtk::numberOfActiveAnimations):
+
 2011-05-16  Martin Robinson  <mrobinson@igalia.com>
 
         Reviewed by Xan Lopez.
index 2b154a2..27bad52 100644 (file)
@@ -431,7 +431,7 @@ unsigned int DumpRenderTreeSupportGtk::numberOfActiveAnimations(WebKitWebFrame*
     if (!coreFrame)
         return 0;
 
-    return coreFrame->animation()->numberOfActiveAnimations();
+    return coreFrame->animation()->numberOfActiveAnimations(coreFrame->document());
 }
 
 void DumpRenderTreeSupportGtk::suspendAnimations(WebKitWebFrame* frame)
index a0d1720..3e9bc89 100644 (file)
@@ -1,3 +1,15 @@
+2011-05-20  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        numberOfActiveAnimations() can include animations from documents in the page cache
+        https://bugs.webkit.org/show_bug.cgi?id=53641
+
+        Pass the Frame's document as the one to count animations on.
+
+        * WebView/WebFrame.mm:
+        (-[WebFrame _numberOfActiveAnimations]):
+
 2011-05-17  Timothy Hatcher  <timothy@apple.com>
 
         Update the the context menu to reflect the system search provider on Mac.
index 5f941a1..6021eb1 100644 (file)
@@ -1040,7 +1040,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
     if (!controller)
         return false;
 
-    return controller->numberOfActiveAnimations();
+    return controller->numberOfActiveAnimations(frame->document());
 }
 
 - (void) _suspendAnimations
index 7325da3..182ea32 100644 (file)
@@ -1,3 +1,15 @@
+2011-05-20  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        numberOfActiveAnimations() can include animations from documents in the page cache
+        https://bugs.webkit.org/show_bug.cgi?id=53641
+
+        Pass the Frame's document as the one to count animations on.
+
+        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+        (DumpRenderTreeSupportQt::numberOfActiveAnimations):
+
 2011-05-20  Csaba Osztrogon√°c  <ossy@webkit.org>
 
         Reviewed by Benjamin Poulain.
index c70c1e4..1f50787 100644 (file)
@@ -355,7 +355,7 @@ int DumpRenderTreeSupportQt::numberOfActiveAnimations(QWebFrame *frame)
     if (!controller)
         return false;
 
-    return controller->numberOfActiveAnimations();
+    return controller->numberOfActiveAnimations(coreFrame->document());
 }
 
 void DumpRenderTreeSupportQt::suspendAnimations(QWebFrame *frame)
index e3324fc..b22062a 100644 (file)
@@ -1,3 +1,15 @@
+2011-05-20  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        numberOfActiveAnimations() can include animations from documents in the page cache
+        https://bugs.webkit.org/show_bug.cgi?id=53641
+
+        Pass the Frame's document as the one to count animations on.
+
+        * WebFrame.cpp:
+        (WebFrame::numberOfActiveAnimations):
+
 2011-05-20  Jer Noble  <jer.noble@apple.com>
 
         Reviewed by Maciej Stachowiak.
index 2d88e46..fd30c8d 100644 (file)
@@ -1303,7 +1303,7 @@ HRESULT WebFrame::numberOfActiveAnimations(UINT* number)
     if (!controller)
         return E_FAIL;
 
-    *number = controller->numberOfActiveAnimations();
+    *number = controller->numberOfActiveAnimations(frame->document());
     return S_OK;
 }
 
index 2a7a3df..5f47185 100644 (file)
@@ -2,6 +2,18 @@
 
         Reviewed by Sam Weinig.
 
+        numberOfActiveAnimations() can include animations from documents in the page cache
+        https://bugs.webkit.org/show_bug.cgi?id=53641
+
+        Pass the Frame's document as the one to count animations on.
+
+        * WebProcess/WebPage/WebFrame.cpp:
+        (WebKit::WebFrame::numberOfActiveAnimations):
+
+2011-05-20  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Sam Weinig.
+
         WebKitTestRunner needs layoutTestController.pauseTransitionAtTimeOnElementWithId
         https://bugs.webkit.org/show_bug.cgi?id=42550
         
index a0651d2..2624476 100644 (file)
@@ -384,7 +384,7 @@ unsigned WebFrame::numberOfActiveAnimations() const
     if (!controller)
         return 0;
 
-    return controller->numberOfActiveAnimations();
+    return controller->numberOfActiveAnimations(m_coreFrame->document());
 }
 
 bool WebFrame::pauseAnimationOnElementWithId(const String& animationName, const String& elementID, double time)