зеркало из https://github.com/mozilla/pjs.git
Fix crash on certain pages. b=118829 r=jag sr=waterson
This commit is contained in:
Родитель
86023b43eb
Коммит
5f67a2f0fd
|
@ -2438,12 +2438,15 @@ FindCanvasBackground(nsIPresContext* aPresContext,
|
||||||
nsCOMPtr<nsIDOMHTMLElement> body;
|
nsCOMPtr<nsIDOMHTMLElement> body;
|
||||||
htmlDoc->GetBody(getter_AddRefs(body));
|
htmlDoc->GetBody(getter_AddRefs(body));
|
||||||
nsCOMPtr<nsIContent> bodyContent = do_QueryInterface(body);
|
nsCOMPtr<nsIContent> bodyContent = do_QueryInterface(body);
|
||||||
nsCOMPtr<nsIPresShell> shell;
|
NS_ASSERTION(bodyContent, "no body node"); // bug 118829
|
||||||
aPresContext->GetShell(getter_AddRefs(shell));
|
if (bodyContent) {
|
||||||
nsIFrame *bodyFrame;
|
nsCOMPtr<nsIPresShell> shell;
|
||||||
shell->GetPrimaryFrameFor(bodyContent, &bodyFrame);
|
aPresContext->GetShell(getter_AddRefs(shell));
|
||||||
if (bodyFrame)
|
nsIFrame *bodyFrame;
|
||||||
::GetStyleData(bodyFrame, &result);
|
nsresult rv = shell->GetPrimaryFrameFor(bodyContent, &bodyFrame);
|
||||||
|
if (NS_SUCCEEDED(rv) && bodyFrame)
|
||||||
|
::GetStyleData(bodyFrame, &result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2438,12 +2438,15 @@ FindCanvasBackground(nsIPresContext* aPresContext,
|
||||||
nsCOMPtr<nsIDOMHTMLElement> body;
|
nsCOMPtr<nsIDOMHTMLElement> body;
|
||||||
htmlDoc->GetBody(getter_AddRefs(body));
|
htmlDoc->GetBody(getter_AddRefs(body));
|
||||||
nsCOMPtr<nsIContent> bodyContent = do_QueryInterface(body);
|
nsCOMPtr<nsIContent> bodyContent = do_QueryInterface(body);
|
||||||
nsCOMPtr<nsIPresShell> shell;
|
NS_ASSERTION(bodyContent, "no body node"); // bug 118829
|
||||||
aPresContext->GetShell(getter_AddRefs(shell));
|
if (bodyContent) {
|
||||||
nsIFrame *bodyFrame;
|
nsCOMPtr<nsIPresShell> shell;
|
||||||
shell->GetPrimaryFrameFor(bodyContent, &bodyFrame);
|
aPresContext->GetShell(getter_AddRefs(shell));
|
||||||
if (bodyFrame)
|
nsIFrame *bodyFrame;
|
||||||
::GetStyleData(bodyFrame, &result);
|
nsresult rv = shell->GetPrimaryFrameFor(bodyContent, &bodyFrame);
|
||||||
|
if (NS_SUCCEEDED(rv) && bodyFrame)
|
||||||
|
::GetStyleData(bodyFrame, &result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче