Flush out layout when doing sync updates. Bug 393723, r+sr=roc, a=dbaron

This commit is contained in:
bzbarsky@mit.edu 2007-08-29 11:57:29 -07:00
Родитель e8ed161c73
Коммит 45d9b9f9f2
1 изменённых файлов: 8 добавлений и 3 удалений

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

@ -2501,7 +2501,7 @@ NS_IMETHODIMP nsEditor::ScrollSelectionIntoView(PRBool aScrollToAnchor)
// If the editor is relying on asynchronous reflows, we have
// to use asynchronous requests to scroll, so that the scrolling happens
// after reflow requests are processed.
// XXXbz why not just always do async scroll?
syncScroll = !(flags & nsIPlaintextEditor::eEditorUseAsyncUpdatesMask);
}
@ -4356,9 +4356,14 @@ nsresult nsEditor::EndUpdateViewBatch()
// If we're doing async updates, use NS_VMREFRESH_DEFERRED here, so that
// the reflows we caused will get processed before the invalidates.
if (flags & nsIPlaintextEditor::eEditorUseAsyncUpdatesMask)
if (flags & nsIPlaintextEditor::eEditorUseAsyncUpdatesMask) {
updateFlag = NS_VMREFRESH_DEFERRED;
} else {
// Flush out layout. Need to do this because if we have no invalidates
// to flush the viewmanager code won't flush our reflow here, and we
// have selection code that does sync caret scrolling in this case.
presShell->FlushPendingNotifications(Flush_Layout);
}
mViewManager->EndUpdateViewBatch(updateFlag);
}