Bug 185236 part 2. Make sure to remove our SheetLoadData from mPostedEvents before calling SheetComplete on it, so that checking for pending loads from inside SheetComplete will work correctly. r=peterv

This commit is contained in:
Boris Zbarsky committed 2011-09-26 17:26:05 -04:00
1 parent d635b3b4ba
commit 1356944aec
2 files changed
+7 -2

No files matched your search

+6 -2
View File
@@ -2178,6 +2178,12 @@ Loader::HandleLoadEvent(SheetLoadData* aEvent)
// we're unblocking the parser
// NS_ASSERTION(aEvent->mObserver, "Must have observer");
NS_ASSERTION(aEvent->mSheet, "Must have sheet");
// Very important: this needs to come before the SheetComplete call
// below, so that HasPendingLoads() will test true as needed under
// notifications we send from that SheetComplete call.
mPostedEvents.RemoveElement(aEvent);
if (!aEvent->mIsCancelled) {
// SheetComplete will call Release(), so give it a reference to do
// that with.
@@ -2185,8 +2191,6 @@ Loader::HandleLoadEvent(SheetLoadData* aEvent)
SheetComplete(aEvent, NS_OK);
}
mPostedEvents.RemoveElement(aEvent);
if (mDocument) {
mDocument->UnblockOnload(PR_TRUE);
}
+1
View File
@@ -472,6 +472,7 @@ private:
LoadDataArray mPostedEvents;
// Our array of "global" observers
// XXXbz these are strong refs; should we be cycle collecting CSS loaders?
nsTObserverArray<nsCOMPtr<nsICSSLoaderObserver> > mObservers;
// the load data needs access to the document...