Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(563)

Unified Diff: Source/core/dom/Element.cpp

Issue 19266007: Web Animations: Introduce ActiveAnimations and AnimationStack (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index 1ad2552df97a07d48bb5616c7bf918fa7703f333..346ba261067477267babc9e1a8ebebec6fc451d3 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -32,6 +32,7 @@
#include "SVGNames.h"
#include "XMLNames.h"
#include "core/accessibility/AXObjectCache.h"
+#include "core/animation/DocumentTimeline.h"
#include "core/css/CSSParser.h"
#include "core/css/CSSStyleSheet.h"
#include "core/css/CSSValuePool.h"
@@ -374,34 +375,15 @@ NamedNodeMap* Element::attributes() const
return rareData->attributeMap();
}
-void Element::addActiveAnimation(Animation* animation)
-{
- ElementRareData* rareData = ensureElementRareData();
- if (!rareData->activeAnimations())
- rareData->setActiveAnimations(adoptPtr(new Vector<Animation*>));
- rareData->activeAnimations()->append(animation);
-}
-
-void Element::removeActiveAnimation(Animation* animation)
-{
- ElementRareData* rareData = elementRareData();
- ASSERT(rareData);
- size_t position = rareData->activeAnimations()->find(animation);
- ASSERT(position != notFound);
- rareData->activeAnimations()->remove(position);
-}
-
bool Element::hasActiveAnimations() const
{
- return hasRareData() && elementRareData()->activeAnimations()
- && elementRareData()->activeAnimations()->size();
-}
+ if (!RuntimeEnabledFeatures::webAnimationsEnabled())
+ return false;
-Vector<Animation*>* Element::activeAnimations() const
-{
- if (!elementRareData())
- return 0;
- return elementRareData()->activeAnimations();
+ if (!document())
+ return false;
+
+ return document()->timeline()->animationStack().hasActiveAnimations(this);
}
Node::NodeType Element::nodeType() const

Powered by Google App Engine
This is Rietveld 408576698