| Index: Source/core/css/resolver/StyleResolver.cpp
|
| diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp
|
| index 504b78502509d41b7da274a79b92bbfd7c250fb5..f4291b3ad89ef6506b352f984f76dba744710b5a 100644
|
| --- a/Source/core/css/resolver/StyleResolver.cpp
|
| +++ b/Source/core/css/resolver/StyleResolver.cpp
|
| @@ -858,6 +858,24 @@ void StyleResolver::keyframeStylesForAnimation(Element* e, const RenderStyle& el
|
| }
|
| }
|
|
|
| +// This function is used by the WebAnimations JavaScript API method animate().
|
| +void StyleResolver::setKeyframePropertyValues(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());
|
| + }
|
| + }
|
| +}
|
| +
|
| PassRefPtr<RenderStyle> StyleResolver::pseudoStyleForElement(Element* e, const PseudoStyleRequest& pseudoStyleRequest, RenderStyle* parentStyle)
|
| {
|
| ASSERT(document().frame());
|
|
|