Commit a5dd78eb authored by Anders Hartvoll Ruud's avatar Anders Hartvoll Ruud Committed by Commit Bot

Remove StyleResolverState::IsAnimatingCustomProperties

It used to be the case that animated values for custom properties were
part of the base computed style. Hence this flag was used to avoid
caching mechanisms when the base is "tainted" by animations.

With the StyleCascade, animated custom properties don't work like this
anymore, and the base computed style optimization has also been totally
reworked recently, so this flag is now useless.

Change-Id: Ie7ac5c39ce8d2f54e41a88df3dc28f6664f6b9cd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2307239
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Reviewed-by: default avatarKevin Ellis <kevers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#791259}
parent 85f7ce53
...@@ -1495,8 +1495,7 @@ void StyleResolver::MaybeAddToMatchedPropertiesCache( ...@@ -1495,8 +1495,7 @@ void StyleResolver::MaybeAddToMatchedPropertiesCache(
const CacheSuccess& cache_success, const CacheSuccess& cache_success,
const MatchResult& match_result) { const MatchResult& match_result) {
state.LoadPendingResources(); state.LoadPendingResources();
if (!state.IsAnimatingCustomProperties() && if (!cache_success.cached_matched_properties && cache_success.key.IsValid() &&
!cache_success.cached_matched_properties && cache_success.key.IsValid() &&
MatchedPropertiesCache::IsCacheable(state)) { MatchedPropertiesCache::IsCacheable(state)) {
INCREMENT_STYLE_STATS_COUNTER(GetDocument().GetStyleEngine(), INCREMENT_STYLE_STATS_COUNTER(GetDocument().GetStyleEngine(),
matched_property_cache_added, 1); matched_property_cache_added, 1);
...@@ -1520,18 +1519,6 @@ void StyleResolver::CalculateAnimationUpdate(StyleResolverState& state) { ...@@ -1520,18 +1519,6 @@ void StyleResolver::CalculateAnimationUpdate(StyleResolverState& state) {
animating_element, *state.Style()); animating_element, *state.Style());
state.SetIsAnimationInterpolationMapReady(); state.SetIsAnimationInterpolationMapReady();
if (state.IsAnimatingCustomProperties()) {
return;
}
if (!state.AnimationUpdate()
.ActiveInterpolationsForCustomAnimations()
.IsEmpty() ||
!state.AnimationUpdate()
.ActiveInterpolationsForCustomTransitions()
.IsEmpty()) {
state.SetIsAnimatingCustomProperties(true);
}
} }
bool StyleResolver::CanReuseBaseComputedStyle(const StyleResolverState& state) { bool StyleResolver::CanReuseBaseComputedStyle(const StyleResolverState& state) {
......
...@@ -126,13 +126,6 @@ class CORE_EXPORT StyleResolverState { ...@@ -126,13 +126,6 @@ class CORE_EXPORT StyleResolverState {
is_animation_interpolation_map_ready_ = true; is_animation_interpolation_map_ready_ = true;
} }
bool IsAnimatingCustomProperties() const {
return is_animating_custom_properties_;
}
void SetIsAnimatingCustomProperties(bool value) {
is_animating_custom_properties_ = value;
}
Element* GetAnimatingElement() const; Element* GetAnimatingElement() const;
void SetParentStyle(scoped_refptr<const ComputedStyle>); void SetParentStyle(scoped_refptr<const ComputedStyle>);
...@@ -268,7 +261,6 @@ class CORE_EXPORT StyleResolverState { ...@@ -268,7 +261,6 @@ class CORE_EXPORT StyleResolverState {
CSSAnimationUpdate animation_update_; CSSAnimationUpdate animation_update_;
bool is_animation_interpolation_map_ready_ = false; bool is_animation_interpolation_map_ready_ = false;
bool is_animating_custom_properties_ = false;
bool has_dir_auto_attribute_ = false; bool has_dir_auto_attribute_ = false;
PseudoElementStyleRequest::RequestType pseudo_request_type_; PseudoElementStyleRequest::RequestType pseudo_request_type_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment