зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1254091 - part 2: fix focus messaging from SpecialPowers to refer to the right window, r=enndeakin
MozReview-Commit-ID: DMnK23GoerQ --HG-- extra : rebase_source : f9af09ead0cd5a52034e483386ba1b6c7db6f5a7
This commit is contained in:
Родитель
e6fd6099aa
Коммит
18ed8df63e
|
@ -7,6 +7,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var global = this;
|
||||
|
||||
var Ci = Components.interfaces;
|
||||
var Cc = Components.classes;
|
||||
var Cu = Components.utils;
|
||||
|
@ -1624,7 +1626,19 @@ SpecialPowersAPI.prototype = {
|
|||
// With aWindow, it is called in SimpleTest.waitForFocus to allow popup window opener focus switching
|
||||
if (aWindow)
|
||||
aWindow.focus();
|
||||
sendAsyncMessage("SpecialPowers.Focus", {});
|
||||
var mm = global;
|
||||
if (aWindow) {
|
||||
try {
|
||||
mm = aWindow.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDocShell)
|
||||
.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIContentFrameMessageManager);
|
||||
} catch (ex) {
|
||||
/* Ignore exceptions for e.g. XUL chrome windows from mochitest-chrome
|
||||
* which won't have a message manager */
|
||||
}
|
||||
}
|
||||
mm.sendAsyncMessage("SpecialPowers.Focus", {});
|
||||
},
|
||||
|
||||
getClipboardData: function(flavor, whichClipboard) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче