Bug 1596488 - Revert mXBLAttached fix for native OSX menus r=spohl

Differential Revision: https://phabricator.services.mozilla.com/D61084

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Christoph Walcher 2020-02-03 20:03:16 +00:00
parent 7335e6b9ad
commit b83cacd406
2 changed files with 1 additions and 22 deletions

View File

@ -93,7 +93,6 @@ class nsMenuX : public nsMenuObjectX, public nsChangeObserver {
bool mNeedsRebuild;
bool mConstructed;
bool mVisible;
bool mXBLAttached;
};
#endif // nsMenuX_h_

View File

@ -35,11 +35,6 @@
#include "mozilla/dom/ScriptSettings.h"
#include "mozilla/EventDispatcher.h"
#include "jsapi.h"
#include "nsIScriptGlobalObject.h"
#include "nsIScriptContext.h"
#include "nsIXPConnect.h"
#include "mozilla/MouseEvents.h"
using namespace mozilla;
@ -95,8 +90,7 @@ nsMenuX::nsMenuX()
mDestroyHandlerCalled(false),
mNeedsRebuild(true),
mConstructed(false),
mVisible(true),
mXBLAttached(false) {
mVisible(true) {
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
if (!gMenuMethodsSwizzled) {
@ -390,20 +384,6 @@ void nsMenuX::MenuConstruct() {
return;
}
// bug 365405: Manually wrap the menupopup node to make sure it's bounded
if (!mXBLAttached) {
nsCOMPtr<nsIXPConnect> xpconnect = nsIXPConnect::XPConnect();
dom::Document* ownerDoc = menuPopup->OwnerDoc();
dom::AutoJSAPI jsapi;
if (ownerDoc && jsapi.Init(ownerDoc->GetInnerWindow())) {
JSContext* cx = jsapi.cx();
JS::RootedObject ignoredObj(cx);
xpconnect->WrapNative(cx, JS::CurrentGlobalOrNull(cx), menuPopup, NS_GET_IID(nsISupports),
ignoredObj.address());
mXBLAttached = true;
}
}
// Iterate over the kids
for (nsIContent* child = menuPopup->GetFirstChild(); child; child = child->GetNextSibling()) {
// depending on the type, create a menu item, separator, or submenu