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

Side by Side Diff: Source/core/animation/KeyframeEffectModel.cpp

Issue 948583003: Use StringKeyframes to make CSS Animations responsive to style changes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 5 years, 9 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 | Annotate | Revision Log
OLDNEW
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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 { 77 {
78 ensureKeyframeGroups(); 78 ensureKeyframeGroups();
79 for (CSSPropertyID property : CompositorAnimations::CompositableProperties) { 79 for (CSSPropertyID property : CompositorAnimations::CompositableProperties) {
80 if (!affects(property)) 80 if (!affects(property))
81 continue; 81 continue;
82 for (auto& keyframe : m_keyframeGroups->get(property)->m_keyframes) 82 for (auto& keyframe : m_keyframeGroups->get(property)->m_keyframes)
83 keyframe->ensureAnimatableValue(property, element, baseStyle); 83 keyframe->ensureAnimatableValue(property, element, baseStyle);
84 } 84 }
85 } 85 }
86 86
87 void KeyframeEffectModelBase::updateNeutralKeyframeAnimatableValues(CSSPropertyI D property, PassRefPtrWillBeRawPtr<AnimatableValue> value) 87 bool KeyframeEffectModelBase::updateNeutralKeyframeAnimatableValues(CSSPropertyI D property, PassRefPtrWillBeRawPtr<AnimatableValue> value)
88 { 88 {
89 ASSERT(CompositorAnimations::isCompositableProperty(property)); 89 ASSERT(CompositorAnimations::isCompositableProperty(property));
90 90
91 if (!value) 91 if (!value)
92 return; 92 return false;
93 93
94 ensureKeyframeGroups(); 94 ensureKeyframeGroups();
95 auto& keyframes = m_keyframeGroups->get(property)->m_keyframes; 95 auto& keyframes = m_keyframeGroups->get(property)->m_keyframes;
96 ASSERT(keyframes.size() >= 2); 96 ASSERT(keyframes.size() >= 2);
97 97
98 auto& first = toStringPropertySpecificKeyframe(*keyframes.first()); 98 auto& first = toStringPropertySpecificKeyframe(*keyframes.first());
99 auto& last = toStringPropertySpecificKeyframe(*keyframes.last()); 99 auto& last = toStringPropertySpecificKeyframe(*keyframes.last());
100 ASSERT(!first.value() || !last.value());
101 100
102 if (!first.value()) 101 if (!first.value())
103 first.setAnimatableValue(value); 102 first.setAnimatableValue(value);
104 if (!last.value()) 103 if (!last.value())
105 last.setAnimatableValue(value); 104 last.setAnimatableValue(value);
105 return !first.value() || !last.value();
106 } 106 }
107 107
108 KeyframeEffectModelBase::KeyframeVector KeyframeEffectModelBase::normalizedKeyfr ames(const KeyframeVector& keyframes) 108 KeyframeEffectModelBase::KeyframeVector KeyframeEffectModelBase::normalizedKeyfr ames(const KeyframeVector& keyframes)
109 { 109 {
110 double lastOffset = 0; 110 double lastOffset = 0;
111 KeyframeVector result; 111 KeyframeVector result;
112 result.reserveCapacity(keyframes.size()); 112 result.reserveCapacity(keyframes.size());
113 113
114 for (const auto& keyframe : keyframes) { 114 for (const auto& keyframe : keyframes) {
115 double offset = keyframe->offset(); 115 double offset = keyframe->offset();
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 } 269 }
270 270
271 DEFINE_TRACE(KeyframeEffectModelBase::PropertySpecificKeyframeGroup) 271 DEFINE_TRACE(KeyframeEffectModelBase::PropertySpecificKeyframeGroup)
272 { 272 {
273 #if ENABLE(OILPAN) 273 #if ENABLE(OILPAN)
274 visitor->trace(m_keyframes); 274 visitor->trace(m_keyframes);
275 #endif 275 #endif
276 } 276 }
277 277
278 } // namespace 278 } // namespace
OLDNEW
« no previous file with comments | « Source/core/animation/KeyframeEffectModel.h ('k') | Source/core/animation/css/CSSAnimations.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698