зеркало из https://github.com/mozilla/gecko-dev.git
Fixing bug 399406. Make sure to initialize LiveConnect (if needed) when loading applets. r+sr+a=jonas@sicking.cc
This commit is contained in:
Родитель
a02d014a1a
Коммит
e7088bc20a
|
@ -152,6 +152,7 @@
|
|||
#include "nsIScriptError.h"
|
||||
#include "nsIScriptEventManager.h" // For GetInterface()
|
||||
#include "nsIConsoleService.h"
|
||||
#include "nsIControllers.h"
|
||||
#include "nsIControllerContext.h"
|
||||
#include "nsGlobalWindowCommands.h"
|
||||
#include "nsAutoPtr.h"
|
||||
|
|
|
@ -56,7 +56,6 @@
|
|||
#include "nsDOMWindowList.h"
|
||||
#include "nsIBaseWindow.h"
|
||||
#include "nsIBrowserDOMWindow.h"
|
||||
#include "nsIControllers.h"
|
||||
#include "nsIDocShellTreeOwner.h"
|
||||
#include "nsIDocShellTreeItem.h"
|
||||
#include "nsIDOMClientInformation.h"
|
||||
|
@ -108,6 +107,7 @@ class nsIContent;
|
|||
class nsPresContext;
|
||||
class nsIDOMEvent;
|
||||
class nsIScrollableView;
|
||||
class nsIControllers;
|
||||
|
||||
class nsBarProp;
|
||||
class nsLocation;
|
||||
|
|
|
@ -113,6 +113,8 @@ AutoPushJSContext::AutoPushJSContext(nsISupports* aSecuritySupports,
|
|||
nsCOMPtr<nsIJSContextStack> contextStack =
|
||||
do_GetService("@mozilla.org/js/xpc/ContextStack;1");
|
||||
|
||||
JS_BeginRequest(cx);
|
||||
|
||||
JSContext* currentCX;
|
||||
if(contextStack &&
|
||||
// Don't push if the current context is already on the stack.
|
||||
|
@ -195,6 +197,7 @@ AutoPushJSContext::~AutoPushJSContext()
|
|||
if (mFrame.script)
|
||||
mContext->fp = mFrame.down;
|
||||
|
||||
JS_EndRequest(mContext);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -190,6 +190,7 @@ LOCAL_INCLUDES += \
|
|||
-I$(srcdir)/../../content/xul/content/src \
|
||||
-I$(srcdir)/../../content/base/src \
|
||||
-I$(srcdir)/../../content/html/content/src \
|
||||
-I$(srcdir)/../../dom/src/base \
|
||||
$(MOZ_CAIRO_CFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -108,6 +108,7 @@
|
|||
#include "nsDisplayList.h"
|
||||
#include "nsAttrName.h"
|
||||
#include "nsDataHashtable.h"
|
||||
#include "nsGlobalWindow.h"
|
||||
|
||||
// headers for plugin scriptability
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
|
@ -1385,6 +1386,20 @@ nsObjectFrame::PrepareInstanceOwner()
|
|||
|
||||
NS_ADDREF(mInstanceOwner);
|
||||
mInstanceOwner->Init(PresContext(), this, GetContent());
|
||||
|
||||
if (mContent->Tag() == nsGkAtoms::applet) {
|
||||
nsGlobalWindow *win =
|
||||
(nsGlobalWindow *)mContent->GetOwnerDoc()->GetScriptGlobalObject();
|
||||
|
||||
if (win) {
|
||||
// Initialize Java properties on the window object to make sure
|
||||
// LiveConnect gets initialized if needed. This can be removed
|
||||
// for Mozilla2 once there is no more LiveConnect.
|
||||
|
||||
win->InitJavaProperties();
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче