Bug 492387. Flush out content notifications before initing our editor. r+sr=jst

This commit is contained in:
Boris Zbarsky
2009-05-19 10:49:57 -04:00
parent 94de19e345
commit c4a29e7291

View File

@@ -1387,6 +1387,21 @@ nsTextControlFrame::CalcIntrinsicSize(nsIRenderingContext* aRenderingContext,
void
nsTextControlFrame::DelayedEditorInit()
{
nsIDocument* doc = mContent->GetCurrentDoc();
if (!doc) {
return;
}
nsWeakFrame weakFrame(this);
// Flush out content on our document. Have to do this, because script
// blockers don't prevent the sink flushing out content and notifying in the
// process, which can destroy frames.
doc->FlushPendingNotifications(Flush_ContentAndNotify);
if (!weakFrame.IsAlive()) {
return;
}
// Make sure that editor init doesn't do things that would kill us off
// (especially off the script blockers it'll create for its DOM mutations).
nsAutoScriptBlocker scriptBlocker;