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

Unified Diff: sky/engine/core/css/resolver/StyleResolver.cpp

Issue 1229273004: Remove Animations and Transitions. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 5 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 | « sky/engine/core/css/resolver/StyleResolver.h ('k') | sky/engine/core/css/resolver/StyleResolverState.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/css/resolver/StyleResolver.cpp
diff --git a/sky/engine/core/css/resolver/StyleResolver.cpp b/sky/engine/core/css/resolver/StyleResolver.cpp
index 852151989f5ab2c2942ade14b385bd39c1f5af12..d45fa9649de8309b181d59f821ca26f595f20025 100644
--- a/sky/engine/core/css/resolver/StyleResolver.cpp
+++ b/sky/engine/core/css/resolver/StyleResolver.cpp
@@ -32,13 +32,6 @@
#include "gen/sky/core/MediaTypeNames.h"
#include "gen/sky/core/StylePropertyShorthand.h"
#include "gen/sky/platform/RuntimeEnabledFeatures.h"
-#include "sky/engine/core/animation/ActiveAnimations.h"
-#include "sky/engine/core/animation/Animation.h"
-#include "sky/engine/core/animation/AnimationTimeline.h"
-#include "sky/engine/core/animation/StyleInterpolation.h"
-#include "sky/engine/core/animation/animatable/AnimatableValue.h"
-#include "sky/engine/core/animation/css/CSSAnimatableValueFactory.h"
-#include "sky/engine/core/animation/css/CSSAnimations.h"
#include "sky/engine/core/css/CSSCalculationValue.h"
#include "sky/engine/core/css/CSSFontSelector.h"
#include "sky/engine/core/css/CSSSelector.h"
@@ -51,7 +44,6 @@
#include "sky/engine/core/css/StylePropertySet.h"
#include "sky/engine/core/css/StyleSheetContents.h"
#include "sky/engine/core/css/parser/BisonCSSParser.h"
-#include "sky/engine/core/css/resolver/AnimatedStyleBuilder.h"
#include "sky/engine/core/css/resolver/MatchResult.h"
#include "sky/engine/core/css/resolver/SharedStyleFinder.h"
#include "sky/engine/core/css/resolver/StyleAdjuster.h"
@@ -69,20 +61,6 @@
#include "sky/engine/wtf/LeakAnnotations.h"
#include "sky/engine/wtf/StdLibExtras.h"
-namespace {
-
-using namespace blink;
-
-void setAnimationUpdateIfNeeded(StyleResolverState& state, Element& element)
-{
- // If any changes to CSS Animations were detected, stash the update away for application after the
- // render object is updated if we're in the appropriate scope.
- if (state.animationUpdate())
- element.ensureActiveAnimations().cssAnimations().setPendingUpdate(state.takeAnimationUpdate());
-}
-
-} // namespace
-
namespace blink {
static RuleSet& defaultStyles()
@@ -228,11 +206,6 @@ PassRefPtr<RenderStyle> StyleResolver::styleForElement(Element* element, RenderS
StyleAdjuster adjuster;
adjuster.adjustRenderStyle(state.style(), state.parentStyle(), *element);
- if (applyAnimatedProperties(state, element))
- adjuster.adjustRenderStyle(state.style(), state.parentStyle(), *element);
-
- setAnimationUpdateIfNeeded(state, *element);
-
if (state.style()->hasViewportUnits())
m_document.setHasViewportUnits();
@@ -240,27 +213,6 @@ PassRefPtr<RenderStyle> StyleResolver::styleForElement(Element* element, RenderS
return state.takeStyle();
}
-// This function is used by the WebAnimations JavaScript API method animate().
-// FIXME: Remove this when animate() switches away from resolution-dependent parsing.
-PassRefPtr<AnimatableValue> StyleResolver::createAnimatableValueSnapshot(Element& element, CSSPropertyID property, CSSValue& value)
-{
- RefPtr<RenderStyle> style;
- if (element.renderStyle())
- style = RenderStyle::clone(element.renderStyle());
- else
- style = RenderStyle::create();
- StyleResolverState state(element.document(), &element);
- state.setStyle(style);
- state.fontBuilder().initForStyleResolve(state.document(), state.style());
- return createAnimatableValueSnapshot(state, property, value);
-}
-
-PassRefPtr<AnimatableValue> StyleResolver::createAnimatableValueSnapshot(StyleResolverState& state, CSSPropertyID property, CSSValue& value)
-{
- StyleBuilder::applyProperty(property, state, &value);
- return CSSAnimatableValueFactory::create(property, *state.style());
-}
-
PassRefPtr<RenderStyle> StyleResolver::defaultStyleForElement()
{
StyleResolverState state(m_document, nullptr);
@@ -290,54 +242,6 @@ void StyleResolver::updateFont(StyleResolverState& state)
state.style()->setHasViewportUnits();
}
-// -------------------------------------------------------------------------------------
-// this is mostly boring stuff on how to apply a certain rule to the renderstyle...
-
-bool StyleResolver::applyAnimatedProperties(StyleResolverState& state, Element* animatingElement)
-{
- const Element* element = state.element();
- ASSERT(element);
-
- // The animating element may be this element, or its pseudo element. It is
- // null when calculating the style for a potential pseudo element that has
- // yet to be created.
- ASSERT(animatingElement == element || !animatingElement || animatingElement->parentOrShadowHostElement() == element);
-
- if (!(animatingElement && animatingElement->hasActiveAnimations())
- && !state.style()->transitions() && !state.style()->animations())
- return false;
-
- state.setAnimationUpdate(CSSAnimations::calculateUpdate(animatingElement, *element, *state.style(), state.parentStyle()));
- if (!state.animationUpdate())
- return false;
-
- const HashMap<CSSPropertyID, RefPtr<Interpolation> >& activeInterpolationsForAnimations = state.animationUpdate()->activeInterpolationsForAnimations();
- const HashMap<CSSPropertyID, RefPtr<Interpolation> >& activeInterpolationsForTransitions = state.animationUpdate()->activeInterpolationsForTransitions();
- applyAnimatedProperties<HighPriorityProperties>(state, activeInterpolationsForAnimations);
- applyAnimatedProperties<HighPriorityProperties>(state, activeInterpolationsForTransitions);
-
- updateFont(state);
-
- applyAnimatedProperties<LowPriorityProperties>(state, activeInterpolationsForAnimations);
- applyAnimatedProperties<LowPriorityProperties>(state, activeInterpolationsForTransitions);
-
- ASSERT(!state.fontBuilder().fontDirty());
-
- return true;
-}
-
-template <StyleResolver::StyleApplicationPass pass>
-void StyleResolver::applyAnimatedProperties(StyleResolverState& state, const HashMap<CSSPropertyID, RefPtr<Interpolation> >& activeInterpolations)
-{
- for (HashMap<CSSPropertyID, RefPtr<Interpolation> >::const_iterator iter = activeInterpolations.begin(); iter != activeInterpolations.end(); ++iter) {
- CSSPropertyID property = iter->key;
- if (!isPropertyForPass<pass>(property))
- continue;
- const StyleInterpolation* interpolation = toStyleInterpolation(iter->value.get());
- interpolation->apply(state);
- }
-}
-
// FIXME: Consider refactoring to create a new class which owns the following
// first/last/range properties.
// This method returns the first CSSPropertyId of high priority properties.
« no previous file with comments | « sky/engine/core/css/resolver/StyleResolver.h ('k') | sky/engine/core/css/resolver/StyleResolverState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698