forked from mirrors/gecko-dev
Bug 1867152 - Fix the assertion in nsPresContext::UserInputEventsAllowed r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D196106
This commit is contained in:
parent
61ea0a804b
commit
290a5f22de
3 changed files with 17 additions and 1 deletions
|
|
@ -1309,6 +1309,7 @@ Document::Document(const char* aContentType)
|
||||||
mMayNeedFontPrefsUpdate(true),
|
mMayNeedFontPrefsUpdate(true),
|
||||||
mMathMLEnabled(false),
|
mMathMLEnabled(false),
|
||||||
mIsInitialDocumentInWindow(false),
|
mIsInitialDocumentInWindow(false),
|
||||||
|
mIsEverInitialDocumentInWindow(false),
|
||||||
mIgnoreDocGroupMismatches(false),
|
mIgnoreDocGroupMismatches(false),
|
||||||
mLoadedAsData(false),
|
mLoadedAsData(false),
|
||||||
mAddedToMemoryReportingAsDataDocument(false),
|
mAddedToMemoryReportingAsDataDocument(false),
|
||||||
|
|
@ -18689,6 +18690,10 @@ nsIPrincipal* Document::GetPrincipalForPrefBasedHacks() const {
|
||||||
void Document::SetIsInitialDocument(bool aIsInitialDocument) {
|
void Document::SetIsInitialDocument(bool aIsInitialDocument) {
|
||||||
mIsInitialDocumentInWindow = aIsInitialDocument;
|
mIsInitialDocumentInWindow = aIsInitialDocument;
|
||||||
|
|
||||||
|
if (aIsInitialDocument && !mIsEverInitialDocumentInWindow) {
|
||||||
|
mIsEverInitialDocumentInWindow = aIsInitialDocument;
|
||||||
|
}
|
||||||
|
|
||||||
// Asynchronously tell the parent process that we are, or are no longer, the
|
// Asynchronously tell the parent process that we are, or are no longer, the
|
||||||
// initial document. This happens async.
|
// initial document. This happens async.
|
||||||
if (auto* wgc = GetWindowGlobalChild()) {
|
if (auto* wgc = GetWindowGlobalChild()) {
|
||||||
|
|
|
||||||
|
|
@ -994,6 +994,12 @@ class Document : public nsINode,
|
||||||
*/
|
*/
|
||||||
bool IsInitialDocument() const { return mIsInitialDocumentInWindow; }
|
bool IsInitialDocument() const { return mIsInitialDocumentInWindow; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ask this document whether it has ever been a initial document in its
|
||||||
|
* window.
|
||||||
|
*/
|
||||||
|
bool IsEverInitialDocument() const { return mIsEverInitialDocumentInWindow; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tell this document that it's the initial document in its window. See
|
* Tell this document that it's the initial document in its window. See
|
||||||
* comments on mIsInitialDocumentInWindow for when this should be called.
|
* comments on mIsInitialDocumentInWindow for when this should be called.
|
||||||
|
|
@ -4555,6 +4561,11 @@ class Document : public nsINode,
|
||||||
// document in it.
|
// document in it.
|
||||||
bool mIsInitialDocumentInWindow : 1;
|
bool mIsInitialDocumentInWindow : 1;
|
||||||
|
|
||||||
|
// True if this document has ever been the initial document for a window. This
|
||||||
|
// is useful to determine if a document that was the initial document at one
|
||||||
|
// point, and became non-initial later.
|
||||||
|
bool mIsEverInitialDocumentInWindow : 1;
|
||||||
|
|
||||||
bool mIgnoreDocGroupMismatches : 1;
|
bool mIgnoreDocGroupMismatches : 1;
|
||||||
|
|
||||||
// True if we're loaded as data and therefor has any dangerous stuff, such
|
// True if we're loaded as data and therefor has any dangerous stuff, such
|
||||||
|
|
|
||||||
|
|
@ -1237,7 +1237,7 @@ bool nsPresContext::UserInputEventsAllowed() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Special document
|
// Special document
|
||||||
if (Document()->IsInitialDocument()) {
|
if (Document()->IsEverInitialDocument()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue