diff --git a/image/test/mochitest/animated1.svg b/image/test/mochitest/animated1.svg new file mode 100644 index 000000000000..87118c4ea085 --- /dev/null +++ b/image/test/mochitest/animated1.svg @@ -0,0 +1,12 @@ + + + + diff --git a/image/test/mochitest/mochitest.ini b/image/test/mochitest/mochitest.ini index 06e62085417b..d50d93898d31 100644 --- a/image/test/mochitest/mochitest.ini +++ b/image/test/mochitest/mochitest.ini @@ -2,6 +2,7 @@ support-files = INT32_MIN.bmp animated1.gif + animated1.svg animated2.gif animated-gif.gif animated-gif2.gif diff --git a/image/test/mochitest/test_animated_css_image.html b/image/test/mochitest/test_animated_css_image.html index 8d6c27cd5cee..3b35b0e55905 100644 --- a/image/test/mochitest/test_animated_css_image.html +++ b/image/test/mochitest/test_animated_css_image.html @@ -150,7 +150,25 @@ const kTests = [ element(doc) { return doc.documentElement; }, - } + }, + + // bug 1719375: CSS animation in SVG image. + { + html: ` + + +
+ `, + element(doc) { + return doc.querySelector("div"); + }, + }, ]; onload = async function() { diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp index eeefd50f00de..db5474d5e60b 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp @@ -10788,6 +10788,14 @@ bool PresShell::ShouldBeActive() const { mIsActive)); Document* doc = mDocument; + + if (doc->IsBeingUsedAsImage()) { + // Documents used as an image can remain active. They do not tick their + // refresh driver if not painted, and they can't run script or such so they + // can't really observe much else. + return true; + } + if (Document* displayDoc = doc->GetDisplayDocument()) { // Ok, we're an external resource document -- we need to use our display // document's docshell to determine "IsActive" status, since we lack