Update our child counts if notifying on our children caused more updates. bug 376761, r=bzbarsky sr=sicking

git-svn-id: svn://10.0.0.236/trunk@226590 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mrbkap%gmail.com 2007-05-17 23:54:35 +00:00
parent e0d2a3a834
commit 5b0afeed77
4 changed files with 21 additions and 0 deletions

View File

@ -1,4 +1,5 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 sw=2 et tw=78: */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
@ -1404,6 +1405,11 @@ nsContentSink::FavorPerformanceHint(PRBool perfOverStarvation, PRUint32 starvati
void
nsContentSink::BeginUpdate(nsIDocument *aDocument, nsUpdateType aUpdateType)
{
// Remember nested updates from updates that we started.
if (mInNotification && mUpdatesInNotification < 2) {
++mUpdatesInNotification;
}
// If we're in a script and we didn't do the notification,
// something else in the script processing caused the
// notification to occur. Since this could result in frame

View File

@ -293,6 +293,7 @@ protected:
PRInt32 mInMonolithicContainer;
PRInt32 mInNotification;
PRUint32 mUpdatesInNotification;
PRUint32 mPendingSheetCount;

View File

@ -1346,8 +1346,10 @@ nsresult
SinkContext::FlushTags()
{
PRBool oldBeganUpdate = mSink->mBeganUpdate;
PRUint32 oldUpdates = mSink->mUpdatesInNotification;
++(mSink->mInNotification);
mSink->mUpdatesInNotification = 0;
{
// Scope so we call EndUpdate before we decrease mInNotification
mozAutoDocUpdate updateBatch(mSink->mDocument, UPDATE_CONTENT_MODEL,
@ -1406,6 +1408,11 @@ SinkContext::FlushTags()
}
--(mSink->mInNotification);
if (mSink->mUpdatesInNotification > 1) {
UpdateChildCounts();
}
mSink->mUpdatesInNotification = oldUpdates;
mSink->mBeganUpdate = oldBeganUpdate;
return NS_OK;

View File

@ -1534,7 +1534,9 @@ nsresult
nsXMLContentSink::FlushTags()
{
PRBool oldBeganUpdate = mBeganUpdate;
PRUint32 oldUpdates = mUpdatesInNotification;
mUpdatesInNotification = 0;
++mInNotification;
{
// Scope so we call EndUpdate before we decrease mInNotification
@ -1569,6 +1571,11 @@ nsXMLContentSink::FlushTags()
}
--mInNotification;
if (mUpdatesInNotification > 1) {
UpdateChildCounts();
}
mUpdatesInNotification = oldUpdates;
mBeganUpdate = oldBeganUpdate;
return NS_OK;