OLD | NEW |
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 G* * Redistributions in binary form must reproduce the above | 10 G* * Redistributions in binary form must reproduce the above |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 | 319 |
320 // When still (not animated): | 320 // When still (not animated): |
321 // Both m_animValTearOff and m_baseValTearOff target m_baseValue. | 321 // Both m_animValTearOff and m_baseValTearOff target m_baseValue. |
322 // When animated: | 322 // When animated: |
323 // m_animValTearOff targets m_currentValue. | 323 // m_animValTearOff targets m_currentValue. |
324 // m_baseValTearOff targets m_baseValue. | 324 // m_baseValTearOff targets m_baseValue. |
325 RefPtrWillBeMember<TearOffType> m_baseValTearOff; | 325 RefPtrWillBeMember<TearOffType> m_baseValTearOff; |
326 RefPtrWillBeMember<TearOffType> m_animValTearOff; | 326 RefPtrWillBeMember<TearOffType> m_animValTearOff; |
327 }; | 327 }; |
328 | 328 |
| 329 // Implementation of SVGAnimatedProperty which doesn't use tear-off value types. |
| 330 // This class has "void" for its TearOffType. |
| 331 // Currently only used for SVGAnimatedPath. |
| 332 template <typename Property> |
| 333 class SVGAnimatedProperty<Property, void, void> : public SVGAnimatedPropertyComm
on<Property> { |
| 334 public: |
| 335 static PassRefPtrWillBeRawPtr<SVGAnimatedProperty<Property>> create(SVGEleme
nt* contextElement, const QualifiedName& attributeName, PassRefPtrWillBeRawPtr<P
roperty> initialValue) |
| 336 { |
| 337 return adoptRefWillBeNoop(new SVGAnimatedProperty<Property>(contextEleme
nt, attributeName, initialValue)); |
| 338 } |
| 339 |
| 340 bool needsSynchronizeAttribute() override |
| 341 { |
| 342 // DOM attribute synchronization is only needed if the property is being
animated. |
| 343 return this->isAnimating(); |
| 344 } |
| 345 |
| 346 protected: |
| 347 SVGAnimatedProperty(SVGElement* contextElement, const QualifiedName& attribu
teName, PassRefPtrWillBeRawPtr<Property> initialValue) |
| 348 : SVGAnimatedPropertyCommon<Property>(contextElement, attributeName, ini
tialValue) |
| 349 { |
| 350 } |
| 351 }; |
| 352 |
329 } // namespace blink | 353 } // namespace blink |
330 | 354 |
331 #endif // SVGAnimatedProperty_h | 355 #endif // SVGAnimatedProperty_h |
OLD | NEW |