Bug 1316764 - Update animations on layers whenever the frame generation is not equal; r?hiro
This fixes a problem where we fail to update animations on layers when an
EffectSet is destroyed. In this case when we call
RestyleManager::GetAnimationGenerationForFrame in
ElementRestyler::AddLayerChangesForAnimation(), it will return zero but the
animation generation on the layer will be set to some positive non-zero value.
If we compare the two generation numbers using < we will think the layer is
up-to-date. Using != fixes this. We only used < while we had independent
generation numbers of animations and transitions but that was fixed in
bug
1229280.
MozReview-Commit-ID: Jsunjc145GR
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -1525,28 +1525,25 @@ ElementRestyler::ElementRestyler(nsPresC
, mVisibleKidsOfHiddenElement(aVisibleKidsOfHiddenElement)
#endif
{
}
void
ElementRestyler::AddLayerChangesForAnimation()
{
- // Bug 847286 - We should have separate animation generation counters
- // on layers for transitions and animations and use != comparison below
- // rather than a > comparison.
uint64_t frameGeneration =
RestyleManager::GetAnimationGenerationForFrame(mFrame);
nsChangeHint hint = nsChangeHint(0);
for (const LayerAnimationInfo::Record& layerInfo :
LayerAnimationInfo::sRecords) {
Layer* layer =
FrameLayerBuilder::GetDedicatedLayer(mFrame, layerInfo.mLayerType);
- if (layer && frameGeneration > layer->GetAnimationGeneration()) {
+ if (layer && frameGeneration != layer->GetAnimationGeneration()) {
// If we have a transform layer but don't have any transform style, we
// probably just removed the transform but haven't destroyed the layer
// yet. In this case we will add the appropriate change hint
// (nsChangeHint_UpdateContainingBlock) when we compare style contexts
// so we can skip adding any change hint here. (If we *were* to add
// nsChangeHint_UpdateTransformLayer, ApplyRenderingChangeToTree would
// complain that we're updating a transform layer without a transform).
if (layerInfo.mLayerType == nsDisplayItem::TYPE_TRANSFORM &&