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

Side by Side Diff: Source/core/css/resolver/StyleResolver.cpp

Issue 216603008: Revert "Web Animations: Introduce String based KeyframeEffectModel" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/css/resolver/StyleResolver.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 780
781 loadPendingResources(state); 781 loadPendingResources(state);
782 782
783 didAccess(); 783 didAccess();
784 784
785 return state.takeStyle(); 785 return state.takeStyle();
786 } 786 }
787 787
788 // This function is used by the WebAnimations JavaScript API method animate(). 788 // This function is used by the WebAnimations JavaScript API method animate().
789 // FIXME: Remove this when animate() switches away from resolution-dependent par sing. 789 // FIXME: Remove this when animate() switches away from resolution-dependent par sing.
790 PassRefPtrWillBeRawPtr<AnimatableValueKeyframeEffectModel> StyleResolver::create KeyframeEffectModel(Element& element, const WillBeHeapVector<RefPtrWillBeMember< MutableStylePropertySet> >& propertySetVector, AnimatableValueKeyframeVector& ke yframes) 790 PassRefPtrWillBeRawPtr<KeyframeEffectModel> StyleResolver::createKeyframeEffectM odel(Element& element, const WillBeHeapVector<RefPtrWillBeMember<MutableStylePro pertySet> >& propertySetVector, KeyframeEffectModel::KeyframeVector& keyframes)
791 { 791 {
792 ASSERT(propertySetVector.size() == keyframes.size()); 792 ASSERT(propertySetVector.size() == keyframes.size());
793 793
794 StyleResolverState state(element.document(), &element); 794 StyleResolverState state(element.document(), &element);
795 state.setStyle(RenderStyle::create()); 795 state.setStyle(RenderStyle::create());
796 state.fontBuilder().initForStyleResolve(state.document(), state.style(), sta te.useSVGZoomRules()); 796 state.fontBuilder().initForStyleResolve(state.document(), state.style(), sta te.useSVGZoomRules());
797 797
798 for (unsigned i = 0; i < propertySetVector.size(); ++i) { 798 for (unsigned i = 0; i < propertySetVector.size(); ++i) {
799 for (unsigned j = 0; j < propertySetVector[i]->propertyCount(); ++j) { 799 for (unsigned j = 0; j < propertySetVector[i]->propertyCount(); ++j) {
800 CSSPropertyID id = propertySetVector[i]->propertyAt(j).id(); 800 CSSPropertyID id = propertySetVector[i]->propertyAt(j).id();
801 StyleBuilder::applyProperty(id, state, propertySetVector[i]->getProp ertyCSSValue(id).get()); 801 StyleBuilder::applyProperty(id, state, propertySetVector[i]->getProp ertyCSSValue(id).get());
802 keyframes[i]->setPropertyValue(id, CSSAnimatableValueFactory::create (id, *state.style()).get()); 802 keyframes[i]->setPropertyValue(id, CSSAnimatableValueFactory::create (id, *state.style()).get());
803 } 803 }
804 } 804 }
805 return AnimatableValueKeyframeEffectModel::create(keyframes); 805
806 return KeyframeEffectModel::create(keyframes);
806 } 807 }
807 808
808 PassRefPtr<PseudoElement> StyleResolver::createPseudoElementIfNeeded(Element& pa rent, PseudoId pseudoId) 809 PassRefPtr<PseudoElement> StyleResolver::createPseudoElementIfNeeded(Element& pa rent, PseudoId pseudoId)
809 { 810 {
810 RenderObject* parentRenderer = parent.renderer(); 811 RenderObject* parentRenderer = parent.renderer();
811 if (!parentRenderer) 812 if (!parentRenderer)
812 return nullptr; 813 return nullptr;
813 814
814 if (pseudoId < FIRST_INTERNAL_PSEUDOID && !parentRenderer->style()->hasPseud oStyle(pseudoId)) 815 if (pseudoId < FIRST_INTERNAL_PSEUDOID && !parentRenderer->style()->hasPseud oStyle(pseudoId))
815 return nullptr; 816 return nullptr;
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
1092 1093
1093 template <StyleResolver::StyleApplicationPass pass> 1094 template <StyleResolver::StyleApplicationPass pass>
1094 void StyleResolver::applyAnimatedProperties(StyleResolverState& state, const Wil lBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation> >& activeInterpo lations) 1095 void StyleResolver::applyAnimatedProperties(StyleResolverState& state, const Wil lBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation> >& activeInterpo lations)
1095 { 1096 {
1096 ASSERT(pass != AnimationProperties); 1097 ASSERT(pass != AnimationProperties);
1097 1098
1098 for (WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation> >::c onst_iterator iter = activeInterpolations.begin(); iter != activeInterpolations. end(); ++iter) { 1099 for (WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation> >::c onst_iterator iter = activeInterpolations.begin(); iter != activeInterpolations. end(); ++iter) {
1099 CSSPropertyID property = iter->key; 1100 CSSPropertyID property = iter->key;
1100 if (!isPropertyForPass<pass>(property)) 1101 if (!isPropertyForPass<pass>(property))
1101 continue; 1102 continue;
1102 const StyleInterpolation* interpolation = toStyleInterpolation(iter->val ue.get()); 1103 const StyleInterpolation *interpolation = toStyleInterpolation(iter->val ue.get());
1103 interpolation->apply(state); 1104 interpolation->apply(state);
1104 } 1105 }
1105 } 1106 }
1106 1107
1107 static inline bool isValidCueStyleProperty(CSSPropertyID id) 1108 static inline bool isValidCueStyleProperty(CSSPropertyID id)
1108 { 1109 {
1109 switch (id) { 1110 switch (id) {
1110 case CSSPropertyBackground: 1111 case CSSPropertyBackground:
1111 case CSSPropertyBackgroundAttachment: 1112 case CSSPropertyBackgroundAttachment:
1112 case CSSPropertyBackgroundClip: 1113 case CSSPropertyBackgroundClip:
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
1419 visitor->trace(m_keyframesRuleMap); 1420 visitor->trace(m_keyframesRuleMap);
1420 visitor->trace(m_viewportDependentMediaQueryResults); 1421 visitor->trace(m_viewportDependentMediaQueryResults);
1421 visitor->trace(m_viewportStyleResolver); 1422 visitor->trace(m_viewportStyleResolver);
1422 visitor->trace(m_siblingRuleSet); 1423 visitor->trace(m_siblingRuleSet);
1423 visitor->trace(m_uncommonAttributeRuleSet); 1424 visitor->trace(m_uncommonAttributeRuleSet);
1424 visitor->trace(m_watchedSelectorsRules); 1425 visitor->trace(m_watchedSelectorsRules);
1425 visitor->trace(m_treeBoundaryCrossingRules); 1426 visitor->trace(m_treeBoundaryCrossingRules);
1426 } 1427 }
1427 1428
1428 } // namespace WebCore 1429 } // namespace WebCore
OLDNEW
« 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