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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user