mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 20:35:50 +00:00
Bug 477700 followup. Don't fail Push() calls for an event target that has no associated script context at all. r+sr=smaug pending
This commit is contained in:
parent
9b36372ed7
commit
8ef08be578
@ -1477,7 +1477,7 @@ public:
|
||||
// Returns PR_FALSE if something erroneous happened.
|
||||
PRBool Push(nsPIDOMEventTarget *aCurrentTarget);
|
||||
// If a null JSContext is passed to Push(), that will cause no
|
||||
// Push() to happen and an error to be returned.
|
||||
// push to happen and false to be returned.
|
||||
PRBool Push(JSContext *cx);
|
||||
// Explicitly push a null JSContext on the the stack
|
||||
PRBool PushNull();
|
||||
|
@ -2712,6 +2712,13 @@ nsCxPusher::Push(nsPIDOMEventTarget *aCurrentTarget)
|
||||
nsCOMPtr<nsIScriptContext> scx;
|
||||
nsresult rv = aCurrentTarget->GetContextForEventHandlers(getter_AddRefs(scx));
|
||||
NS_ENSURE_SUCCESS(rv, PR_FALSE);
|
||||
|
||||
if (!scx) {
|
||||
// Nothing to do here, I guess. Have to return true so that event firing
|
||||
// will still work correctly even if there is no associated JSContext
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
JSContext* cx = nsnull;
|
||||
|
||||
if (scx) {
|
||||
|
Loading…
Reference in New Issue
Block a user