Bug 1430884 - Throttle transform animations without %0 or 100% keyframe. r=birtles

MozReview-Commit-ID: 3vLAlSkLz97
This commit is contained in:
Hiroyuki Ikezoe
2018-06-25 18:29:28 +09:00
parent 5f47c7ee61
commit 13affd7d60
3 changed files with 48 additions and 2 deletions

View File

@@ -1617,9 +1617,25 @@ KeyframeEffect::CalculateCumulativeChangeHint(const ComputedStyle* aComputedStyl
// on invisible elements because we can't calculate the change hint for
// such properties until we compose it.
if (!segment.HasReplaceableValues()) {
mCumulativeChangeHint = ~nsChangeHint_Hints_CanIgnoreIfNotVisible;
return;
if (property.mProperty != eCSSProperty_transform) {
mCumulativeChangeHint = ~nsChangeHint_Hints_CanIgnoreIfNotVisible;
return;
}
// We try a little harder to optimize transform animations simply
// because they are so common (the second-most commonly animated
// property at the time of writing). So if we encounter a transform
// segment that needs composing with the underlying value, we just add
// all the change hints a transform animation is known to be able to
// generate.
mCumulativeChangeHint |= nsChangeHint_AddOrRemoveTransform |
nsChangeHint_RepaintFrame |
nsChangeHint_UpdateContainingBlock |
nsChangeHint_UpdateOverflow |
nsChangeHint_UpdatePostTransformOverflow |
nsChangeHint_UpdateTransformLayer;
continue;
}
RefPtr<ComputedStyle> fromContext =
CreateComputedStyleForAnimationValue(property.mProperty,
segment.mFromValue,