Fix bogus assumptions in inspector that can lead to crashes. Bug

270771. r=timeless, sr=jst
This commit is contained in:
bzbarsky%mit.edu 2004-11-24 15:55:06 +00:00
Родитель b00883eb33
Коммит 9caafdc4d5
2 изменённых файлов: 10 добавлений и 3 удалений

Просмотреть файл

@ -99,7 +99,11 @@ inDOMUtils::IsIgnorableWhitespace(nsIDOMCharacterData *aDataNode,
}
nsCOMPtr<nsIPresShell> presShell = inLayoutUtils::GetPresShellFor(win);
NS_ASSERTION(presShell, "No pres shell!");
if (!presShell) {
// Display:none iframe or something... Bail out
return NS_OK;
}
nsIFrame* frame;
nsCOMPtr<nsIContent> content = do_QueryInterface(aDataNode);

Просмотреть файл

@ -166,7 +166,8 @@ inFlasher::DrawElementOutline(nsIDOMElement* aElement)
nsCOMPtr<nsIDOMWindowInternal> window = inLayoutUtils::GetWindowFor(aElement);
if (!window) return NS_OK;
nsCOMPtr<nsIPresShell> presShell = inLayoutUtils::GetPresShellFor(window);
if (!presShell) return NS_OK;
nsPresContext *presContext = presShell->GetPresContext();
float p2t = presContext->PixelsToTwips();
@ -210,7 +211,9 @@ inFlasher::ScrollElementIntoView(nsIDOMElement *aElement)
}
nsCOMPtr<nsIPresShell> presShell = inLayoutUtils::GetPresShellFor(window);
NS_ASSERTION(presShell, "Dude, where's my pres shell?!");
if (!presShell) {
return NS_OK;
}
nsIFrame* frame = inLayoutUtils::GetFrameFor(aElement, presShell);
if (!frame) {
return NS_OK;