Ejemplo n.º 1
0
/* static */ bool
ActiveLayerTracker::IsScaleSubjectToAnimation(nsIFrame* aFrame)
{
  // Check whether JavaScript is animating this frame's scale.
  LayerActivity* layerActivity = GetLayerActivity(aFrame);
  if (layerActivity && layerActivity->mScaleRestyleCount >= 2) {
    return true;
  }

  nsIContent* content = aFrame->GetContent();
  if (!content || !content->IsElement()) {
    return false;
  }

  nsCSSPseudoElements::Type pseudoType =
    aFrame->StyleContext()->GetPseudoType();

  // Check if any transitions associated with this frame may animate its scale.
  AnimationCollection* transitions =
    aFrame->PresContext()->TransitionManager()->GetAnimations(
      content->AsElement(), pseudoType, false /* don't create */);
  if (ContainsAnimatedScale(transitions, aFrame)) {
    return true;
  }

  // Check if any animations associated with this frame may animate its scale.
  AnimationCollection* animations =
    aFrame->PresContext()->AnimationManager()->GetAnimations(
      content->AsElement(), pseudoType, false /* don't create */);
  if (ContainsAnimatedScale(animations, aFrame)) {
    return true;
  }

  return false;
}
Ejemplo n.º 2
0
/* static */ bool
ActiveLayerTracker::IsScaleSubjectToAnimation(nsIFrame* aFrame)
{
  // Check whether JavaScript is animating this frame's scale.
  LayerActivity* layerActivity = GetLayerActivity(aFrame);
  if (layerActivity && layerActivity->mRestyleCounts[LayerActivity::ACTIVITY_SCALE] >= 2) {
    return true;
  }

  // Check if any animations, transitions, etc. associated with this frame may
  // animate its scale.
  EffectSet* effects = EffectSet::GetEffectSet(aFrame);
  if (effects && ContainsAnimatedScale(*effects, aFrame)) {
    return true;
  }

  return false;
}