From 6d4c239fd88182ef4d3916932053e16b83943d0d Mon Sep 17 00:00:00 2001 From: Jonathan Watt Date: Fri, 18 May 2018 12:45:18 +0100 Subject: [PATCH] Bug 1466431 - Fix resolving of the document.fonts.ready Promise for documents that never load fonts. r=heycam --- layout/style/FontFaceSet.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/layout/style/FontFaceSet.cpp b/layout/style/FontFaceSet.cpp index 8643f4929e37..e343dc873c23 100644 --- a/layout/style/FontFaceSet.cpp +++ b/layout/style/FontFaceSet.cpp @@ -1768,9 +1768,10 @@ FontFaceSet::CheckLoadingFinished() return; } - if (mStatus == FontFaceSetLoadStatus::Loaded) { - // We've already resolved mReady and dispatched the loadingdone/loadingerror - // events. + if ((mReady && mReady->State() != Promise::PromiseState::Pending) || + mResolveLazilyCreatedReadyPromise) { + // We've already resolved mReady (or set the flag to do that lazily) and + // dispatched the loadingdone/loadingerror events. return; }