Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/dom/animation/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 2 kB image not shown  

Quelle  AnimationTimelinesController.cpp

  Sprache: C
 

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */


#include "AnimationTimelinesController.h"

#include "mozilla/dom/DocumentTimeline.h"
#include "mozilla/dom/ScrollTimeline.h"

namespace mozilla::dom {

void AnimationTimelinesController::AddDocumentTimeline(
    DocumentTimeline& aTimeline) {
  mDocumentTimelines.insertBack(&aTimeline);
}

void AnimationTimelinesController::AddScrollTimeline(
    ScrollTimeline& aTimeline) {
  mScrollTimelines.insertBack(&aTimeline);
}

void AnimationTimelinesController::WillRefresh() {
  for (DocumentTimeline* tl :
       ToTArray<AutoTArray<RefPtr<DocumentTimeline>, 32>>(mDocumentTimelines)) {
    tl->WillRefresh();
  }

  for (ScrollTimeline* tl :
       ToTArray<AutoTArray<RefPtr<ScrollTimeline>, 32>>(mScrollTimelines)) {
    tl->WillRefresh();
  }
}

bool AnimationTimelinesController::UpdateStaleTimelines() {
  // https://drafts.csswg.org/scroll-animations-1/#event-loop
  // Hold a strong reference to each timeline so that if one UpdateIfStale
  // call destroys others, they remain valid.
  bool needsFlush = false;
  for (ScrollTimeline* tl :
       ToTArray<AutoTArray<RefPtr<ScrollTimeline>, 1>>(mScrollTimelines)) {
    needsFlush |= tl->UpdateIfStale();
  }
  return needsFlush;
}

void AnimationTimelinesController::UpdateLastRefreshDriverTime() {
  for (DocumentTimeline* timeline : mDocumentTimelines) {
    timeline->UpdateLastRefreshDriverTime();
  }
  // We don't use refresh driver time stamp for scroll timelines.
}

void AnimationTimelinesController::TriggerAllPendingAnimationsNow() {
  for (DocumentTimeline* timeline : mDocumentTimelines) {
    timeline->TriggerAllPendingAnimationsNow();
  }

  // FIXME: Bug 1805950. This is used for testing and printing. We may have to
  // revisit there when supporting printing for scroll-timelines ()
}

void AnimationTimelinesController::UpdateHiddenByContentVisibility() {
  for (AnimationTimeline* timeline : mDocumentTimelines) {
    timeline->UpdateHiddenByContentVisibility();
  }

  for (AnimationTimeline* timeline : mScrollTimelines) {
    timeline->UpdateHiddenByContentVisibility();
  }
}

}  // namespace mozilla::dom

Messung V0.5 in Prozent
C=87 H=98 G=92

¤ Dauer der Verarbeitung: 0.4 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.