From b2bf331b94546911d309b126669048e9855e5519 Mon Sep 17 00:00:00 2001 From: "bzbarsky@mit.edu" Date: Wed, 2 May 2007 13:34:41 -0700 Subject: [PATCH] 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 --- docshell/base/nsDocShell.cpp | 12 +++++++++--- docshell/base/nsDocShell.h | 4 ++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 35bc3a11470f..14d53fa91ccc 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -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 parentAsItem; NS_ENSURE_SUCCESS(GetSameTypeParent(getter_AddRefs(parentAsItem)), diff --git a/docshell/base/nsDocShell.h b/docshell/base/nsDocShell.h index 68fcb0cdb918..cac77158e46b 100644 --- a/docshell/base/nsDocShell.h +++ b/docshell/base/nsDocShell.h @@ -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);