mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 521668: Fire DOMLinkAdded asynchronously to avoid unexpected recursion. r=bent sr=jst
This commit is contained in:
parent
5c06d159bb
commit
f84ddd9e6b
@ -268,15 +268,9 @@ nsHTMLLinkElement::CreateAndDispatchEvent(nsIDocument* aDoc,
|
||||
|
||||
nsRefPtr<nsPLDOMEvent> event = new nsPLDOMEvent(this, aEventName, PR_TRUE);
|
||||
if (event) {
|
||||
// If we have script blockers on the stack then we want to run as soon as
|
||||
// they are removed. Otherwise punt the runable to the event loop as we
|
||||
// don't know when it will be safe to run script. In particular, we might
|
||||
// be in the middle of a pagehide right now, and firing this event at that
|
||||
// point is not such a great idea.
|
||||
if (nsContentUtils::IsSafeToRunScript())
|
||||
event->PostDOMEvent();
|
||||
else
|
||||
event->RunDOMEventWhenSafe();
|
||||
// Always run async in order to avoid running script when the content
|
||||
// sink isn't expecting it.
|
||||
event->PostDOMEvent();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user