Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.

git-svn-id: svn://10.0.0.236/trunk@216738 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dbaron%dbaron.org
2006-12-08 05:38:33 +00:00
parent 1a1de382fe
commit 1ca9f3f372
201 changed files with 8730 additions and 18257 deletions

View File

@@ -3136,9 +3136,20 @@ NS_IMETHODIMP DocumentViewerImpl::SizeToContent()
// Flush out all content and style updates. We can't use a resize reflow
// because it won't change some sizes that a style change reflow will.
mDocument->FlushPendingNotifications(Flush_Layout);
NS_ENSURE_SUCCESS(presShell->ResizeReflow(NS_UNCONSTRAINEDSIZE,
NS_UNCONSTRAINEDSIZE), NS_ERROR_FAILURE);
nsIFrame *root = presShell->GetRootFrame();
NS_ENSURE_TRUE(root, NS_ERROR_FAILURE);
nscoord prefWidth;
{
nsCOMPtr<nsIRenderingContext> rcx;
presShell->CreateRenderingContext(root, getter_AddRefs(rcx));
NS_ENSURE_TRUE(rcx, NS_ERROR_FAILURE);
prefWidth = root->GetPrefWidth(rcx);
}
nsresult rv = presShell->ResizeReflow(prefWidth, NS_UNCONSTRAINEDSIZE);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsPresContext> presContext;
GetPresContext(getter_AddRefs(presContext));