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

Unified Diff: third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp

Issue 2730683002: Add CSS Transition support to registered custom properties (Closed)
Patch Set: comments Created 3 years, 9 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 | « third_party/WebKit/Source/core/css/CSSPropertyEquality.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
index e2eb51d4618f7b030444761207e8a611c26c9805..073d8ac7772ee47c739e2aa454d51bf1ca1bd395 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
@@ -1115,8 +1115,9 @@ bool StyleResolver::applyAnimatedStandardProperties(
CSSAnimations::calculateCompositorAnimationUpdate(
state.animationUpdate(), animatingElement, *element, *state.style(),
state.parentStyle(), wasViewportResized());
- CSSAnimations::calculateTransitionUpdate(state.animationUpdate(),
- animatingElement, *state.style());
+ CSSAnimations::calculateTransitionUpdate(
+ state.animationUpdate(), CSSAnimations::PropertyPass::Standard,
+ animatingElement, *state.style());
CSSAnimations::snapshotCompositorKeyframes(
*element, state.animationUpdate(), *state.style(), state.parentStyle());
@@ -1612,7 +1613,7 @@ void StyleResolver::applyMatchedPropertiesAndCustomPropertyAnimations(
applyMatchedAnimationProperties(state, matchResult, cacheSuccess,
needsApplyPass);
}
- if (state.style()->animations() ||
+ if (state.style()->animations() || state.style()->transitions() ||
(animatingElement && animatingElement->hasAnimations())) {
calculateAnimationUpdate(state, animatingElement);
if (state.isAnimatingCustomProperties()) {
@@ -1704,6 +1705,9 @@ void StyleResolver::applyCustomProperties(StyleResolverState& state,
if (applyAnimations == IncludeAnimations) {
applyAnimatedProperties<ResolveVariables>(
state, state.animationUpdate().activeInterpolationsForAnimations());
+ applyAnimatedProperties<ResolveVariables>(
+ state,
+ state.animationUpdate().activeInterpolationsForCustomTransitions());
}
// TODO(leviw): stop recalculating every time
CSSVariableResolver::resolveVariableDefinitions(state);
@@ -1720,6 +1724,9 @@ void StyleResolver::applyCustomProperties(StyleResolverState& state,
if (applyAnimations == IncludeAnimations) {
applyAnimatedProperties<ResolveVariables>(
state, state.animationUpdate().activeInterpolationsForAnimations());
+ applyAnimatedProperties<ResolveVariables>(
+ state,
+ state.animationUpdate().activeInterpolationsForCustomTransitions());
}
CSSVariableResolver::resolveVariableDefinitions(state);
}
@@ -1742,18 +1749,28 @@ void StyleResolver::applyMatchedAnimationProperties(
void StyleResolver::calculateAnimationUpdate(StyleResolverState& state,
const Element* animatingElement) {
- DCHECK(state.style()->animations() ||
+ DCHECK(state.style()->animations() || state.style()->transitions() ||
(animatingElement && animatingElement->hasAnimations()));
DCHECK(!state.isAnimationInterpolationMapReady());
CSSAnimations::calculateAnimationUpdate(
state.animationUpdate(), animatingElement, *state.element(),
*state.style(), state.parentStyle(), this);
+ CSSAnimations::calculateTransitionUpdate(state.animationUpdate(),
+ CSSAnimations::PropertyPass::Custom,
+ animatingElement, *state.style());
state.setIsAnimationInterpolationMapReady();
- if (state.isAnimatingCustomProperties())
+ if (state.isAnimatingCustomProperties()) {
return;
+ }
+ if (!state.animationUpdate()
+ .activeInterpolationsForCustomTransitions()
+ .isEmpty()) {
+ state.setIsAnimatingCustomProperties(true);
+ return;
+ }
for (const auto& propertyHandle :
state.animationUpdate().activeInterpolationsForAnimations().keys()) {
if (CSSAnimations::isCustomPropertyHandle(propertyHandle)) {
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSPropertyEquality.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698