зеркало из https://github.com/mozilla/pjs.git
Bug 186752 - Crash during background painting when there is no scrollable frame. Add a null check.
r+sr=dbaron
This commit is contained in:
Родитель
c1dffb47a1
Коммит
27c6aebd18
|
@ -2929,26 +2929,26 @@ nsCSSRendering::PaintBackgroundWithSC(nsIPresContext* aPresContext,
|
|||
scrollableFrame = GetRootScrollableFrame(aPresContext, rootFrame);
|
||||
}
|
||||
|
||||
NS_ASSERTION(scrollableFrame, "no scrollable frame");
|
||||
if (scrollableFrame) {
|
||||
// Now, account for scrollbars, if we have any.
|
||||
PRBool verticalVisible;
|
||||
PRBool horizontalVisible;
|
||||
scrollableFrame->GetScrollbarVisibility(aPresContext, &verticalVisible,
|
||||
&horizontalVisible);
|
||||
|
||||
// Now, account for scrollbars, if we have any.
|
||||
PRBool verticalVisible;
|
||||
PRBool horizontalVisible;
|
||||
scrollableFrame->GetScrollbarVisibility(aPresContext, &verticalVisible,
|
||||
&horizontalVisible);
|
||||
|
||||
if (verticalVisible || horizontalVisible) {
|
||||
nscoord verticalWidth;
|
||||
nscoord horizontalHeight;
|
||||
scrollableFrame->GetScrollbarSizes(aPresContext, &verticalWidth,
|
||||
&horizontalHeight);
|
||||
if (verticalVisible) {
|
||||
// Assumes vertical scrollbars are on the right.
|
||||
viewportArea.width -= verticalWidth;
|
||||
}
|
||||
if (horizontalVisible) {
|
||||
// Assumes horizontal scrollbars are on the bottom.
|
||||
viewportArea.height -= horizontalHeight;
|
||||
if (verticalVisible || horizontalVisible) {
|
||||
nscoord verticalWidth;
|
||||
nscoord horizontalHeight;
|
||||
scrollableFrame->GetScrollbarSizes(aPresContext, &verticalWidth,
|
||||
&horizontalHeight);
|
||||
if (verticalVisible) {
|
||||
// Assumes vertical scrollbars are on the right.
|
||||
viewportArea.width -= verticalWidth;
|
||||
}
|
||||
if (horizontalVisible) {
|
||||
// Assumes horizontal scrollbars are on the bottom.
|
||||
viewportArea.height -= horizontalHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2929,26 +2929,26 @@ nsCSSRendering::PaintBackgroundWithSC(nsIPresContext* aPresContext,
|
|||
scrollableFrame = GetRootScrollableFrame(aPresContext, rootFrame);
|
||||
}
|
||||
|
||||
NS_ASSERTION(scrollableFrame, "no scrollable frame");
|
||||
if (scrollableFrame) {
|
||||
// Now, account for scrollbars, if we have any.
|
||||
PRBool verticalVisible;
|
||||
PRBool horizontalVisible;
|
||||
scrollableFrame->GetScrollbarVisibility(aPresContext, &verticalVisible,
|
||||
&horizontalVisible);
|
||||
|
||||
// Now, account for scrollbars, if we have any.
|
||||
PRBool verticalVisible;
|
||||
PRBool horizontalVisible;
|
||||
scrollableFrame->GetScrollbarVisibility(aPresContext, &verticalVisible,
|
||||
&horizontalVisible);
|
||||
|
||||
if (verticalVisible || horizontalVisible) {
|
||||
nscoord verticalWidth;
|
||||
nscoord horizontalHeight;
|
||||
scrollableFrame->GetScrollbarSizes(aPresContext, &verticalWidth,
|
||||
&horizontalHeight);
|
||||
if (verticalVisible) {
|
||||
// Assumes vertical scrollbars are on the right.
|
||||
viewportArea.width -= verticalWidth;
|
||||
}
|
||||
if (horizontalVisible) {
|
||||
// Assumes horizontal scrollbars are on the bottom.
|
||||
viewportArea.height -= horizontalHeight;
|
||||
if (verticalVisible || horizontalVisible) {
|
||||
nscoord verticalWidth;
|
||||
nscoord horizontalHeight;
|
||||
scrollableFrame->GetScrollbarSizes(aPresContext, &verticalWidth,
|
||||
&horizontalHeight);
|
||||
if (verticalVisible) {
|
||||
// Assumes vertical scrollbars are on the right.
|
||||
viewportArea.width -= verticalWidth;
|
||||
}
|
||||
if (horizontalVisible) {
|
||||
// Assumes horizontal scrollbars are on the bottom.
|
||||
viewportArea.height -= horizontalHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче