mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1162850 - Don't stop looking for style sheet load finishes after the FontFaceSet gets a DOMContentLoaded. r=jdaggett
This commit is contained in:
parent
c973b378b0
commit
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.
|
||||
|
Loading…
Reference in New Issue
Block a user