Chromium Code Reviews| 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..ff7c260b6e1ac379543d3e80ac66898ff7c95eab 100644 |
| --- a/Source/core/css/resolver/StyleResolver.cpp |
| +++ b/Source/core/css/resolver/StyleResolver.cpp |
| @@ -858,6 +858,25 @@ void StyleResolver::keyframeStylesForAnimation(Element* e, const RenderStyle& el |
| } |
| } |
| +// This function is used by the WebAnimations JavaScript API method animate(). |
| +void StyleResolver::setKeyframePropertyValues(KeyframeAnimationEffect::KeyframeVector& keyframes, Vector<RefPtr<MutableStylePropertySet> >& propertySetVector, Element* element) |
|
Steve Block
2013/12/09 03:11:15
Can propertySetVector and element be const? Also,
rjwright
2013/12/09 09:04:02
Done.
propertySetVector yes, element no.
|
| +{ |
| + ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); |
| + ASSERT(propertySetVector.size() == keyframes.size()); |
| + |
| + StyleResolverState state(element->document(), element); |
| + RefPtr<RenderStyle> style = RenderStyle::clone(element->computedStyle()); |
|
Steve Block
2013/12/09 03:11:15
As discussed, I don't think this is required - we
rjwright
2013/12/09 09:04:02
Done.
|
| + state.setStyle(style); |
| + |
| + 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, *style.get()).get()); |
| + } |
| + } |
| +} |
| + |
| PassRefPtr<RenderStyle> StyleResolver::pseudoStyleForElement(Element* e, const PseudoStyleRequest& pseudoStyleRequest, RenderStyle* parentStyle) |
| { |
| ASSERT(document().frame()); |