diff --git a/dom/animation/KeyframeEffect.cpp b/dom/animation/KeyframeEffect.cpp index aa43f24aa7a4..b7423817e004 100644 --- a/dom/animation/KeyframeEffect.cpp +++ b/dom/animation/KeyframeEffect.cpp @@ -32,6 +32,7 @@ #include "nsCSSPropertyIDSet.h" #include "nsCSSProps.h" // For nsCSSProps::PropHasFlags #include "nsCSSPseudoElements.h" // For PseudoStyleType +#include "nsCSSRendering.h" // For IsCanvasFrame #include "nsDOMMutationObserver.h" // For nsAutoAnimationMutationBatch #include "nsIFrame.h" #include "nsIFrameInlines.h" @@ -2056,6 +2057,15 @@ KeyframeEffect::MatchForCompositor KeyframeEffect::IsMatchForCompositor( if (!StaticPrefs::gfx_omta_background_color()) { return KeyframeEffect::MatchForCompositor::No; } + + // We don't yet support off-main-thread background-color animations on + // canvas frame or on which genarate nsDisplayCanvasBackgroundColor + // or nsDisplaySolidColor display item. + if (nsCSSRendering::IsCanvasFrame(aFrame) || + (aFrame->GetContent() && + aFrame->GetContent()->IsHTMLElement(nsGkAtoms::body))) { + return KeyframeEffect::MatchForCompositor::No; + } } // We can't run this background color animation on the compositor if there diff --git a/dom/animation/moz.build b/dom/animation/moz.build index 71d9a03e5618..0bd31d3f7c92 100644 --- a/dom/animation/moz.build +++ b/dom/animation/moz.build @@ -64,6 +64,7 @@ UNIFIED_SOURCES += [ LOCAL_INCLUDES += [ "/dom/base", "/layout/base", + "/layout/painting", "/layout/style", ] diff --git a/dom/animation/test/crashtests/1699890.html b/dom/animation/test/crashtests/1699890.html new file mode 100644 index 000000000000..95aa1e190c9c --- /dev/null +++ b/dom/animation/test/crashtests/1699890.html @@ -0,0 +1,13 @@ + + + diff --git a/dom/animation/test/crashtests/crashtests.list b/dom/animation/test/crashtests/crashtests.list index f967e309862e..ab945a6733a3 100644 --- a/dom/animation/test/crashtests/crashtests.list +++ b/dom/animation/test/crashtests/crashtests.list @@ -55,3 +55,4 @@ pref(dom.animations-api.core.enabled,true) pref(dom.animations-api.getAnimations pref(dom.animations-api.core.enabled,true) pref(dom.animations-api.implicit-keyframes.enabled,true) load 1633486.html pref(layout.animation.prerender.partial,true) load 1656419.html pref(layout.css.step-position-jump.enabled,true) load 1706157.html +pref(gfx.omta.background-color,true) load 1699890.html