From 1bdcddf20c9cf4874c125ea16325c395654482ff Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Sat, 27 May 2017 22:13:24 -0400 Subject: [PATCH] Bug 1361709 - Move FlushPendingLinkUpdatesFromRunnable to idle dispatch; r=smaug --- dom/base/nsDocument.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index 86b6ed96ec79..2b373a075dea 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -10010,9 +10010,9 @@ nsIDocument::RegisterPendingLinkUpdate(Link* aLink) if (!mHasLinksToUpdateRunnable) { nsCOMPtr event = NewRunnableMethod(this, &nsIDocument::FlushPendingLinkUpdatesFromRunnable); + // Do this work in a second in the worst case. nsresult rv = - Dispatch("nsIDocument::FlushPendingLinkUpdatesFromRunnable", - TaskCategory::Other, event.forget()); + NS_IdleDispatchToCurrentThread(event.forget(), 1000); if (NS_FAILED(rv)) { // If during shutdown posting a runnable doesn't succeed, we probably // don't need to update link states.