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

Side by Side Diff: sky/engine/core/animation/StringKeyframe.cpp

Issue 860423004: Remove css !important (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 months 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 "sky/engine/config.h" 5 #include "sky/engine/config.h"
6 #include "sky/engine/core/animation/StringKeyframe.h" 6 #include "sky/engine/core/animation/StringKeyframe.h"
7 7
8 #include "sky/engine/core/animation/DefaultStyleInterpolation.h" 8 #include "sky/engine/core/animation/DefaultStyleInterpolation.h"
9 #include "sky/engine/core/animation/DeferredLegacyStyleInterpolation.h" 9 #include "sky/engine/core/animation/DeferredLegacyStyleInterpolation.h"
10 #include "sky/engine/core/animation/LegacyStyleInterpolation.h" 10 #include "sky/engine/core/animation/LegacyStyleInterpolation.h"
11 #include "sky/engine/core/animation/LengthStyleInterpolation.h" 11 #include "sky/engine/core/animation/LengthStyleInterpolation.h"
12 #include "sky/engine/core/animation/css/CSSAnimations.h" 12 #include "sky/engine/core/animation/css/CSSAnimations.h"
13 #include "sky/engine/core/css/CSSPropertyMetadata.h" 13 #include "sky/engine/core/css/CSSPropertyMetadata.h"
14 #include "sky/engine/core/css/resolver/StyleResolver.h" 14 #include "sky/engine/core/css/resolver/StyleResolver.h"
15 #include "sky/engine/core/rendering/style/RenderStyle.h" 15 #include "sky/engine/core/rendering/style/RenderStyle.h"
16 16
17 namespace blink { 17 namespace blink {
18 18
19 StringKeyframe::StringKeyframe(const StringKeyframe& copyFrom) 19 StringKeyframe::StringKeyframe(const StringKeyframe& copyFrom)
20 : Keyframe(copyFrom.m_offset, copyFrom.m_composite, copyFrom.m_easing) 20 : Keyframe(copyFrom.m_offset, copyFrom.m_composite, copyFrom.m_easing)
21 , m_propertySet(copyFrom.m_propertySet->mutableCopy()) 21 , m_propertySet(copyFrom.m_propertySet->mutableCopy())
22 { 22 {
23 } 23 }
24 24
25 void StringKeyframe::setPropertyValue(CSSPropertyID property, const String& valu e, StyleSheetContents* styleSheetContents) 25 void StringKeyframe::setPropertyValue(CSSPropertyID property, const String& valu e, StyleSheetContents* styleSheetContents)
26 { 26 {
27 ASSERT(property != CSSPropertyInvalid); 27 ASSERT(property != CSSPropertyInvalid);
28 if (CSSAnimations::isAllowedAnimation(property)) 28 if (CSSAnimations::isAllowedAnimation(property))
29 m_propertySet->setProperty(property, value, false, styleSheetContents); 29 m_propertySet->setProperty(property, value, styleSheetContents);
30 } 30 }
31 31
32 PropertySet StringKeyframe::properties() const 32 PropertySet StringKeyframe::properties() const
33 { 33 {
34 // This is not used in time-critical code, so we probably don't need to 34 // This is not used in time-critical code, so we probably don't need to
35 // worry about caching this result. 35 // worry about caching this result.
36 PropertySet properties; 36 PropertySet properties;
37 for (unsigned i = 0; i < m_propertySet->propertyCount(); ++i) 37 for (unsigned i = 0; i < m_propertySet->propertyCount(); ++i)
38 properties.add(m_propertySet->propertyAt(i).id()); 38 properties.add(m_propertySet->propertyAt(i).id());
39 return properties; 39 return properties;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 } 130 }
131 131
132 PassOwnPtr<Keyframe::PropertySpecificKeyframe> StringKeyframe::PropertySpecificK eyframe::cloneWithOffset(double offset) const 132 PassOwnPtr<Keyframe::PropertySpecificKeyframe> StringKeyframe::PropertySpecificK eyframe::cloneWithOffset(double offset) const
133 { 133 {
134 Keyframe::PropertySpecificKeyframe* theClone = new PropertySpecificKeyframe( offset, m_easing, m_value.get()); 134 Keyframe::PropertySpecificKeyframe* theClone = new PropertySpecificKeyframe( offset, m_easing, m_value.get());
135 toStringPropertySpecificKeyframe(theClone)->m_animatableValueCache = m_anima tableValueCache; 135 toStringPropertySpecificKeyframe(theClone)->m_animatableValueCache = m_anima tableValueCache;
136 return adoptPtr(theClone); 136 return adoptPtr(theClone);
137 } 137 }
138 138
139 } 139 }
OLDNEW
« no previous file with comments | « sky/engine/core/animation/DeferredLegacyStyleInterpolationTest.cpp ('k') | sky/engine/core/animation/css/CSSAnimations.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698