Bug 1719375 - Consider documents used-as-an-image always active. r=tnikkel

These are ticked when painted, so it is fine and it's effectively what
happened before bug 1717983 (because we didn't get into this condition:
https://hg.mozilla.org/mozilla-central/rev/cb704553fc64#l3.73).

Differential Revision: https://phabricator.services.mozilla.com/D119314
This commit is contained in:
Emilio Cobos Álvarez
2021-07-08 12:54:48 +00:00
parent ed9110d0c7
commit f1fe1437c8
4 changed files with 40 additions and 1 deletions

View File

@@ -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