Bug 666869 - Crash [@ nsGlobalWindow::GetPerformance]. r=smaug

This commit is contained in:
Mounir Lamouri 2011-06-27 00:08:33 +02:00
parent 9e6735ba79
commit ce91f8d4ca
3 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<script>
function boom()
{
var f = document.getElementById("f");
var frameWin = f.contentWindow;
document.body.removeChild(f);
frameWin.performance;
}
</script>
</head>
<body onload="boom();"><iframe id="f" src="data:text/html,1"></iframe></body>
</html>

View File

@ -27,3 +27,4 @@ load 601247.html
load 609560-1.xhtml
load 612018-1.html
load 637116.html
load 666869.html

View File

@ -2987,6 +2987,9 @@ nsGlobalWindow::GetPerformance(nsIDOMPerformance** aPerformance)
if (nsGlobalWindow::HasPerformanceSupport()) {
if (!mPerformance) {
if (!mDoc) {
return NS_OK;
}
nsRefPtr<nsDOMNavigationTiming> timing = mDoc->GetNavigationTiming();
if (timing) {
mPerformance = new nsPerformance(timing);