Make sure to flush out the content model before processing restyles; otherwise
we can end up with odd content duplication. Bug 309986, r+sr=dbaron git-svn-id: svn://10.0.0.236/trunk@180938 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -3977,10 +3977,20 @@ HTMLContentSink::BeginUpdate(nsIDocument *aDocument, nsUpdateType aUpdateType)
|
||||
// notification to occur. Since this could result in frame
|
||||
// creation, make sure we've flushed everything before we
|
||||
// continue.
|
||||
// Also increment mInNotification to make sure we don't flush again
|
||||
// until the end of this update, even if nested updates or
|
||||
|
||||
// Note that UPDATE_CONTENT_STATE notifications never cause
|
||||
// synchronous frame construction, so we never have to worry about
|
||||
// them here. The code that handles the async event these
|
||||
// notifications post will flush us out if it needs to.
|
||||
|
||||
// Also, if this is not an UPDATE_CONTENT_STATE notification,
|
||||
// increment mInNotification to make sure we don't flush again until
|
||||
// the end of this update, even if nested updates or
|
||||
// FlushPendingNotifications calls happen during it.
|
||||
if (!mInNotification++ && mCurrentContext) {
|
||||
NS_ASSERTION(aUpdateType && (aUpdateType & UPDATE_ALL) == aUpdateType,
|
||||
"Weird update type bitmask");
|
||||
if (aUpdateType != UPDATE_CONTENT_STATE && !mInNotification++ &&
|
||||
mCurrentContext) {
|
||||
mCurrentContext->FlushTags(PR_TRUE);
|
||||
}
|
||||
}
|
||||
@@ -3992,8 +4002,13 @@ HTMLContentSink::EndUpdate(nsIDocument *aDocument, nsUpdateType aUpdateType)
|
||||
// something else in the script processing caused the
|
||||
// notification to occur. Update our notion of how much
|
||||
// has been flushed to include any new content if ending
|
||||
// this update leaves us not inside a notification.
|
||||
if (!--mInNotification) {
|
||||
// this update leaves us not inside a notification. Note that we
|
||||
// exclude UPDATE_CONTENT_STATE notifications here, since those
|
||||
// never affect the frame model directly while inside the
|
||||
// notification.
|
||||
NS_ASSERTION(aUpdateType && (aUpdateType & UPDATE_ALL) == aUpdateType,
|
||||
"Weird update type bitmask");
|
||||
if (aUpdateType != UPDATE_CONTENT_STATE && !--mInNotification) {
|
||||
UpdateAllContexts();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user