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

Side by Side Diff: Source/core/svg/properties/SVGAnimatedProperty.cpp

Issue 18707002: Reduce number of header includes in SVG (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Attempt to fix bots 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 /*
2 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
Stephen Chennney 2013/07/08 14:08:39 And change this, or add yourself.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20 #include "config.h"
21 #include "core/svg/properties/SVGAnimatedProperty.h"
22
23 #include "core/svg/SVGElement.h"
24
25 namespace WebCore {
26
27 SVGAnimatedProperty::SVGAnimatedProperty(SVGElement* contextElement, const Quali fiedName& attributeName, AnimatedPropertyType animatedPropertyType)
28 : m_contextElement(contextElement)
29 , m_attributeName(attributeName)
30 , m_animatedPropertyType(animatedPropertyType)
31 , m_isAnimating(false)
32 , m_isReadOnly(false)
33 {
34 }
35
36 SVGAnimatedProperty::~SVGAnimatedProperty()
37 {
38 // Remove wrapper from cache.
39 Cache* cache = animatedPropertyCache();
40 const Cache::const_iterator end = cache->end();
41 for (Cache::const_iterator it = cache->begin(); it != end; ++it) {
42 if (it->value == this) {
43 cache->remove(it->key);
44 break;
45 }
46 }
47
48 // Assure that animationEnded() was called, if animationStarted() was called before.
49 ASSERT(!m_isAnimating);
50 }
51
52 void SVGAnimatedProperty::commitChange()
53 {
54 ASSERT(m_contextElement);
55 ASSERT(!m_contextElement->m_deletionHasBegun);
56 m_contextElement->invalidateSVGAttributes();
57 m_contextElement->svgAttributeChanged(m_attributeName);
58 }
59
60 SVGAnimatedProperty::Cache* SVGAnimatedProperty::animatedPropertyCache()
61 {
62 static Cache* s_cache = new Cache;
63 return s_cache;
64 }
65
66 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698