summaryrefslogtreecommitdiff
path: root/Source/WebCore/svg/properties/SVGAnimatedProperty.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/svg/properties/SVGAnimatedProperty.cpp')
-rw-r--r--Source/WebCore/svg/properties/SVGAnimatedProperty.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/Source/WebCore/svg/properties/SVGAnimatedProperty.cpp b/Source/WebCore/svg/properties/SVGAnimatedProperty.cpp
index 60fae5bbf..f24a8d871 100644
--- a/Source/WebCore/svg/properties/SVGAnimatedProperty.cpp
+++ b/Source/WebCore/svg/properties/SVGAnimatedProperty.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (C) Research In Motion Limited 2010. All rights reserved.
* Copyright (C) 2013 Samsung Electronics. All rights reserved.
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -19,8 +20,6 @@
*/
#include "config.h"
-
-#if ENABLE(SVG)
#include "SVGAnimatedProperty.h"
#include "SVGElement.h"
@@ -31,7 +30,6 @@ SVGAnimatedProperty::SVGAnimatedProperty(SVGElement* contextElement, const Quali
: m_contextElement(contextElement)
, m_attributeName(attributeName)
, m_animatedPropertyType(animatedPropertyType)
- , m_isAnimating(false)
, m_isReadOnly(false)
{
}
@@ -39,16 +37,15 @@ SVGAnimatedProperty::SVGAnimatedProperty(SVGElement* contextElement, const Quali
SVGAnimatedProperty::~SVGAnimatedProperty()
{
// Remove wrapper from cache.
- Cache& cache = *animatedPropertyCache();
- for (auto it = cache.begin(), end = cache.end(); it != end; ++it) {
- if (it->value == this) {
- cache.remove(it);
+ for (auto& cache : *animatedPropertyCache()) {
+ if (cache.value == this) {
+ animatedPropertyCache()->remove(cache.key);
break;
}
}
// Assure that animationEnded() was called, if animationStarted() was called before.
- ASSERT(!m_isAnimating);
+ ASSERT(!isAnimating());
}
void SVGAnimatedProperty::commitChange()
@@ -57,6 +54,8 @@ void SVGAnimatedProperty::commitChange()
ASSERT(!m_contextElement->m_deletionHasBegun);
m_contextElement->invalidateSVGAttributes();
m_contextElement->svgAttributeChanged(m_attributeName);
+ // Needed to synchronize with CSSOM for presentation attributes with SVG DOM.
+ m_contextElement->synchronizeAnimatedSVGAttribute(m_attributeName);
}
SVGAnimatedProperty::Cache* SVGAnimatedProperty::animatedPropertyCache()
@@ -66,5 +65,3 @@ SVGAnimatedProperty::Cache* SVGAnimatedProperty::animatedPropertyCache()
}
} // namespace WebCore
-
-#endif // ENABLE(SVG)