зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1162850 - Don't stop looking for style sheet load finishes after the FontFaceSet gets a DOMContentLoaded. r=jdaggett
This commit is contained in:
Родитель
c973b378b0
Коммит
c888a98f5a
|
@ -136,15 +136,22 @@ FontFaceSet::WrapObject(JSContext* aContext, JS::Handle<JSObject*> aGivenProto)
|
|||
void
|
||||
FontFaceSet::Disconnect()
|
||||
{
|
||||
if (mDocument) {
|
||||
mDocument->RemoveSystemEventListener(NS_LITERAL_STRING("DOMContentLoaded"),
|
||||
this, false);
|
||||
RemoveDOMContentLoadedListener();
|
||||
|
||||
if (mDocument && mDocument->CSSLoader()) {
|
||||
// We're null checking CSSLoader() since FontFaceSet::Disconnect() might be
|
||||
// being called during unlink, at which time the loader amy already have
|
||||
// been unlinked from the document.
|
||||
if (mDocument->CSSLoader()) {
|
||||
mDocument->CSSLoader()->RemoveObserver(this);
|
||||
}
|
||||
mDocument->CSSLoader()->RemoveObserver(this);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
FontFaceSet::RemoveDOMContentLoadedListener()
|
||||
{
|
||||
if (mDocument) {
|
||||
mDocument->RemoveSystemEventListener(NS_LITERAL_STRING("DOMContentLoaded"),
|
||||
this, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1557,7 +1564,7 @@ FontFaceSet::HandleEvent(nsIDOMEvent* aEvent)
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
Disconnect();
|
||||
RemoveDOMContentLoadedListener();
|
||||
CheckLoadingFinished();
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -197,6 +197,8 @@ private:
|
|||
*/
|
||||
void Disconnect();
|
||||
|
||||
void RemoveDOMContentLoadedListener();
|
||||
|
||||
/**
|
||||
* Returns whether there might be any pending font loads, which should cause
|
||||
* the mReady Promise not to be resolved yet.
|
||||
|
|
Загрузка…
Ссылка в новой задаче