Bug 186752 - Crash during background painting when there is no scrollable frame. Add a null check.

r+sr=dbaron
This commit is contained in:
caillon%returnzero.com 2002-12-27 07:32:17 +00:00
Родитель b0be1c8d3b
Коммит 681064b65e
2 изменённых файлов: 38 добавлений и 38 удалений

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

@ -2929,8 +2929,7 @@ nsCSSRendering::PaintBackgroundWithSC(nsIPresContext* aPresContext,
scrollableFrame = GetRootScrollableFrame(aPresContext, rootFrame); scrollableFrame = GetRootScrollableFrame(aPresContext, rootFrame);
} }
NS_ASSERTION(scrollableFrame, "no scrollable frame"); if (scrollableFrame) {
// Now, account for scrollbars, if we have any. // Now, account for scrollbars, if we have any.
PRBool verticalVisible; PRBool verticalVisible;
PRBool horizontalVisible; PRBool horizontalVisible;
@ -2951,6 +2950,7 @@ nsCSSRendering::PaintBackgroundWithSC(nsIPresContext* aPresContext,
viewportArea.height -= horizontalHeight; viewportArea.height -= horizontalHeight;
} }
} }
}
// Get the anchor point // Get the anchor point
ComputeBackgroundAnchorPoint(aColor, viewportArea, viewportArea, tileWidth, tileHeight, anchor); ComputeBackgroundAnchorPoint(aColor, viewportArea, viewportArea, tileWidth, tileHeight, anchor);

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

@ -2929,8 +2929,7 @@ nsCSSRendering::PaintBackgroundWithSC(nsIPresContext* aPresContext,
scrollableFrame = GetRootScrollableFrame(aPresContext, rootFrame); scrollableFrame = GetRootScrollableFrame(aPresContext, rootFrame);
} }
NS_ASSERTION(scrollableFrame, "no scrollable frame"); if (scrollableFrame) {
// Now, account for scrollbars, if we have any. // Now, account for scrollbars, if we have any.
PRBool verticalVisible; PRBool verticalVisible;
PRBool horizontalVisible; PRBool horizontalVisible;
@ -2951,6 +2950,7 @@ nsCSSRendering::PaintBackgroundWithSC(nsIPresContext* aPresContext,
viewportArea.height -= horizontalHeight; viewportArea.height -= horizontalHeight;
} }
} }
}
// Get the anchor point // Get the anchor point
ComputeBackgroundAnchorPoint(aColor, viewportArea, viewportArea, tileWidth, tileHeight, anchor); ComputeBackgroundAnchorPoint(aColor, viewportArea, viewportArea, tileWidth, tileHeight, anchor);