From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 8Ff5DpD3B2dFIAAAe85BDQ:P1 (envelope-from ) for ; Thu, 10 Oct 2024 15:49:36 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 8Ff5DpD3B2dFIAAAe85BDQ (envelope-from ) for ; Thu, 10 Oct 2024 17:49:36 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=S5tpm7Hy; dkim=fail ("headers rsa verify failed") header.d=ultrarare.space header.s=dkim header.b=s5CXMMQH; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1728575376; a=rsa-sha256; cv=none; b=MfQkX7RJEpQMyFL82ftcfpbbq62bGEKkHONK3dr4ZbGU/W6T0KVU8aIao1UbA4neSDvJzt qUeWNXuQMXqGA46LRc1H1Wqdytm6VY+LTG2WUqW/oGgGZNGKtLmhIxS9bnOufJrRiNKsHr 8yc6LMq4/01EPSS7HgcX1+BQbuYlNY3JY4eABOf/kYtbOAGFvxhvdhzejX+9NdgruLxXtV VMgkamGRilmQESCmhSarhRuegOXKk7YMW5W1Sn8/VkCDH1Ru48avFwHXCYavjNoyPd5d6H OABol3CObETNwPP2uX3Eog2UFRvUJe8KSAuWTJZPNubt+RC4WeJ4hmDta3X2CA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=S5tpm7Hy; dkim=fail ("headers rsa verify failed") header.d=ultrarare.space header.s=dkim header.b=s5CXMMQH; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1728575376; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=dLtMYsXk2x2LakDtgqxiKbYrS0LltU+abJaURGgfzAQ=; b=AMUcLXHUrkC1SZThL26CxxopqColOVFIOZ5ryzb5H0BnhXLHqUpwga1X3r5CC/5rKa6xbn OTLsvQO5mrCVk6kbEVSiWP+B8w0qTO4IQ4rfOVIoRKYMknL8KJEPuxTEAdxcrdcIAqvNpR QqP2UszVgQssUL3tIgp50E5WWne9B0PemH6BRUgcKZqHU4lLo60Pn5hIGW6xaa2tOcT0Nh HMQmHrNOC4LlxMY575U7rMw6Xg7yslz6MQYofY1uY+icd9NEJyGW5Ns/LwLMR9gLwoRup0 r/V020z88J5Nn0D0mDkxN8MZFFgXvn/09RyLx/1Wg1sRgI3EUhDBaxKLk/h7hw== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 74F3432187 for ; Thu, 10 Oct 2024 17:49:35 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syvPg-0003u8-5Z; Thu, 10 Oct 2024 11:49:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1syvPd-0003tp-0l for guix-patches@gnu.org; Thu, 10 Oct 2024 11:49:13 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1syvPc-0000Td-O0 for guix-patches@gnu.org; Thu, 10 Oct 2024 11:49:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=dLtMYsXk2x2LakDtgqxiKbYrS0LltU+abJaURGgfzAQ=; b=S5tpm7HytUD8ctO/h5ugbwNySPULinWBz1M78HVT0ghkyWsL4WXnI3Ivb6vsrcrrd09w558gGSkpibqMcgbFFqkcPyM0m43C8Ak7WA5EQnwIIxdPD3Bx5TwH36bUbUG0I4TnSIeY2us7JuipkGbXZ2afXkT2kumWYNCIY6cSAJ0QrKbV0csOxSgar/7SOpmKtftWVrR79MDT48A6ROZOVdXfa0qUbWpeH99E2ai4C8HELUyjpgmhM6cCv6LEbdET2+ohX4kkyVp6oZ00IOkjQiDoeMzXD+t/KQ5Il0LbDEBY9IFqI9AAUanuRxQzRATaDBts/6TMttrhL+/VGoWpUQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1syvPS-000108-Ix; Thu, 10 Oct 2024 11:49:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#73735] [PATCH] gnu: librewolf: Fix CVE-2024-9680. Resent-From: Hilton Chain Original-Sender: "Debbugs-submit" Resent-CC: nandre@riseup.net, clement@lassieur.org, jonathan.brielmaier@web.de, mhw@netris.org, guix-patches@gnu.org Resent-Date: Thu, 10 Oct 2024 15:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 73735 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73735@debbugs.gnu.org Cc: Hilton Chain , =?UTF-8?Q?Andr=C3=A9?= Batista , =?UTF-8?Q?Cl=C3=A9ment?= Lassieur , Jonathan Brielmaier , Mark H Weaver X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: =?UTF-8?Q?Andr=C3=A9?= Batista , =?UTF-8?Q?Cl=C3=A9ment?= Lassieur , Jonathan Brielmaier , Mark H Weaver Received: via spool by submit@debbugs.gnu.org id=B.17285753243816 (code B ref -1); Thu, 10 Oct 2024 15:49:02 +0000 Received: (at submit) by debbugs.gnu.org; 10 Oct 2024 15:48:44 +0000 Received: from localhost ([127.0.0.1]:60250 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1syvP9-0000zT-1S for submit@debbugs.gnu.org; Thu, 10 Oct 2024 11:48:43 -0400 Received: from lists.gnu.org ([209.51.188.17]:33044) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1syvP5-0000zK-PF for submit@debbugs.gnu.org; Thu, 10 Oct 2024 11:48:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1syvOt-0003jj-7T for guix-patches@gnu.org; Thu, 10 Oct 2024 11:48:27 -0400 Received: from mail.boiledscript.com ([144.168.59.46]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1syvOq-0000M8-Cv for guix-patches@gnu.org; Thu, 10 Oct 2024 11:48:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space; s=dkim; t=1728575298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dLtMYsXk2x2LakDtgqxiKbYrS0LltU+abJaURGgfzAQ=; b=s5CXMMQHSH8jpPuJh8CrQKz+I6rAsimnTQlNeaULo9awS3vnpEhaaGiofB50f9TTVhzfb2 7qav8ecLB+ZQz+BpjM4o59S8W0N5kA08+RqO4902O7tEF0su/b6uBMMSriNSujnNnPap3K Xd/6Czx8bl7s/f08I/XBR4IuCYkH+QQ9Z5hMXMgIkfbv+Zcc4KwTp0vDJvkyg0gFYEM7CL e0UjKIJANv2E3z6X93JH7RZpkRD1rRDeNsu5w+hrE0VhC/O1f+160rfHc5ytMeo2BK35I4 gCQq7pS7aK1u39LCeIGjXsnpcwYK8zAQagY/oEUKV8dkOsoOPS/5UntCEmtEgQ== Date: Thu, 10 Oct 2024 23:43:25 +0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spamd-Bar: -- Received-SPF: pass client-ip=144.168.59.46; envelope-from=hako@ultrarare.space; helo=mail.boiledscript.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Hilton Chain X-ACL-Warn: , Hilton Chain via Guix-patches From: Hilton Chain via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -3.67 X-Spam-Score: -3.67 X-Migadu-Queue-Id: 74F3432187 X-Migadu-Scanner: mx10.migadu.com X-TUID: 4TXsq9P32UfQ * gnu/packages/patches/librewolf-CVE-2024-9680.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/librewolf.scm (librewolf)[source]: Add it. (%librewolf-build-id): Update. Change-Id: Ib32888db1f62eae33f025d034d234a930804f14e --- gnu/local.mk | 1 + gnu/packages/librewolf.scm | 5 +- .../patches/librewolf-CVE-2024-9680.patch | 244 ++++++++++++++++++ 3 files changed, 248 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/librewolf-CVE-2024-9680.patch diff --git a/gnu/local.mk b/gnu/local.mk index 05a8716063..06e8910162 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1607,6 +1607,7 @@ dist_patch_DATA = \ %D%/packages/patches/libgeotiff-fix-tests-on-i386.patch \ %D%/packages/patches/libguestfs-syms.patch \ %D%/packages/patches/libobjc2-unbundle-robin-map.patch \ + %D%/packages/patches/librewolf-CVE-2024-9680.patch \ %D%/packages/patches/libvirt-add-install-prefix.patch \ %D%/packages/patches/libziparchive-add-includes.patch \ %D%/packages/patches/lightdm-arguments-ordering.patch \ diff --git a/gnu/packages/librewolf.scm b/gnu/packages/librewolf.scm index 31de7a7171..f27f49a041 100644 --- a/gnu/packages/librewolf.scm +++ b/gnu/packages/librewolf.scm @@ -212,7 +212,7 @@ (define rust-librewolf rust) ; 1.75 is the default in Guix, 1.65 is the minimum. ;; Update this id with every update to its release date. ;; It's used for cache validation and therefore can lead to strange bugs. ;; ex: date '+%Y%m%d%H%M%S' -(define %librewolf-build-id "20241005085731") +(define %librewolf-build-id "20241010232659") (define-public librewolf (package @@ -223,7 +223,8 @@ (define-public librewolf (inherit (make-librewolf-source #:version version #:firefox-hash "0w4z3fq5zhm63a0wmhvmqrj263bvy962dir25q3z0x5hx6hjawh2" - #:librewolf-hash "0f80pihn375bdjhjmmg2v1w96wpn76zb60ycy39wafwh1dnzybrd")))) + #:librewolf-hash "0f80pihn375bdjhjmmg2v1w96wpn76zb60ycy39wafwh1dnzybrd")) + (patches (search-patches "librewolf-CVE-2024-9680.patch")))) (build-system gnu-build-system) (arguments (list diff --git a/gnu/packages/patches/librewolf-CVE-2024-9680.patch b/gnu/packages/patches/librewolf-CVE-2024-9680.patch new file mode 100644 index 0000000000..0469823fbc --- /dev/null +++ b/gnu/packages/patches/librewolf-CVE-2024-9680.patch @@ -0,0 +1,244 @@ +Patch fetched from https://hg.mozilla.org/releases/mozilla-release/rev/d2a21d941ed5a73a37b3446caa4a49e74ffe854b + +# HG changeset patch +# User Emilio Cobos Álvarez +# Date 1728404712 0 +# Node ID d2a21d941ed5a73a37b3446caa4a49e74ffe854b +# Parent ca8fc4093e5d03c1a9e4482a95409d59cbafb017 +Bug 1923344 - r=smaug, a=dsmith + +Differential Revision: https://phabricator.services.mozilla.com/D224958 + +diff --git a/dom/animation/AnimationTimeline.cpp b/dom/animation/AnimationTimeline.cpp +--- a/dom/animation/AnimationTimeline.cpp ++++ b/dom/animation/AnimationTimeline.cpp +@@ -35,71 +35,64 @@ AnimationTimeline::AnimationTimeline(nsI + MOZ_ASSERT(mWindow); + } + + AnimationTimeline::~AnimationTimeline() { mAnimationOrder.clear(); } + + bool AnimationTimeline::Tick(TickState& aState) { + bool needsTicks = false; + +- nsTArray animationsToRemove; +- +- for (Animation* animation = mAnimationOrder.getFirst(); animation; +- animation = +- static_cast*>(animation)->getNext()) { ++ AutoTArray, 32> animationsToTick; ++ for (Animation* animation : mAnimationOrder) { + MOZ_ASSERT(mAnimations.Contains(animation), + "The sampling order list should be a subset of the hashset"); + MOZ_ASSERT(!animation->IsHiddenByContentVisibility(), + "The sampling order list should not contain any animations " + "that are hidden by content-visibility"); ++ animationsToTick.AppendElement(animation); ++ } + ++ for (Animation* animation : animationsToTick) { + // Skip any animations that are longer need associated with this timeline. + if (animation->GetTimeline() != this) { +- // If animation has some other timeline, it better not be also in the +- // animation list of this timeline object! +- MOZ_ASSERT(!animation->GetTimeline()); +- animationsToRemove.AppendElement(animation); ++ RemoveAnimation(animation); + continue; + } + + needsTicks |= animation->NeedsTicks(); +- // Even if |animation| doesn't need future ticks, we should still +- // Tick it this time around since it might just need a one-off tick in +- // order to dispatch events. ++ // Even if |animation| doesn't need future ticks, we should still Tick it ++ // this time around since it might just need a one-off tick in order to ++ // queue events. + animation->Tick(aState); +- + if (!animation->NeedsTicks()) { +- animationsToRemove.AppendElement(animation); ++ RemoveAnimation(animation); + } + } + +- for (Animation* animation : animationsToRemove) { +- RemoveAnimation(animation); +- } +- + return needsTicks; + } + + void AnimationTimeline::NotifyAnimationUpdated(Animation& aAnimation) { + if (mAnimations.EnsureInserted(&aAnimation)) { + if (aAnimation.GetTimeline() && aAnimation.GetTimeline() != this) { + aAnimation.GetTimeline()->RemoveAnimation(&aAnimation); + } + if (!aAnimation.IsHiddenByContentVisibility()) { + mAnimationOrder.insertBack(&aAnimation); + } + } + } + + void AnimationTimeline::RemoveAnimation(Animation* aAnimation) { +- MOZ_ASSERT(!aAnimation->GetTimeline() || aAnimation->GetTimeline() == this); +- if (static_cast*>(aAnimation)->isInList()) { ++ if (static_cast*>(aAnimation)->isInList() && ++ MOZ_LIKELY(!aAnimation->GetTimeline() || ++ aAnimation->GetTimeline() == this)) { ++ static_cast*>(aAnimation)->remove(); + MOZ_ASSERT(mAnimations.Contains(aAnimation), + "The sampling order list should be a subset of the hashset"); +- static_cast*>(aAnimation)->remove(); + } + mAnimations.Remove(aAnimation); + } + + void AnimationTimeline::NotifyAnimationContentVisibilityChanged( + Animation* aAnimation, bool aIsVisible) { + bool inList = + static_cast*>(aAnimation)->isInList(); +diff --git a/dom/animation/DocumentTimeline.cpp b/dom/animation/DocumentTimeline.cpp +--- a/dom/animation/DocumentTimeline.cpp ++++ b/dom/animation/DocumentTimeline.cpp +@@ -155,17 +155,22 @@ void DocumentTimeline::NotifyAnimationUp + "We should not register with the refresh driver if we are not" + " in the document's list of timelines"); + refreshDriver->EnsureAnimationUpdate(); + } + } + } + + void DocumentTimeline::TriggerAllPendingAnimationsNow() { ++ AutoTArray, 32> animationsToTrigger; + for (Animation* animation : mAnimationOrder) { ++ animationsToTrigger.AppendElement(animation); ++ } ++ ++ for (Animation* animation : animationsToTrigger) { + animation->TryTriggerNow(); + } + } + + void DocumentTimeline::WillRefresh() { + if (!mDocument->GetPresShell()) { + // If we're not displayed, don't tick animations. + return; +@@ -183,19 +188,16 @@ void DocumentTimeline::WillRefresh() { + } + // We already assert that GetRefreshDriver() is non-null at the beginning + // of this function but we check it again here to be sure that ticking + // animations does not have any side effects that cause us to lose the + // connection with the refresh driver, such as triggering the destruction + // of mDocument's PresShell. + if (nsRefreshDriver* refreshDriver = GetRefreshDriver()) { + refreshDriver->EnsureAnimationUpdate(); +- } else { +- MOZ_ASSERT_UNREACHABLE( +- "Refresh driver should still be valid at end of WillRefresh"); + } + } + + void DocumentTimeline::RemoveAnimation(Animation* aAnimation) { + AnimationTimeline::RemoveAnimation(aAnimation); + } + + void DocumentTimeline::NotifyAnimationContentVisibilityChanged( +diff --git a/dom/animation/ScrollTimelineAnimationTracker.cpp b/dom/animation/ScrollTimelineAnimationTracker.cpp +--- a/dom/animation/ScrollTimelineAnimationTracker.cpp ++++ b/dom/animation/ScrollTimelineAnimationTracker.cpp +@@ -8,23 +8,20 @@ + + #include "mozilla/dom/Document.h" + + namespace mozilla { + + NS_IMPL_CYCLE_COLLECTION(ScrollTimelineAnimationTracker, mPendingSet, mDocument) + + void ScrollTimelineAnimationTracker::TriggerPendingAnimations() { +- for (auto iter = mPendingSet.begin(), end = mPendingSet.end(); iter != end; +- ++iter) { +- dom::Animation* animation = *iter; +- ++ for (RefPtr& animation : ++ ToTArray, 32>>(mPendingSet)) { + MOZ_ASSERT(animation->GetTimeline() && + !animation->GetTimeline()->IsMonotonicallyIncreasing()); +- + // FIXME: Trigger now may not be correct because the spec says: + // If a user agent determines that animation is immediately ready, it may + // schedule the task (i.e. ResumeAt()) as a microtask such that it runs at + // the next microtask checkpoint, but it must not perform the task + // synchronously. + // Note: So, for now, we put the animation into the tracker, and trigger + // them immediately until the frames are ready. Using TriggerOnNextTick() + // for scroll-driven animations may have issues because we don't tick if +@@ -34,15 +31,13 @@ void ScrollTimelineAnimationTracker::Tri + // inactive. It's pretty hard to tell its future status, for example, it's + // possible that the scroll container is in display:none subtree but the + // animating element isn't the subtree, then we need to keep tracking the + // situation until the scroll container gets framed. so in general we make + // this animation be pending (i.e. not ready) if its scroll-timeline is + // inactive, and this also matches the current spec definition. + continue; + } +- +- // Note: Remove() is legitimately called once per entry during the loop. +- mPendingSet.Remove(iter); ++ mPendingSet.Remove(animation); + } + } + + } // namespace mozilla +diff --git a/layout/base/nsRefreshDriver.cpp b/layout/base/nsRefreshDriver.cpp +--- a/layout/base/nsRefreshDriver.cpp ++++ b/layout/base/nsRefreshDriver.cpp +@@ -2290,18 +2290,25 @@ void nsRefreshDriver::DetermineProximity + ShouldCollect); + + for (const RefPtr& doc : documents) { + MOZ_KnownLive(doc)->DetermineProximityToViewportAndNotifyResizeObservers(); + } + } + + static CallState UpdateAndReduceAnimations(Document& aDocument) { +- for (DocumentTimeline* timeline : aDocument.Timelines()) { +- timeline->WillRefresh(); ++ { ++ AutoTArray, 32> timelinesToTick; ++ for (DocumentTimeline* timeline : aDocument.Timelines()) { ++ timelinesToTick.AppendElement(timeline); ++ } ++ ++ for (DocumentTimeline* tl : timelinesToTick) { ++ tl->WillRefresh(); ++ } + } + + if (nsPresContext* pc = aDocument.GetPresContext()) { + if (pc->EffectCompositor()->NeedsReducing()) { + pc->EffectCompositor()->ReduceAnimations(); + } + } + aDocument.EnumerateSubDocuments(UpdateAndReduceAnimations); +@@ -2321,17 +2328,18 @@ void nsRefreshDriver::UpdateAnimationsAn + // run these, however, until we have fully updated the animation state. As + // per the "update animations and send events" procedure[1], we should + // remove replaced animations and then run these microtasks before + // dispatching the corresponding animation events. + // + // [1]: + // https://drafts.csswg.org/web-animations-1/#update-animations-and-send-events + nsAutoMicroTask mt; +- UpdateAndReduceAnimations(*mPresContext->Document()); ++ RefPtr doc = mPresContext->Document(); ++ UpdateAndReduceAnimations(*doc); + } + + // Hold all AnimationEventDispatcher in mAnimationEventFlushObservers as + // a RefPtr<> array since each AnimationEventDispatcher might be destroyed + // during processing the previous dispatcher. + AutoTArray, 16> dispatchers; + dispatchers.AppendElements(mAnimationEventFlushObservers); + mAnimationEventFlushObservers.Clear(); + base-commit: 39df1ac928beeeb316980c5ecb5dfaae7053460d -- 2.46.0