mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-29 11:57:32 +09:00
Ensure user input suppression works correctly even after document.open.
This commit is contained in:
parent
b52b4b9f63
commit
b7a342f120
2 changed files with 10 additions and 5 deletions
|
|
@ -2023,7 +2023,7 @@ nsGlobalWindow::ClearControllers()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsGlobalWindow::FreeInnerObjects()
|
nsGlobalWindow::FreeInnerObjects(bool aForDocumentOpen)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(IsInnerWindow(), "Don't free inner objects on an outer window");
|
NS_ASSERTION(IsInnerWindow(), "Don't free inner objects on an outer window");
|
||||||
|
|
||||||
|
|
@ -2082,8 +2082,10 @@ nsGlobalWindow::FreeInnerObjects()
|
||||||
mDocumentURI = mDoc->GetDocumentURI();
|
mDocumentURI = mDoc->GetDocumentURI();
|
||||||
mDocBaseURI = mDoc->GetDocBaseURI();
|
mDocBaseURI = mDoc->GetDocBaseURI();
|
||||||
|
|
||||||
while (mDoc->EventHandlingSuppressed()) {
|
if (!aForDocumentOpen) {
|
||||||
mDoc->UnsuppressEventHandlingAndFireEvents(nsIDocument::eEvents, false);
|
while (mDoc->EventHandlingSuppressed()) {
|
||||||
|
mDoc->UnsuppressEventHandlingAndFireEvents(nsIDocument::eEvents, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note: we don't have to worry about eAnimationsOnly suppressions because
|
// Note: we don't have to worry about eAnimationsOnly suppressions because
|
||||||
|
|
@ -3000,6 +3002,8 @@ nsGlobalWindow::SetNewDocument(nsIDocument* aDocument,
|
||||||
nsCOMPtr<WindowStateHolder> wsh = do_QueryInterface(aState);
|
nsCOMPtr<WindowStateHolder> wsh = do_QueryInterface(aState);
|
||||||
NS_ASSERTION(!aState || wsh, "What kind of weird state are you giving me here?");
|
NS_ASSERTION(!aState || wsh, "What kind of weird state are you giving me here?");
|
||||||
|
|
||||||
|
bool handleDocumentOpen = false;
|
||||||
|
|
||||||
JS::Rooted<JSObject*> newInnerGlobal(cx);
|
JS::Rooted<JSObject*> newInnerGlobal(cx);
|
||||||
if (reUseInnerWindow) {
|
if (reUseInnerWindow) {
|
||||||
// We're reusing the current inner window.
|
// We're reusing the current inner window.
|
||||||
|
|
@ -3091,6 +3095,7 @@ nsGlobalWindow::SetNewDocument(nsIDocument* aDocument,
|
||||||
|
|
||||||
if (currentInner && currentInner->GetWrapperPreserveColor()) {
|
if (currentInner && currentInner->GetWrapperPreserveColor()) {
|
||||||
if (oldDoc == aDocument) {
|
if (oldDoc == aDocument) {
|
||||||
|
handleDocumentOpen = true;
|
||||||
// Move the navigator from the old inner window to the new one since
|
// Move the navigator from the old inner window to the new one since
|
||||||
// this is a document.write. This is safe from a same-origin point of
|
// this is a document.write. This is safe from a same-origin point of
|
||||||
// view because document.write can only be used by the same origin.
|
// view because document.write can only be used by the same origin.
|
||||||
|
|
@ -3115,7 +3120,7 @@ nsGlobalWindow::SetNewDocument(nsIDocument* aDocument,
|
||||||
// Don't free objects on our current inner window if it's going to be
|
// Don't free objects on our current inner window if it's going to be
|
||||||
// held in the bfcache.
|
// held in the bfcache.
|
||||||
if (!currentInner->IsFrozen()) {
|
if (!currentInner->IsFrozen()) {
|
||||||
currentInner->FreeInnerObjects();
|
currentInner->FreeInnerObjects(handleDocumentOpen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1380,7 +1380,7 @@ protected:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FreeInnerObjects();
|
void FreeInnerObjects(bool aForDocumentOpen = false);
|
||||||
nsGlobalWindow *CallerInnerWindow();
|
nsGlobalWindow *CallerInnerWindow();
|
||||||
|
|
||||||
// Only to be called on an inner window.
|
// Only to be called on an inner window.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue