コード例 #1
0
ファイル: Animation.cpp プロジェクト: ivaylo5ev/gecko-dev
void
Animation::PostUpdate()
{
  if (!mEffect) {
    return;
  }

  KeyframeEffectReadOnly* keyframeEffect = mEffect->AsKeyframeEffect();
  if (!keyframeEffect) {
    return;
  }

  Maybe<NonOwningAnimationTarget> target = keyframeEffect->GetTarget();
  if (!target) {
    return;
  }

  nsPresContext* presContext = keyframeEffect->GetPresContext();
  if (!presContext) {
    return;
  }

  presContext->EffectCompositor()
             ->RequestRestyle(target->mElement,
                              target->mPseudoType,
                              EffectCompositor::RestyleType::Layer,
                              CascadeLevel());
}
コード例 #2
0
static inline Element*
GetTarget(Animation* aAnimation)
{
  KeyframeEffectReadOnly* effect = aAnimation->GetEffect();
  if (!effect) {
    return nullptr;
  }

  Element* target;
  nsCSSPseudoElements::Type pseudoType;
  effect->GetTarget(target, pseudoType);

  // If the animation targets a pseudo-element, we don't dispatch
  // notifications for it.  (In the future we will have PseudoElement
  // objects we can use as the target of the notifications.)
  if (pseudoType != nsCSSPseudoElements::ePseudo_NotPseudoElement) {
    return nullptr;
  }

  return effect->GetTarget();
}
コード例 #3
0
ファイル: nsNodeUtils.cpp プロジェクト: Neil511/gecko-dev
Maybe<NonOwningAnimationTarget>
nsNodeUtils::GetTargetForAnimation(const Animation* aAnimation)
{
  KeyframeEffectReadOnly* effect = aAnimation->GetEffect();
  return effect ? effect->GetTarget() : Nothing();
}