| Index: Source/core/css/resolver/StyleResolver.cpp
|
| diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp
|
| index 658cd7cbc0972786a38396033b126a077f73ede4..c47c71b30497cc7fc2dc7a7cd9d66d1671796f3e 100644
|
| --- a/Source/core/css/resolver/StyleResolver.cpp
|
| +++ b/Source/core/css/resolver/StyleResolver.cpp
|
| @@ -858,6 +858,26 @@ void StyleResolver::keyframeStylesForAnimation(Element* e, const RenderStyle& el
|
| }
|
| }
|
|
|
| +// This function is used by the WebAnimations JavaScript API method animate().
|
| +// FIXME: Remove this when animate() switches away from resolution-dependent parsing.
|
| +PassRefPtr<KeyframeAnimationEffect> StyleResolver::createKeyframeAnimationEffect(Element& element, const Vector<RefPtr<MutableStylePropertySet> >& propertySetVector, KeyframeAnimationEffect::KeyframeVector& keyframes)
|
| +{
|
| + ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
|
| + ASSERT(propertySetVector.size() == keyframes.size());
|
| +
|
| + StyleResolverState state(element.document(), &element);
|
| + state.setStyle(RenderStyle::create());
|
| +
|
| + 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 KeyframeAnimationEffect::create(keyframes);
|
| +}
|
| +
|
| PassRefPtr<RenderStyle> StyleResolver::pseudoStyleForElement(Element* element, const PseudoStyleRequest& pseudoStyleRequest, RenderStyle* parentStyle)
|
| {
|
| ASSERT(document().frame());
|
|
|