mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 874502 part 6. Remove IsCallerChrome path for tearing down windows synchronously. r=bzbarsky
This commit is contained in:
parent
3d8d8740f7
commit
8df9070254
@ -7268,22 +7268,14 @@ nsGlobalWindow::FinalClose()
|
||||
// broken addons. The chrome tests in toolkit/mozapps/downloads are a good
|
||||
// testing ground.
|
||||
//
|
||||
// Here are some quirks that the test suite depends on:
|
||||
//
|
||||
// * When chrome code executes |win|.close(), that close happens immediately,
|
||||
// along with the accompanying "domwindowclosed" notification. But _only_ if
|
||||
// |win|'s JSContext is not at the top of the stack. If it is, the close
|
||||
// _must not_ happen immediately.
|
||||
//
|
||||
// * If |win|'s JSContext is at the top of the stack, we must complete _two_
|
||||
// round-trips to the event loop before the call to ReallyCloseWindow. This
|
||||
// allows setTimeout handlers that are set after FinalClose() is called to
|
||||
// run before the window is torn down.
|
||||
// In particular, if |win|'s JSContext is at the top of the stack, we must
|
||||
// complete _two_ round-trips to the event loop before the call to
|
||||
// ReallyCloseWindow. This allows setTimeout handlers that are set after
|
||||
// FinalClose() is called to run before the window is torn down.
|
||||
bool indirect = GetContextInternal() && // Occasionally null. See bug 877390.
|
||||
(nsContentUtils::GetCurrentJSContext() ==
|
||||
GetContextInternal()->GetNativeContext());
|
||||
if ((!indirect && nsContentUtils::IsCallerChrome()) ||
|
||||
NS_FAILED(nsCloseEvent::PostCloseEvent(this, indirect))) {
|
||||
if (NS_FAILED(nsCloseEvent::PostCloseEvent(this, indirect))) {
|
||||
ReallyCloseWindow();
|
||||
} else {
|
||||
mHavePendingClose = true;
|
||||
|
Loading…
Reference in New Issue
Block a user