summaryrefslogtreecommitdiffstats
path: root/dom/smil
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /dom/smil
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/smil')
-rw-r--r--dom/smil/SMILAnimationController.cpp35
-rw-r--r--dom/smil/SMILAnimationController.h6
2 files changed, 9 insertions, 32 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;
}
//----------------------------------------------------------------------
diff --git a/dom/smil/SMILAnimationController.h b/dom/smil/SMILAnimationController.h
index 04f2e34cf3..498ab06170 100644
--- a/dom/smil/SMILAnimationController.h
+++ b/dom/smil/SMILAnimationController.h
@@ -107,8 +107,8 @@ class SMILAnimationController final : public SMILTimeContainer,
return mMightHavePendingStyleUpdates;
}
- bool PreTraverse();
- bool PreTraverseInSubtree(mozilla::dom::Element* aRoot);
+ void PreTraverse();
+ void PreTraverseInSubtree(mozilla::dom::Element* aRoot);
protected:
~SMILAnimationController();
@@ -144,7 +144,7 @@ class SMILAnimationController final : public SMILTimeContainer,
static void AddAnimationToCompositorTable(
mozilla::dom::SVGAnimationElement* aElement,
- SMILCompositorTable* aCompositorTable, bool& aStyleFlushNeeded);
+ SMILCompositorTable* aCompositorTable);
static bool GetTargetIdentifierForAnimation(
mozilla::dom::SVGAnimationElement* aAnimElem,