Bug 539331 - browser_sanitizeDialog.js is failing [r=mats]

This commit is contained in:
Robert O'Callahan 2010-01-13 04:57:00 -08:00
Родитель 972936ad25
Коммит 4005fac4c5
1 изменённых файлов: 20 добавлений и 18 удалений

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

@ -284,12 +284,10 @@ GetScrollbarMetrics(nsBoxLayoutState& aState, nsIBox* aBox, nsSize* aMin,
if (aMin) {
*aMin = aBox->GetMinSize(aState);
nsBox::AddMargin(aBox, *aMin);
}
if (aPref) {
*aPref = aBox->GetPrefSize(aState);
nsBox::AddMargin(aBox, *aPref);
}
}
@ -921,7 +919,6 @@ nsMargin nsGfxScrollFrameInner::GetDesiredScrollbarSizes(nsBoxLayoutState* aStat
if (mVScrollbarBox) {
nsSize size = mVScrollbarBox->GetPrefSize(*aState);
nsBox::AddMargin(mVScrollbarBox, size);
if (IsScrollbarOnRight())
result.left = size.width;
else
@ -930,7 +927,6 @@ nsMargin nsGfxScrollFrameInner::GetDesiredScrollbarSizes(nsBoxLayoutState* aStat
if (mHScrollbarBox) {
nsSize size = mHScrollbarBox->GetPrefSize(*aState);
nsBox::AddMargin(mHScrollbarBox, size);
// We don't currently support any scripts that would require a scrollbar
// at the top. (Are there any?)
result.bottom = size.height;
@ -1064,14 +1060,12 @@ nsXULScrollFrame::GetPrefSize(nsBoxLayoutState& aState)
if (mInner.mVScrollbarBox &&
styles.mVertical == NS_STYLE_OVERFLOW_SCROLL) {
nsSize vSize = mInner.mVScrollbarBox->GetPrefSize(aState);
nsBox::AddMargin(mInner.mVScrollbarBox, vSize);
pref.width += vSize.width;
}
if (mInner.mHScrollbarBox &&
styles.mHorizontal == NS_STYLE_OVERFLOW_SCROLL) {
nsSize hSize = mInner.mHScrollbarBox->GetPrefSize(aState);
nsBox::AddMargin(mInner.mHScrollbarBox, hSize);
pref.height += hSize.height;
}
@ -1094,7 +1088,6 @@ nsXULScrollFrame::GetMinSize(nsBoxLayoutState& aState)
if (mInner.mVScrollbarBox &&
styles.mVertical == NS_STYLE_OVERFLOW_SCROLL) {
nsSize vSize = mInner.mVScrollbarBox->GetMinSize(aState);
AddMargin(mInner.mVScrollbarBox, vSize);
min.width += vSize.width;
if (min.height < vSize.height)
min.height = vSize.height;
@ -1103,7 +1096,6 @@ nsXULScrollFrame::GetMinSize(nsBoxLayoutState& aState)
if (mInner.mHScrollbarBox &&
styles.mHorizontal == NS_STYLE_OVERFLOW_SCROLL) {
nsSize hSize = mInner.mHScrollbarBox->GetMinSize(aState);
AddMargin(mInner.mHScrollbarBox, hSize);
min.height += hSize.height;
if (min.width < hSize.width)
min.width = hSize.width;
@ -2415,7 +2407,6 @@ nsXULScrollFrame::AddRemoveScrollbar(nsBoxLayoutState& aState,
return PR_FALSE;
nsSize hSize = mInner.mHScrollbarBox->GetPrefSize(aState);
nsBox::AddMargin(mInner.mHScrollbarBox, hSize);
mInner.SetScrollbarVisibility(mInner.mHScrollbarBox, aAdd);
@ -2434,7 +2425,6 @@ nsXULScrollFrame::AddRemoveScrollbar(nsBoxLayoutState& aState,
return PR_FALSE;
nsSize vSize = mInner.mVScrollbarBox->GetPrefSize(aState);
nsBox::AddMargin(mInner.mVScrollbarBox, vSize);
mInner.SetScrollbarVisibility(mInner.mVScrollbarBox, aAdd);
@ -2955,9 +2945,11 @@ nsGfxScrollFrameInner::LayoutScrollbars(nsBoxLayoutState& aState,
nsRect vRect(mScrollPort);
vRect.width = aContentArea.width - mScrollPort.width;
vRect.x = IsScrollbarOnRight() ? mScrollPort.XMost() : aContentArea.x;
#ifdef DEBUG
nsMargin margin;
mVScrollbarBox->GetMargin(margin);
vRect.Deflate(margin);
NS_ASSERTION(margin == nsMargin(0,0,0,0), "Scrollbar margin not supported");
#endif
AdjustScrollbarRect(mOuter, presContext, vRect, PR_TRUE);
LayoutAndInvalidate(aState, mVScrollbarBox, vRect);
}
@ -2967,9 +2959,11 @@ nsGfxScrollFrameInner::LayoutScrollbars(nsBoxLayoutState& aState,
nsRect hRect(mScrollPort);
hRect.height = aContentArea.height - mScrollPort.height;
hRect.y = PR_TRUE ? mScrollPort.YMost() : aContentArea.y;
#ifdef DEBUG
nsMargin margin;
mHScrollbarBox->GetMargin(margin);
hRect.Deflate(margin);
NS_ASSERTION(margin == nsMargin(0,0,0,0), "Scrollbar margin not supported");
#endif
AdjustScrollbarRect(mOuter, presContext, hRect, PR_FALSE);
LayoutAndInvalidate(aState, mHScrollbarBox, hRect);
}
@ -3093,12 +3087,20 @@ nsGfxScrollFrameInner::GetScrolledRectInternal(const nsRect& aScrolledFrameOverf
}
nsMargin
nsGfxScrollFrameInner::GetActualScrollbarSizes() const {
nsRect r = mOuter->GetPaddingRect() - mOuter->GetPosition();
return nsMargin(mScrollPort.x - r.x, mScrollPort.y - r.y,
r.XMost() - mScrollPort.XMost(),
r.YMost() - mScrollPort.YMost());
nsGfxScrollFrameInner::GetActualScrollbarSizes() const
{
nsMargin result(0, 0, 0, 0);
if (mVScrollbarBox) {
if (IsScrollbarOnRight()) {
result.right = mVScrollbarBox->GetRect().width;
} else {
result.left = mVScrollbarBox->GetRect().width;
}
}
if (mHScrollbarBox) {
result.bottom = mHScrollbarBox->GetRect().height;
}
return result;
}
void