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

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

Issue 298873003: SVG: SVGAnimateElement should not cache |m_animatedElements| (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove more asserts Created 6 years, 6 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
« no previous file with comments | « Source/core/svg/properties/SVGAnimatedProperty.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 20 matching lines...) Expand all
31 #include "config.h" 31 #include "config.h"
32 #include "core/svg/properties/SVGAnimatedProperty.h" 32 #include "core/svg/properties/SVGAnimatedProperty.h"
33 33
34 #include "core/svg/SVGElement.h" 34 #include "core/svg/SVGElement.h"
35 35
36 namespace WebCore { 36 namespace WebCore {
37 37
38 SVGAnimatedPropertyBase::SVGAnimatedPropertyBase(AnimatedPropertyType type, SVGE lement* contextElement, const QualifiedName& attributeName) 38 SVGAnimatedPropertyBase::SVGAnimatedPropertyBase(AnimatedPropertyType type, SVGE lement* contextElement, const QualifiedName& attributeName)
39 : m_type(type) 39 : m_type(type)
40 , m_isReadOnly(false) 40 , m_isReadOnly(false)
41 , m_isAnimating(false)
42 , m_contextElement(contextElement) 41 , m_contextElement(contextElement)
43 , m_attributeName(attributeName) 42 , m_attributeName(attributeName)
44 { 43 {
45 ASSERT(m_contextElement); 44 ASSERT(m_contextElement);
46 ASSERT(m_attributeName != nullQName()); 45 ASSERT(m_attributeName != nullQName());
47 // FIXME: setContextElement should be delayed until V8 wrapper is created. 46 // FIXME: setContextElement should be delayed until V8 wrapper is created.
48 // FIXME: oilpan: or we can remove this backref ptr hack in oilpan. 47 // FIXME: oilpan: or we can remove this backref ptr hack in oilpan.
49 m_contextElement->setContextElement(); 48 m_contextElement->setContextElement();
50 } 49 }
51 50
52 SVGAnimatedPropertyBase::~SVGAnimatedPropertyBase() 51 SVGAnimatedPropertyBase::~SVGAnimatedPropertyBase()
53 { 52 {
54 // FIXME: Oilpan: We need to investigate why this assert fails in
55 // Oilpan builds.
56 #if !ENABLE(OILPAN)
57 ASSERT(!isAnimating());
58 #endif
59 } 53 }
60 54
61 void SVGAnimatedPropertyBase::animationStarted() 55 void SVGAnimatedPropertyBase::animationStarted()
62 { 56 {
63 ASSERT(!isAnimating()); 57 // FIXME: remove this function and its overrides
64 m_isAnimating = true;
65 } 58 }
66 59
67 void SVGAnimatedPropertyBase::animationEnded() 60 void SVGAnimatedPropertyBase::animationEnded()
68 { 61 {
69 synchronizeAttribute(); 62 synchronizeAttribute();
70 ASSERT(isAnimating());
71 m_isAnimating = false;
72 } 63 }
73 64
74 void SVGAnimatedPropertyBase::synchronizeAttribute() 65 void SVGAnimatedPropertyBase::synchronizeAttribute()
75 { 66 {
76 ASSERT(needsSynchronizeAttribute());
77 AtomicString value(currentValueBase()->valueAsString()); 67 AtomicString value(currentValueBase()->valueAsString());
78 m_contextElement->setSynchronizedLazyAttribute(m_attributeName, value); 68 m_contextElement->setSynchronizedLazyAttribute(m_attributeName, value);
79 } 69 }
80 70
81 bool SVGAnimatedPropertyBase::isSpecified() const 71 bool SVGAnimatedPropertyBase::isSpecified() const
82 { 72 {
83 return isAnimating() || contextElement()->hasAttribute(attributeName()); 73 return isAnimating() || contextElement()->hasAttribute(attributeName());
84 } 74 }
85 75
86 } // namespace WebCore 76 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/svg/properties/SVGAnimatedProperty.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698