Commit ce810c93 authored by Xida Chen's avatar Xida Chen Committed by Commit Bot

Add a histogram to measure CSS transition cancellation

This CL adds a histogram to measure how often a CSS transition is
cancelled by removing the transition style.

Bug: 934700
Change-Id: I53f608f0e4cf2ec07adaecb879cffbb557ce2753
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1632714Reviewed-by: default avatarXida Chen <xidachen@chromium.org>
Reviewed-by: default avatarStephen McGruer <smcgruer@chromium.org>
Commit-Queue: Xida Chen <xidachen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664323}
parent dc749b55
...@@ -2304,6 +2304,7 @@ enum WebFeature { ...@@ -2304,6 +2304,7 @@ enum WebFeature {
kV8XRSession_End_Method = 2911, kV8XRSession_End_Method = 2911,
kV8XRWebGLLayer_Constructor = 2912, kV8XRWebGLLayer_Constructor = 2912,
kFetchKeepalive = 2913, kFetchKeepalive = 2913,
kCSSTransitionCancelledByRemovingStyle = 2914,
// Add new features immediately above this line. Don't change assigned // Add new features immediately above this line. Don't change assigned
// numbers of any item, and don't reuse removed slots. // numbers of any item, and don't reuse removed slots.
......
...@@ -948,6 +948,12 @@ void CSSAnimations::CalculateTransitionUpdate(CSSAnimationUpdate& update, ...@@ -948,6 +948,12 @@ void CSSAnimations::CalculateTransitionUpdate(CSSAnimationUpdate& update,
if (!any_transition_had_transition_all && !animation_style_recalc && if (!any_transition_had_transition_all && !animation_style_recalc &&
!listed_properties.Contains(property)) { !listed_properties.Contains(property)) {
update.CancelTransition(property); update.CancelTransition(property);
// Measure how often transitions are cancelled by removing their style.
// See https://crbug.com/934700.
if (!transition_data) {
UseCounter::Count(animating_element->GetDocument(),
WebFeature::kCSSTransitionCancelledByRemovingStyle);
}
} else if (entry.value.animation->FinishedInternal()) { } else if (entry.value.animation->FinishedInternal()) {
update.FinishTransition(property); update.FinishTransition(property);
} }
......
...@@ -23408,6 +23408,7 @@ Called by update_net_error_codes.py.--> ...@@ -23408,6 +23408,7 @@ Called by update_net_error_codes.py.-->
<int value="2911" label="V8XRSession_End_Method"/> <int value="2911" label="V8XRSession_End_Method"/>
<int value="2912" label="V8XRWebGLLayer_Constructor"/> <int value="2912" label="V8XRWebGLLayer_Constructor"/>
<int value="2913" label="FetchKeepalive"/> <int value="2913" label="FetchKeepalive"/>
<int value="2914" label="CSSTransitionCancelledByRemovingStyle"/>
</enum> </enum>
<enum name="FeaturePolicyFeature"> <enum name="FeaturePolicyFeature">
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