Bug 553366. When flushing, make sure to flush external documents too. r=bzbarsky

This commit is contained in:
Timothy Nikkel 2010-04-10 13:03:40 -05:00
Родитель d0bd4f6d34
Коммит 705a3fe4ee
4 изменённых файлов: 37 добавлений и 0 удалений

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

@ -705,6 +705,14 @@ public:
*/
virtual void FlushPendingNotifications(mozFlushType aType) = 0;
/**
* Calls FlushPendingNotifications on any external resources this document
* has. If this document has no external resources or is an external resource
* itself this does nothing. This should only be called with
* aType >= Flush_Style.
*/
virtual void FlushExternalResources(mozFlushType aType) = 0;
nsBindingManager* BindingManager() const
{
return mNodeInfoManager->GetBindingManager();

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

@ -6445,6 +6445,26 @@ nsDocument::FlushPendingNotifications(mozFlushType aType)
}
}
static PRBool
Flush(nsIDocument* aDocument, void* aData)
{
const mozFlushType* type = static_cast<const mozFlushType*>(aData);
aDocument->FlushPendingNotifications(*type);
return PR_TRUE;
}
void
nsDocument::FlushExternalResources(mozFlushType aType)
{
NS_ASSERTION(aType >= Flush_Style,
"should only need to flush for style or higher in external resources");
if (GetDisplayDocument()) {
return;
}
EnumerateExternalResources(Flush, &aType);
}
nsIScriptEventManager*
nsDocument::GetScriptEventManager()
{

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

@ -704,6 +704,7 @@ public:
nsIStyleRule* aStyleRule);
virtual void FlushPendingNotifications(mozFlushType aType);
virtual void FlushExternalResources(mozFlushType aType);
virtual nsIScriptEventManager* GetScriptEventManager();
virtual void SetXMLDeclaration(const PRUnichar *aVersion,
const PRUnichar *aEncoding,

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

@ -4571,6 +4571,14 @@ PresShell::FlushPendingNotifications(mozFlushType aType)
// batching if we only have style reresolve
nsIViewManager::UpdateViewBatch batch(mViewManager);
// We need to make sure external resource documents are flushed too (for
// example, svg filters that reference a filter in an external document
// need the frames in the external document to be constructed for the
// filter to work). We only need external resources to be flushed when the
// main document is flushing >= Flush_Frames, so we flush external
// resources here instead of nsDocument::FlushPendingNotifications.
mDocument->FlushExternalResources(aType);
// Force flushing of any pending content notifications that might have
// queued up while our event was pending. That will ensure that we don't
// construct frames for content right now that's still waiting to be