Introduce a GetPrimaryShell() API on nsIDocument. Convert existing callers of

GetShellAt(0) to using this API.  Bug 378780.  API introduction part by me,
r+sr=jst.  Mass-changes done by taras using squash, r+sr=me


git-svn-id: svn://10.0.0.236/trunk@225416 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2007-05-01 22:24:25 +00:00
parent a14d456f30
commit d2d337437c
71 changed files with 129 additions and 120 deletions

View File

@@ -1239,7 +1239,7 @@ nsHTMLDocument::SetCompatibilityMode(nsCompatibility aMode)
mCompatMode = aMode;
CSSLoader()->SetCompatibilityMode(mCompatMode);
nsCOMPtr<nsIPresShell> shell = GetShellAt(0);
nsCOMPtr<nsIPresShell> shell = GetPrimaryShell();
if (shell) {
nsPresContext *pc = shell->GetPresContext();
if (pc) {
@@ -2732,7 +2732,7 @@ nsHTMLDocument::GetWidth(PRInt32* aWidth)
// is the one for which we need information.
// Since GetPixelDimensions flushes and flushing can destroy
// our shell, hold a strong ref to it.
nsCOMPtr<nsIPresShell> shell = GetShellAt(0);
nsCOMPtr<nsIPresShell> shell = GetPrimaryShell();
if (!shell) {
return NS_OK;
}
@@ -2754,7 +2754,7 @@ nsHTMLDocument::GetHeight(PRInt32* aHeight)
// is the one for which we need information.
// Since GetPixelDimensions flushes and flushing can destroy
// our shell, hold a strong ref to it.
nsCOMPtr<nsIPresShell> shell = GetShellAt(0);
nsCOMPtr<nsIPresShell> shell = GetPrimaryShell();
if (!shell) {
return NS_OK;
}