summaryrefslogtreecommitdiffstats
path: root/dom/smil/SMILAnimationController.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:42 +0000
commitda4c7e7ed675c3bf405668739c3012d140856109 (patch)
treecdd868dba063fecba609a1d819de271f0d51b23e /dom/smil/SMILAnimationController.cpp
parentAdding upstream version 125.0.3. (diff)
downloadfirefox-da4c7e7ed675c3bf405668739c3012d140856109.tar.xz
firefox-da4c7e7ed675c3bf405668739c3012d140856109.zip
Adding upstream version 126.0.upstream/126.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/smil/SMILAnimationController.cpp')
-rw-r--r--dom/smil/SMILAnimationController.cpp35
1 files changed, 6 insertions, 29 deletions
diff --git a/dom/smil/SMILAnimationController.cpp b/dom/smil/SMILAnimationController.cpp
index 99abc07b58..be180e96f6 100644
--- a/dom/smil/SMILAnimationController.cpp
+++ b/dom/smil/SMILAnimationController.cpp
@@ -264,11 +264,8 @@ void SMILAnimationController::DoSample(bool aSkipUnchangedContainers) {
return;
}
- bool isStyleFlushNeeded = mResampleNeeded;
mResampleNeeded = false;
- nsCOMPtr<Document> document(mDocument); // keeps 'this' alive too
-
// Set running sample flag -- do this before flushing styles so that when we
// flush styles we don't end up requesting extra samples
AutoRestore<bool> autoRestoreRunningSample(mRunningSample);
@@ -327,8 +324,7 @@ void SMILAnimationController::DoSample(bool aSkipUnchangedContainers) {
for (SVGAnimationElement* animElem : mAnimationElementTable.Keys()) {
SampleTimedElement(animElem, &activeContainers);
- AddAnimationToCompositorTable(animElem, currentCompositorTable.get(),
- isStyleFlushNeeded);
+ AddAnimationToCompositorTable(animElem, currentCompositorTable.get());
animElems.AppendElement(animElem);
}
activeContainers.Clear();
@@ -375,15 +371,6 @@ void SMILAnimationController::DoSample(bool aSkipUnchangedContainers) {
return;
}
- if (isStyleFlushNeeded) {
- document->FlushPendingNotifications(FlushType::Style);
- }
-
- // WARNING:
- // WARNING: the above flush may have destroyed the pres shell and/or
- // WARNING: frames and other layout related objects.
- // WARNING:
-
// STEP 5: Compose currently-animated attributes.
// XXXdholbert: This step traverses our animation targets in an effectively
// random order. For animation from/to 'inherit' values to work correctly
@@ -533,8 +520,7 @@ void SMILAnimationController::SampleTimedElement(
/*static*/
void SMILAnimationController::AddAnimationToCompositorTable(
- SVGAnimationElement* aElement, SMILCompositorTable* aCompositorTable,
- bool& aStyleFlushNeeded) {
+ SVGAnimationElement* aElement, SMILCompositorTable* aCompositorTable) {
// Add a compositor to the hash table if there's not already one there
SMILTargetIdentifier key;
if (!GetTargetIdentifierForAnimation(aElement, key))
@@ -550,7 +536,6 @@ void SMILAnimationController::AddAnimationToCompositorTable(
// Look up the compositor for our target, & add our animation function
// to its list of animation functions.
SMILCompositor* result = aCompositorTable->PutEntry(key);
- aStyleFlushNeeded |= func.ValueNeedsReparsingEverySample();
result->AddAnimationFunction(&func);
} else if (func.HasChanged()) {
@@ -560,7 +545,6 @@ void SMILAnimationController::AddAnimationToCompositorTable(
// it's got HasChanged() == true), so we need to make sure to recompose
// its target.
SMILCompositor* result = aCompositorTable->PutEntry(key);
- aStyleFlushNeeded |= func.ValueNeedsReparsingEverySample();
result->ToggleForceCompositing();
// We've now made sure that |func|'s inactivity will be reflected as of
@@ -614,23 +598,20 @@ bool SMILAnimationController::GetTargetIdentifierForAnimation(
return true;
}
-bool SMILAnimationController::PreTraverse() {
- return PreTraverseInSubtree(nullptr);
-}
+void SMILAnimationController::PreTraverse() { PreTraverseInSubtree(nullptr); }
-bool SMILAnimationController::PreTraverseInSubtree(Element* aRoot) {
+void SMILAnimationController::PreTraverseInSubtree(Element* aRoot) {
MOZ_ASSERT(NS_IsMainThread());
if (!mMightHavePendingStyleUpdates) {
- return false;
+ return;
}
nsPresContext* context = mDocument->GetPresContext();
if (!context) {
- return false;
+ return;
}
- bool foundElementsNeedingRestyle = false;
for (SVGAnimationElement* animElement : mAnimationElementTable.Keys()) {
SMILTargetIdentifier key;
if (!GetTargetIdentifierForAnimation(animElement, key)) {
@@ -647,8 +628,6 @@ bool SMILAnimationController::PreTraverseInSubtree(Element* aRoot) {
context->RestyleManager()->PostRestyleEventForAnimations(
key.mElement, PseudoStyleType::NotPseudo, RestyleHint::RESTYLE_SMIL);
-
- foundElementsNeedingRestyle = true;
}
// Only clear the mMightHavePendingStyleUpdates flag if we definitely posted
@@ -656,8 +635,6 @@ bool SMILAnimationController::PreTraverseInSubtree(Element* aRoot) {
if (!aRoot) {
mMightHavePendingStyleUpdates = false;
}
-
- return foundElementsNeedingRestyle;
}
//----------------------------------------------------------------------