| 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 "core/animation/StringKeyframe.h" | 5 #include "core/animation/StringKeyframe.h" |
| 6 | 6 |
| 7 #include "core/StylePropertyShorthand.h" | 7 #include "core/StylePropertyShorthand.h" |
| 8 #include "core/animation/css/CSSAnimations.h" | 8 #include "core/animation/css/CSSAnimations.h" |
| 9 #include "core/css/CSSCustomPropertyDeclaration.h" | 9 #include "core/css/CSSCustomPropertyDeclaration.h" |
| 10 #include "core/css/CSSPropertyMetadata.h" | 10 #include "core/css/CSSPropertyMetadata.h" |
| 11 #include "core/css/resolver/StyleResolver.h" | 11 #include "core/css/resolver/StyleResolver.h" |
| 12 #include "core/style/ComputedStyle.h" | 12 #include "core/style/ComputedStyle.h" |
| 13 #include "core/svg/SVGElement.h" | 13 #include "core/svg/SVGElement.h" |
| 14 #include "platform/RuntimeEnabledFeatures.h" | 14 #include "platform/RuntimeEnabledFeatures.h" |
| 15 | 15 |
| 16 namespace blink { | 16 namespace blink { |
| 17 | 17 |
| 18 StringKeyframe::StringKeyframe(const StringKeyframe& copyFrom) | 18 StringKeyframe::StringKeyframe(const StringKeyframe& copyFrom) |
| 19 : Keyframe(copyFrom.m_offset, copyFrom.m_composite, copyFrom.m_easing), | 19 : Keyframe(copyFrom.m_offset, copyFrom.m_composite, copyFrom.m_easing), |
| 20 m_cssPropertyMap(copyFrom.m_cssPropertyMap->mutableCopy()), | 20 m_cssPropertyMap(copyFrom.m_cssPropertyMap->mutableCopy()), |
| 21 m_presentationAttributeMap( | 21 m_presentationAttributeMap( |
| 22 copyFrom.m_presentationAttributeMap->mutableCopy()), | 22 copyFrom.m_presentationAttributeMap->mutableCopy()), |
| 23 m_svgAttributeMap(copyFrom.m_svgAttributeMap) {} | 23 m_svgAttributeMap(copyFrom.m_svgAttributeMap) {} |
| 24 | 24 |
| 25 void StringKeyframe::setCSSPropertyValue( | 25 void StringKeyframe::setCSSPropertyValue( |
| 26 const AtomicString& propertyName, | 26 const AtomicString& propertyName, |
| 27 const String& value, | 27 const String& value, |
| 28 StyleSheetContents* styleSheetContents) { | 28 StyleSheetContents* styleSheetContents) { |
| 29 m_cssPropertyMap->setProperty(propertyName, value, false, styleSheetContents); | 29 bool isAnimationTainted = true; |
| 30 m_cssPropertyMap->setProperty(propertyName, value, false, styleSheetContents, |
| 31 isAnimationTainted); |
| 30 } | 32 } |
| 31 | 33 |
| 32 void StringKeyframe::setCSSPropertyValue( | 34 void StringKeyframe::setCSSPropertyValue( |
| 33 CSSPropertyID property, | 35 CSSPropertyID property, |
| 34 const String& value, | 36 const String& value, |
| 35 StyleSheetContents* styleSheetContents) { | 37 StyleSheetContents* styleSheetContents) { |
| 36 DCHECK_NE(property, CSSPropertyInvalid); | 38 DCHECK_NE(property, CSSPropertyInvalid); |
| 37 if (CSSAnimations::isAnimatableProperty(property)) | 39 if (!CSSAnimations::isAnimationAffectingProperty(property)) |
| 38 m_cssPropertyMap->setProperty(property, value, false, styleSheetContents); | 40 m_cssPropertyMap->setProperty(property, value, false, styleSheetContents); |
| 39 } | 41 } |
| 40 | 42 |
| 41 void StringKeyframe::setCSSPropertyValue(CSSPropertyID property, | 43 void StringKeyframe::setCSSPropertyValue(CSSPropertyID property, |
| 42 const CSSValue& value) { | 44 const CSSValue& value) { |
| 43 DCHECK_NE(property, CSSPropertyInvalid); | 45 DCHECK_NE(property, CSSPropertyInvalid); |
| 44 DCHECK(CSSAnimations::isAnimatableProperty(property)); | 46 DCHECK(!CSSAnimations::isAnimationAffectingProperty(property)); |
| 45 m_cssPropertyMap->setProperty(property, value, false); | 47 m_cssPropertyMap->setProperty(property, value, false); |
| 46 } | 48 } |
| 47 | 49 |
| 48 void StringKeyframe::setPresentationAttributeValue( | 50 void StringKeyframe::setPresentationAttributeValue( |
| 49 CSSPropertyID property, | 51 CSSPropertyID property, |
| 50 const String& value, | 52 const String& value, |
| 51 StyleSheetContents* styleSheetContents) { | 53 StyleSheetContents* styleSheetContents) { |
| 52 DCHECK_NE(property, CSSPropertyInvalid); | 54 DCHECK_NE(property, CSSPropertyInvalid); |
| 53 if (CSSAnimations::isAnimatableProperty(property)) | 55 if (!CSSAnimations::isAnimationAffectingProperty(property)) |
| 54 m_presentationAttributeMap->setProperty(property, value, false, | 56 m_presentationAttributeMap->setProperty(property, value, false, |
| 55 styleSheetContents); | 57 styleSheetContents); |
| 56 } | 58 } |
| 57 | 59 |
| 58 void StringKeyframe::setSVGAttributeValue(const QualifiedName& attributeName, | 60 void StringKeyframe::setSVGAttributeValue(const QualifiedName& attributeName, |
| 59 const String& value) { | 61 const String& value) { |
| 60 m_svgAttributeMap.set(&attributeName, value); | 62 m_svgAttributeMap.set(&attributeName, value); |
| 61 } | 63 } |
| 62 | 64 |
| 63 PropertyHandleSet StringKeyframe::properties() const { | 65 PropertyHandleSet StringKeyframe::properties() const { |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 } | 143 } |
| 142 | 144 |
| 143 PassRefPtr<Keyframe::PropertySpecificKeyframe> | 145 PassRefPtr<Keyframe::PropertySpecificKeyframe> |
| 144 SVGPropertySpecificKeyframe::neutralKeyframe( | 146 SVGPropertySpecificKeyframe::neutralKeyframe( |
| 145 double offset, | 147 double offset, |
| 146 PassRefPtr<TimingFunction> easing) const { | 148 PassRefPtr<TimingFunction> easing) const { |
| 147 return create(offset, std::move(easing), String(), EffectModel::CompositeAdd); | 149 return create(offset, std::move(easing), String(), EffectModel::CompositeAdd); |
| 148 } | 150 } |
| 149 | 151 |
| 150 } // namespace blink | 152 } // namespace blink |
| OLD | NEW |