| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "core/animation/StringKeyframe.h" | 6 #include "core/animation/StringKeyframe.h" |
| 7 | 7 |
| 8 #include "core/animation/AngleSVGInterpolation.h" | 8 #include "core/animation/AngleSVGInterpolation.h" |
| 9 #include "core/animation/CSSValueInterpolationType.h" | 9 #include "core/animation/CSSValueInterpolationType.h" |
| 10 #include "core/animation/ColorStyleInterpolation.h" | 10 #include "core/animation/ColorStyleInterpolation.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 { | 53 { |
| 54 } | 54 } |
| 55 | 55 |
| 56 void StringKeyframe::setPropertyValue(CSSPropertyID property, const String& valu
e, Element* element, StyleSheetContents* styleSheetContents) | 56 void StringKeyframe::setPropertyValue(CSSPropertyID property, const String& valu
e, Element* element, StyleSheetContents* styleSheetContents) |
| 57 { | 57 { |
| 58 ASSERT(property != CSSPropertyInvalid); | 58 ASSERT(property != CSSPropertyInvalid); |
| 59 if (CSSAnimations::isAnimatableProperty(property)) | 59 if (CSSAnimations::isAnimatableProperty(property)) |
| 60 m_propertySet->setProperty(property, value, false, styleSheetContents); | 60 m_propertySet->setProperty(property, value, false, styleSheetContents); |
| 61 } | 61 } |
| 62 | 62 |
| 63 void StringKeyframe::setPropertyValue(CSSPropertyID property, PassRefPtrWillBeRa
wPtr<CSSValue> value) | 63 void StringKeyframe::setPropertyValue(CSSPropertyID property, PassRefPtr<CSSValu
e> value) |
| 64 { | 64 { |
| 65 ASSERT(property != CSSPropertyInvalid); | 65 ASSERT(property != CSSPropertyInvalid); |
| 66 ASSERT(CSSAnimations::isAnimatableProperty(property)); | 66 ASSERT(CSSAnimations::isAnimatableProperty(property)); |
| 67 m_propertySet->setProperty(property, value, false); | 67 m_propertySet->setProperty(property, value, false); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void StringKeyframe::setPropertyValue(const QualifiedName& attributeName, const
String& value, Element* element) | 70 void StringKeyframe::setPropertyValue(const QualifiedName& attributeName, const
String& value, Element* element) |
| 71 { | 71 { |
| 72 ASSERT(element->isSVGElement()); | 72 ASSERT(element->isSVGElement()); |
| 73 m_svgPropertyMap.set(&attributeName, value); | 73 m_svgPropertyMap.set(&attributeName, value); |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 | 496 |
| 497 PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> StringKeyframe::CSSPr
opertySpecificKeyframe::cloneWithOffset(double offset) const | 497 PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> StringKeyframe::CSSPr
opertySpecificKeyframe::cloneWithOffset(double offset) const |
| 498 { | 498 { |
| 499 Keyframe::PropertySpecificKeyframe* theClone = new CSSPropertySpecificKeyfra
me(offset, m_easing, m_value.get()); | 499 Keyframe::PropertySpecificKeyframe* theClone = new CSSPropertySpecificKeyfra
me(offset, m_easing, m_value.get()); |
| 500 toCSSPropertySpecificKeyframe(theClone)->m_animatableValueCache = m_animatab
leValueCache; | 500 toCSSPropertySpecificKeyframe(theClone)->m_animatableValueCache = m_animatab
leValueCache; |
| 501 return adoptPtrWillBeNoop(theClone); | 501 return adoptPtrWillBeNoop(theClone); |
| 502 } | 502 } |
| 503 | 503 |
| 504 DEFINE_TRACE(StringKeyframe::CSSPropertySpecificKeyframe) | 504 DEFINE_TRACE(StringKeyframe::CSSPropertySpecificKeyframe) |
| 505 { | 505 { |
| 506 visitor->trace(m_value); | |
| 507 visitor->trace(m_animatableValueCache); | 506 visitor->trace(m_animatableValueCache); |
| 508 Keyframe::PropertySpecificKeyframe::trace(visitor); | 507 Keyframe::PropertySpecificKeyframe::trace(visitor); |
| 509 } | 508 } |
| 510 | 509 |
| 511 SVGPropertySpecificKeyframe::SVGPropertySpecificKeyframe(double offset, PassRefP
tr<TimingFunction> easing, const String& value, EffectModel::CompositeOperation
op) | 510 SVGPropertySpecificKeyframe::SVGPropertySpecificKeyframe(double offset, PassRefP
tr<TimingFunction> easing, const String& value, EffectModel::CompositeOperation
op) |
| 512 : Keyframe::PropertySpecificKeyframe(offset, easing, op) | 511 : Keyframe::PropertySpecificKeyframe(offset, easing, op) |
| 513 , m_value(value) | 512 , m_value(value) |
| 514 { | 513 { |
| 515 } | 514 } |
| 516 | 515 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 RefPtrWillBeRawPtr<SVGPropertyBase> fromValue = attribute->currentValueBase(
)->cloneForAnimation(m_value); | 599 RefPtrWillBeRawPtr<SVGPropertyBase> fromValue = attribute->currentValueBase(
)->cloneForAnimation(m_value); |
| 601 RefPtrWillBeRawPtr<SVGPropertyBase> toValue = attribute->currentValueBase()-
>cloneForAnimation(toSVGPropertySpecificKeyframe(end).value()); | 600 RefPtrWillBeRawPtr<SVGPropertyBase> toValue = attribute->currentValueBase()-
>cloneForAnimation(toSVGPropertySpecificKeyframe(end).value()); |
| 602 | 601 |
| 603 if (!fromValue || !toValue) | 602 if (!fromValue || !toValue) |
| 604 return nullptr; | 603 return nullptr; |
| 605 | 604 |
| 606 return createSVGInterpolation(fromValue.get(), toValue.get(), attribute.get(
)); | 605 return createSVGInterpolation(fromValue.get(), toValue.get(), attribute.get(
)); |
| 607 } | 606 } |
| 608 | 607 |
| 609 } // namespace blink | 608 } // namespace blink |
| OLD | NEW |