зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1334572 - Dispatch WindowLowered/Raised events asynchronously in test mode (for marionette) (r=smaug)
MozReview-Commit-ID: Kwgl6sX4OoU
This commit is contained in:
Родитель
c8c4ea2401
Коммит
ed66ab4b53
|
@ -2204,10 +2204,18 @@ nsFocusManager::RaiseWindow(nsPIDOMWindowOuter* aWindow)
|
||||||
|
|
||||||
if (sTestMode) {
|
if (sTestMode) {
|
||||||
// In test mode, emulate the existing window being lowered and the new
|
// In test mode, emulate the existing window being lowered and the new
|
||||||
// window being raised.
|
// window being raised. This happens in a separate runnable to avoid
|
||||||
if (mActiveWindow)
|
// touching multiple windows in the current runnable.
|
||||||
WindowLowered(mActiveWindow);
|
nsCOMPtr<nsPIDOMWindowOuter> active(mActiveWindow);
|
||||||
WindowRaised(aWindow);
|
nsCOMPtr<nsPIDOMWindowOuter> window(aWindow);
|
||||||
|
RefPtr<nsFocusManager> self(this);
|
||||||
|
NS_DispatchToCurrentThread(
|
||||||
|
NS_NewRunnableFunction([self, active, window] () -> void {
|
||||||
|
if (active) {
|
||||||
|
self->WindowLowered(active);
|
||||||
|
}
|
||||||
|
self->WindowRaised(window);
|
||||||
|
}));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче