Bug 779430, try to not flush layout while we're in process to restore a bfcached document, r=bz

--HG--
extra : rebase_source : 3705e6d15a8209d2abb7efb97e05b21d015210f7
This commit is contained in:
Olli Pettay 2016-01-16 02:23:21 +02:00
Родитель 1567e4e3c3
Коммит 5870c93f38
1 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

@ -29,7 +29,7 @@
#include "nsITransport.h"
#include "nsISocketTransport.h"
#include "nsIDocShell.h"
#include "nsIDOMDocument.h"
#include "nsIDocument.h"
#include "nsPresContext.h"
@ -602,7 +602,14 @@ nsDocLoader::OnStopRequest(nsIRequest *aRequest,
// load. This will handle removing the request from our hashtable as needed.
//
if (mIsLoadingDocument) {
DocLoaderIsEmpty(true);
nsCOMPtr<nsIDocShell> ds = do_QueryInterface(static_cast<nsIRequestObserver*>(this));
bool doNotFlushLayout = false;
if (ds) {
// Don't do unexpected layout flushes while we're in process of restoring
// a document from the bfcache.
ds->GetRestoringDocument(&doNotFlushLayout);
}
DocLoaderIsEmpty(!doNotFlushLayout);
}
return NS_OK;