Bug 966002 - Buffer async events to media elements while event delivery is paused like we do for sync events. r=roc

This commit is contained in:
Chris Pearce 2014-01-31 13:14:17 -05:00
parent 0f24a925f1
commit b6b377ce43

View File

@ -3294,6 +3294,13 @@ nsresult HTMLMediaElement::DispatchAsyncEvent(const nsAString& aName)
LOG_EVENT(PR_LOG_DEBUG, ("%p Queuing event %s", this,
NS_ConvertUTF16toUTF8(aName).get()));
// Save events that occur while in the bfcache. These will be dispatched
// if the page comes out of the bfcache.
if (mEventDeliveryPaused) {
mPendingEvents.AppendElement(aName);
return NS_OK;
}
nsCOMPtr<nsIRunnable> event = new nsAsyncEventRunner(aName, this);
NS_DispatchToMainThread(event, NS_DISPATCH_NORMAL);
return NS_OK;