[docshell] Stop loading of the document if network load is stopped.

After all, stop means stop.
This commit is contained in:
Moonchild
2021-03-24 11:41:58 +00:00
parent c1b064b99f
commit 021fecdedc
+9 -1
View File
@@ -5449,11 +5449,19 @@ nsDocShell::Stop(uint32_t aStopFlags)
} }
if (nsIWebNavigation::STOP_CONTENT & aStopFlags) { if (nsIWebNavigation::STOP_CONTENT & aStopFlags) {
// Stop the document loading // Stop the document loading and animations
if (mContentViewer) { if (mContentViewer) {
nsCOMPtr<nsIContentViewer> cv = mContentViewer; nsCOMPtr<nsIContentViewer> cv = mContentViewer;
cv->Stop(); cv->Stop();
} }
} else if (nsIWebNavigation::STOP_NETWORK & aStopFlags) {
// Stop the document loading only
if (mContentViewer) {
RefPtr<nsIDocument> doc = mContentViewer->GetDocument();
if (doc) {
doc->StopDocumentLoad();
}
}
} }
if (nsIWebNavigation::STOP_NETWORK & aStopFlags) { if (nsIWebNavigation::STOP_NETWORK & aStopFlags) {