Don't make embedding of a content viewer in a child frame force a layout flushon the parent. The child doesn't really care that much about up-to-date layoutinfo at this point; if its size changes it will deal. Bug 379485, r+sr=jst

This commit is contained in:
bzbarsky@mit.edu 2007-05-02 13:34:41 -07:00
parent 3e0134e2f5
commit b2bf331b94
2 changed files with 13 additions and 3 deletions

View File

@ -3591,6 +3591,14 @@ nsDocShell::GetPositionAndSize(PRInt32 * x, PRInt32 * y, PRInt32 * cx,
doc->FlushPendingNotifications(Flush_Layout);
}
DoGetPositionAndSize(x, y, cx, cy);
return NS_OK;
}
void
nsDocShell::DoGetPositionAndSize(PRInt32 * x, PRInt32 * y, PRInt32 * cx,
PRInt32 * cy)
{
if (x)
*x = mBounds.x;
if (y)
@ -3599,8 +3607,6 @@ nsDocShell::GetPositionAndSize(PRInt32 * x, PRInt32 * y, PRInt32 * cx,
*cx = mBounds.width;
if (cy)
*cy = mBounds.height;
return NS_OK;
}
NS_IMETHODIMP
@ -5898,7 +5904,7 @@ nsDocShell::SetupNewViewer(nsIContentViewer * aNewViewer)
// This will get the size from the current content viewer or from the
// Init settings
GetPositionAndSize(&x, &y, &cx, &cy);
DoGetPositionAndSize(&x, &y, &cx, &cy);
nsCOMPtr<nsIDocShellTreeItem> parentAsItem;
NS_ENSURE_SUCCESS(GetSameTypeParent(getter_AddRefs(parentAsItem)),

View File

@ -475,6 +475,10 @@ protected:
// Call BeginRestore(nsnull, PR_FALSE) for each child of this shell.
nsresult BeginRestoreChildren();
// Method to get our current position and size without flushing
void DoGetPositionAndSize(PRInt32 * x, PRInt32 * y, PRInt32 * cx,
PRInt32 * cy);
// Check whether aURI should inherit our security context
static nsresult URIInheritsSecurityContext(nsIURI* aURI, PRBool* aResult);