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

Unified Diff: Source/core/css/resolver/StyleResolver.cpp

Issue 194733002: Web Animations: Use StringKeyframes for element.animate() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: More comments Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/resolver/StyleResolver.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleResolver.cpp
diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp
index 28f9d5d8aceb46e24e8d19821f7cd6303c66b4a8..4f4ca9032757a21b051b068a6b8f5c47a23f7604 100644
--- a/Source/core/css/resolver/StyleResolver.cpp
+++ b/Source/core/css/resolver/StyleResolver.cpp
@@ -747,22 +747,15 @@ PassRefPtr<RenderStyle> StyleResolver::styleForKeyframe(Element* element, const
// This function is used by the WebAnimations JavaScript API method animate().
// FIXME: Remove this when animate() switches away from resolution-dependent parsing.
-PassRefPtrWillBeRawPtr<AnimatableValueKeyframeEffectModel> StyleResolver::createKeyframeEffectModel(Element& element, const WillBeHeapVector<RefPtrWillBeMember<MutableStylePropertySet> >& propertySetVector, AnimatableValueKeyframeVector& keyframes)
+PassRefPtrWillBeRawPtr<AnimatableValue> StyleResolver::createAnimatableValueSnapshot(Element& element, CSSPropertyID property, CSSValue* value)
{
- ASSERT(propertySetVector.size() == keyframes.size());
-
+ // We use a fresh RenderStyle here because certain values (eg. background-position) won't always completely replace the previously applied property.
+ RefPtr<RenderStyle> style = element.renderStyle() ? RenderStyle::clone(element.renderStyle()) : RenderStyle::create();
StyleResolverState state(element.document(), &element);
- state.setStyle(RenderStyle::create());
+ state.setStyle(style.get());
state.fontBuilder().initForStyleResolve(state.document(), state.style(), state.useSVGZoomRules());
-
- for (unsigned i = 0; i < propertySetVector.size(); ++i) {
- for (unsigned j = 0; j < propertySetVector[i]->propertyCount(); ++j) {
- CSSPropertyID id = propertySetVector[i]->propertyAt(j).id();
- StyleBuilder::applyProperty(id, state, propertySetVector[i]->getPropertyCSSValue(id).get());
- keyframes[i]->setPropertyValue(id, CSSAnimatableValueFactory::create(id, *state.style()).get());
- }
- }
- return AnimatableValueKeyframeEffectModel::create(keyframes);
+ StyleBuilder::applyProperty(property, state, value);
+ return CSSAnimatableValueFactory::create(property, *style);
}
PassRefPtr<PseudoElement> StyleResolver::createPseudoElementIfNeeded(Element& parent, PseudoId pseudoId)
« no previous file with comments | « Source/core/css/resolver/StyleResolver.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698