Backout the previous landing (15229e2a01b1) for Bug 978862, since it had wrong bug number, r=backout

This commit is contained in:
Olli Pettay 2014-03-05 15:16:04 +02:00
parent b341b04a8d
commit c407e32e40

View File

@ -809,8 +809,7 @@ nsEventListenerManager::CompileEventHandlerInternal(nsListenerStruct *aListenerS
JS::Rooted<JSObject*> scope(cx, listener->GetEventScope());
nsCOMPtr<nsIAtom> typeAtom = aListenerStruct->mTypeAtom;
nsIAtom* attrName = typeAtom;
nsIAtom* attrName = aListenerStruct->mTypeAtom;
if (aListenerStruct->mHandlerIsString) {
// OK, we didn't find an existing compiled event handler. Flag us
@ -851,7 +850,6 @@ nsEventListenerManager::CompileEventHandlerInternal(nsListenerStruct *aListenerS
body = &handlerBody;
aElement = element;
}
aListenerStruct = nullptr;
uint32_t lineNo = 0;
nsAutoCString url (NS_LITERAL_CSTRING("-moz-evil:lying-event-listener"));
@ -866,7 +864,7 @@ nsEventListenerManager::CompileEventHandlerInternal(nsListenerStruct *aListenerS
uint32_t argCount;
const char **argNames;
nsContentUtils::GetEventArgNames(aElement->GetNameSpaceID(),
typeAtom,
aListenerStruct->mTypeAtom,
&argCount, &argNames);
JSAutoCompartment ac(cx, context->GetWindowProxy());
@ -896,13 +894,11 @@ nsEventListenerManager::CompileEventHandlerInternal(nsListenerStruct *aListenerS
JS::Rooted<JSObject*> handlerFun(cx);
result = nsJSUtils::CompileFunction(cx, JS::NullPtr(), options,
nsAtomCString(typeAtom),
nsAtomCString(aListenerStruct->mTypeAtom),
argCount, argNames, *body, handlerFun.address());
NS_ENSURE_SUCCESS(result, result);
handler = handlerFun;
NS_ENSURE_TRUE(handler, NS_ERROR_FAILURE);
} else {
aListenerStruct = nullptr;
}
if (handler) {
@ -910,6 +906,7 @@ nsEventListenerManager::CompileEventHandlerInternal(nsListenerStruct *aListenerS
// Bind it
JS::Rooted<JSObject*> boundHandler(cx);
context->BindCompiledEventHandler(mTarget, scope, handler, &boundHandler);
aListenerStruct = nullptr;
// Note - We pass null for aIncumbentGlobal below. We could also pass the
// compilation global, but since the handler is guaranteed to be scripted,
// there's no need to use an override, since the JS engine will always give