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);