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

Side by Side Diff: third_party/WebKit/Source/core/animation/StringKeyframe.cpp

Issue 2524303002: Emit console warning when element.animate() keyframe value fails to parse (Closed)
Patch Set: Review changes Created 4 years 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
OLDNEW
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 MutableStylePropertySet::SetResult 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 bool isAnimationTainted = true; 29 bool isAnimationTainted = true;
30 m_cssPropertyMap->setProperty(propertyName, value, false, styleSheetContents, 30 return m_cssPropertyMap->setProperty(propertyName, value, false,
31 isAnimationTainted); 31 styleSheetContents, isAnimationTainted);
32 } 32 }
33 33
34 void StringKeyframe::setCSSPropertyValue( 34 MutableStylePropertySet::SetResult StringKeyframe::setCSSPropertyValue(
35 CSSPropertyID property, 35 CSSPropertyID property,
36 const String& value, 36 const String& value,
37 StyleSheetContents* styleSheetContents) { 37 StyleSheetContents* styleSheetContents) {
38 DCHECK_NE(property, CSSPropertyInvalid); 38 DCHECK_NE(property, CSSPropertyInvalid);
39 if (!CSSAnimations::isAnimationAffectingProperty(property)) 39 if (CSSAnimations::isAnimationAffectingProperty(property)) {
40 m_cssPropertyMap->setProperty(property, value, false, styleSheetContents); 40 bool didParse = true;
41 bool didChange = false;
42 return MutableStylePropertySet::SetResult{didParse, didChange};
43 }
44 return m_cssPropertyMap->setProperty(property, value, false,
45 styleSheetContents);
41 } 46 }
42 47
43 void StringKeyframe::setCSSPropertyValue(CSSPropertyID property, 48 void StringKeyframe::setCSSPropertyValue(CSSPropertyID property,
44 const CSSValue& value) { 49 const CSSValue& value) {
45 DCHECK_NE(property, CSSPropertyInvalid); 50 DCHECK_NE(property, CSSPropertyInvalid);
46 DCHECK(!CSSAnimations::isAnimationAffectingProperty(property)); 51 DCHECK(!CSSAnimations::isAnimationAffectingProperty(property));
47 m_cssPropertyMap->setProperty(property, value, false); 52 m_cssPropertyMap->setProperty(property, value, false);
48 } 53 }
49 54
50 void StringKeyframe::setPresentationAttributeValue( 55 void StringKeyframe::setPresentationAttributeValue(
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 } 148 }
144 149
145 PassRefPtr<Keyframe::PropertySpecificKeyframe> 150 PassRefPtr<Keyframe::PropertySpecificKeyframe>
146 SVGPropertySpecificKeyframe::neutralKeyframe( 151 SVGPropertySpecificKeyframe::neutralKeyframe(
147 double offset, 152 double offset,
148 PassRefPtr<TimingFunction> easing) const { 153 PassRefPtr<TimingFunction> easing) const {
149 return create(offset, std::move(easing), String(), EffectModel::CompositeAdd); 154 return create(offset, std::move(easing), String(), EffectModel::CompositeAdd);
150 } 155 }
151 156
152 } // namespace blink 157 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/animation/StringKeyframe.h ('k') | third_party/WebKit/Source/core/css/DOMWindowCSS.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698