mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 466409. If the load is stopped, don't run any pending scripts. r+sr=sicking
This commit is contained in:
parent
b7e8beed7e
commit
69367704d2
@ -1780,7 +1780,7 @@ nsContentSink::ReadyToCallDidBuildModelImpl(PRBool aTerminated)
|
||||
}
|
||||
|
||||
if (mScriptLoader) {
|
||||
mScriptLoader->EndDeferringScripts(aTerminated);
|
||||
mScriptLoader->ParsingComplete(aTerminated);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1029,23 +1029,24 @@ nsScriptLoader::ShouldExecuteScript(nsIDocument* aDocument,
|
||||
}
|
||||
|
||||
void
|
||||
nsScriptLoader::EndDeferringScripts(PRBool aKillDeferred)
|
||||
nsScriptLoader::ParsingComplete(PRBool aTerminated)
|
||||
{
|
||||
if (mDeferEnabled) {
|
||||
// Have to check because we apparently get EndDeferringScripts
|
||||
// Have to check because we apparently get ParsingComplete
|
||||
// without BeginDeferringScripts in some cases
|
||||
mUnblockOnloadWhenDoneProcessing = PR_TRUE;
|
||||
}
|
||||
mDeferEnabled = PR_FALSE;
|
||||
for (PRUint32 i = 0; i < (PRUint32)mRequests.Count(); ++i) {
|
||||
if (aKillDeferred && mRequests[i]->mDefer) {
|
||||
mRequests.RemoveObjectAt(i--);
|
||||
}
|
||||
else {
|
||||
if (aTerminated) {
|
||||
mRequests.Clear();
|
||||
} else {
|
||||
for (PRUint32 i = 0; i < (PRUint32)mRequests.Count(); ++i) {
|
||||
mRequests[i]->mDefer = PR_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
// Have to call this even if aTerminated so we'll correctly unblock
|
||||
// onload and all.
|
||||
ProcessPendingRequests();
|
||||
}
|
||||
|
||||
|
@ -209,16 +209,15 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops defering scripts and immediately processes the mDeferredRequests
|
||||
* queue.
|
||||
* Notifies the script loader that parsing is done. If aTerminated is true,
|
||||
* this will drop any pending scripts that haven't run yet. Otherwise, it
|
||||
* will stops deferring scripts and immediately processes the
|
||||
* mDeferredRequests queue.
|
||||
*
|
||||
* WARNING: This function will syncronously execute content scripts, so be
|
||||
* WARNING: This function will synchronously execute content scripts, so be
|
||||
* prepared that the world might change around you.
|
||||
*
|
||||
* If aKillDeferred is PR_TRUE, deferred scripts won't be run, but instead
|
||||
* removed.
|
||||
*/
|
||||
void EndDeferringScripts(PRBool aKillDeferred);
|
||||
void ParsingComplete(PRBool aTerminated);
|
||||
|
||||
/**
|
||||
* Returns the number of pending scripts, deferred or not.
|
||||
|
Loading…
Reference in New Issue
Block a user