mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07: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
b6cebd8f3a
commit
a6fe8cb324
@ -1477,7 +1477,7 @@ public:
|
|||||||
// Returns PR_FALSE if something erroneous happened.
|
// Returns PR_FALSE if something erroneous happened.
|
||||||
PRBool Push(nsPIDOMEventTarget *aCurrentTarget);
|
PRBool Push(nsPIDOMEventTarget *aCurrentTarget);
|
||||||
// If a null JSContext is passed to Push(), that will cause no
|
// 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);
|
PRBool Push(JSContext *cx);
|
||||||
// Explicitly push a null JSContext on the the stack
|
// Explicitly push a null JSContext on the the stack
|
||||||
PRBool PushNull();
|
PRBool PushNull();
|
||||||
|
@ -2712,6 +2712,13 @@ nsCxPusher::Push(nsPIDOMEventTarget *aCurrentTarget)
|
|||||||
nsCOMPtr<nsIScriptContext> scx;
|
nsCOMPtr<nsIScriptContext> scx;
|
||||||
nsresult rv = aCurrentTarget->GetContextForEventHandlers(getter_AddRefs(scx));
|
nsresult rv = aCurrentTarget->GetContextForEventHandlers(getter_AddRefs(scx));
|
||||||
NS_ENSURE_SUCCESS(rv, PR_FALSE);
|
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;
|
JSContext* cx = nsnull;
|
||||||
|
|
||||||
if (scx) {
|
if (scx) {
|
||||||
|
Loading…
Reference in New Issue
Block a user