mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-15 06:15:43 +00:00
Backout the previous landing (15229e2a01b1) for Bug 978862, since it had wrong bug number, r=backout
This commit is contained in:
parent
bbe169ea7d
commit
f4adc577ea
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user