Chromium Code Reviews| 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 33 #include "core/svg/SVGElement.h" | 33 #include "core/svg/SVGElement.h" |
| 34 | 34 |
| 35 namespace blink { | 35 namespace blink { |
| 36 | 36 |
| 37 SVGAnimatedPropertyBase::SVGAnimatedPropertyBase( | 37 SVGAnimatedPropertyBase::SVGAnimatedPropertyBase( |
| 38 AnimatedPropertyType type, | 38 AnimatedPropertyType type, |
| 39 SVGElement* contextElement, | 39 SVGElement* contextElement, |
| 40 const QualifiedName& attributeName, | 40 const QualifiedName& attributeName, |
| 41 CSSPropertyID cssPropertyId) | 41 CSSPropertyID cssPropertyId) |
| 42 : m_type(type), | 42 : m_type(type), |
| 43 m_cssPropertyId(cssPropertyId), | 43 m_cssPropertyId(static_cast<unsigned>(cssPropertyId)), |
|
Nico
2017/03/14 17:16:47
add comment why a) cast is here b) why this is saf
| |
| 44 m_contextElement(contextElement), | 44 m_contextElement(contextElement), |
| 45 m_attributeName(attributeName) { | 45 m_attributeName(attributeName) { |
| 46 DCHECK(m_contextElement); | 46 DCHECK(m_contextElement); |
| 47 DCHECK(m_attributeName != QualifiedName::null()); | 47 DCHECK(m_attributeName != QualifiedName::null()); |
| 48 DCHECK_EQ(this->type(), type); | 48 DCHECK_EQ(this->type(), type); |
| 49 DCHECK_EQ(this->cssPropertyId(), cssPropertyId); | 49 DCHECK_EQ(this->cssPropertyId(), cssPropertyId); |
| 50 } | 50 } |
| 51 | 51 |
| 52 SVGAnimatedPropertyBase::~SVGAnimatedPropertyBase() {} | 52 SVGAnimatedPropertyBase::~SVGAnimatedPropertyBase() {} |
| 53 | 53 |
| 54 void SVGAnimatedPropertyBase::animationEnded() { | 54 void SVGAnimatedPropertyBase::animationEnded() { |
| 55 synchronizeAttribute(); | 55 synchronizeAttribute(); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void SVGAnimatedPropertyBase::synchronizeAttribute() { | 58 void SVGAnimatedPropertyBase::synchronizeAttribute() { |
| 59 AtomicString value(currentValueBase()->valueAsString()); | 59 AtomicString value(currentValueBase()->valueAsString()); |
| 60 m_contextElement->setSynchronizedLazyAttribute(m_attributeName, value); | 60 m_contextElement->setSynchronizedLazyAttribute(m_attributeName, value); |
| 61 } | 61 } |
| 62 | 62 |
| 63 bool SVGAnimatedPropertyBase::isSpecified() const { | 63 bool SVGAnimatedPropertyBase::isSpecified() const { |
| 64 return isAnimating() || contextElement()->hasAttribute(attributeName()); | 64 return isAnimating() || contextElement()->hasAttribute(attributeName()); |
| 65 } | 65 } |
| 66 | 66 |
| 67 } // namespace blink | 67 } // namespace blink |
| OLD | NEW |