зеркало из https://github.com/mozilla/pjs.git
Backing out fix for bug 539331 due to test failures
This commit is contained in:
Коммит
2c8874b089
|
@ -284,10 +284,12 @@ GetScrollbarMetrics(nsBoxLayoutState& aState, nsIBox* aBox, nsSize* aMin,
|
||||||
|
|
||||||
if (aMin) {
|
if (aMin) {
|
||||||
*aMin = aBox->GetMinSize(aState);
|
*aMin = aBox->GetMinSize(aState);
|
||||||
|
nsBox::AddMargin(aBox, *aMin);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aPref) {
|
if (aPref) {
|
||||||
*aPref = aBox->GetPrefSize(aState);
|
*aPref = aBox->GetPrefSize(aState);
|
||||||
|
nsBox::AddMargin(aBox, *aPref);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -919,6 +921,7 @@ nsMargin nsGfxScrollFrameInner::GetDesiredScrollbarSizes(nsBoxLayoutState* aStat
|
||||||
|
|
||||||
if (mVScrollbarBox) {
|
if (mVScrollbarBox) {
|
||||||
nsSize size = mVScrollbarBox->GetPrefSize(*aState);
|
nsSize size = mVScrollbarBox->GetPrefSize(*aState);
|
||||||
|
nsBox::AddMargin(mVScrollbarBox, size);
|
||||||
if (IsScrollbarOnRight())
|
if (IsScrollbarOnRight())
|
||||||
result.left = size.width;
|
result.left = size.width;
|
||||||
else
|
else
|
||||||
|
@ -927,6 +930,7 @@ nsMargin nsGfxScrollFrameInner::GetDesiredScrollbarSizes(nsBoxLayoutState* aStat
|
||||||
|
|
||||||
if (mHScrollbarBox) {
|
if (mHScrollbarBox) {
|
||||||
nsSize size = mHScrollbarBox->GetPrefSize(*aState);
|
nsSize size = mHScrollbarBox->GetPrefSize(*aState);
|
||||||
|
nsBox::AddMargin(mHScrollbarBox, size);
|
||||||
// We don't currently support any scripts that would require a scrollbar
|
// We don't currently support any scripts that would require a scrollbar
|
||||||
// at the top. (Are there any?)
|
// at the top. (Are there any?)
|
||||||
result.bottom = size.height;
|
result.bottom = size.height;
|
||||||
|
@ -1060,12 +1064,14 @@ nsXULScrollFrame::GetPrefSize(nsBoxLayoutState& aState)
|
||||||
if (mInner.mVScrollbarBox &&
|
if (mInner.mVScrollbarBox &&
|
||||||
styles.mVertical == NS_STYLE_OVERFLOW_SCROLL) {
|
styles.mVertical == NS_STYLE_OVERFLOW_SCROLL) {
|
||||||
nsSize vSize = mInner.mVScrollbarBox->GetPrefSize(aState);
|
nsSize vSize = mInner.mVScrollbarBox->GetPrefSize(aState);
|
||||||
|
nsBox::AddMargin(mInner.mVScrollbarBox, vSize);
|
||||||
pref.width += vSize.width;
|
pref.width += vSize.width;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mInner.mHScrollbarBox &&
|
if (mInner.mHScrollbarBox &&
|
||||||
styles.mHorizontal == NS_STYLE_OVERFLOW_SCROLL) {
|
styles.mHorizontal == NS_STYLE_OVERFLOW_SCROLL) {
|
||||||
nsSize hSize = mInner.mHScrollbarBox->GetPrefSize(aState);
|
nsSize hSize = mInner.mHScrollbarBox->GetPrefSize(aState);
|
||||||
|
nsBox::AddMargin(mInner.mHScrollbarBox, hSize);
|
||||||
pref.height += hSize.height;
|
pref.height += hSize.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1088,6 +1094,7 @@ nsXULScrollFrame::GetMinSize(nsBoxLayoutState& aState)
|
||||||
if (mInner.mVScrollbarBox &&
|
if (mInner.mVScrollbarBox &&
|
||||||
styles.mVertical == NS_STYLE_OVERFLOW_SCROLL) {
|
styles.mVertical == NS_STYLE_OVERFLOW_SCROLL) {
|
||||||
nsSize vSize = mInner.mVScrollbarBox->GetMinSize(aState);
|
nsSize vSize = mInner.mVScrollbarBox->GetMinSize(aState);
|
||||||
|
AddMargin(mInner.mVScrollbarBox, vSize);
|
||||||
min.width += vSize.width;
|
min.width += vSize.width;
|
||||||
if (min.height < vSize.height)
|
if (min.height < vSize.height)
|
||||||
min.height = vSize.height;
|
min.height = vSize.height;
|
||||||
|
@ -1096,6 +1103,7 @@ nsXULScrollFrame::GetMinSize(nsBoxLayoutState& aState)
|
||||||
if (mInner.mHScrollbarBox &&
|
if (mInner.mHScrollbarBox &&
|
||||||
styles.mHorizontal == NS_STYLE_OVERFLOW_SCROLL) {
|
styles.mHorizontal == NS_STYLE_OVERFLOW_SCROLL) {
|
||||||
nsSize hSize = mInner.mHScrollbarBox->GetMinSize(aState);
|
nsSize hSize = mInner.mHScrollbarBox->GetMinSize(aState);
|
||||||
|
AddMargin(mInner.mHScrollbarBox, hSize);
|
||||||
min.height += hSize.height;
|
min.height += hSize.height;
|
||||||
if (min.width < hSize.width)
|
if (min.width < hSize.width)
|
||||||
min.width = hSize.width;
|
min.width = hSize.width;
|
||||||
|
@ -2407,6 +2415,7 @@ nsXULScrollFrame::AddRemoveScrollbar(nsBoxLayoutState& aState,
|
||||||
return PR_FALSE;
|
return PR_FALSE;
|
||||||
|
|
||||||
nsSize hSize = mInner.mHScrollbarBox->GetPrefSize(aState);
|
nsSize hSize = mInner.mHScrollbarBox->GetPrefSize(aState);
|
||||||
|
nsBox::AddMargin(mInner.mHScrollbarBox, hSize);
|
||||||
|
|
||||||
mInner.SetScrollbarVisibility(mInner.mHScrollbarBox, aAdd);
|
mInner.SetScrollbarVisibility(mInner.mHScrollbarBox, aAdd);
|
||||||
|
|
||||||
|
@ -2425,6 +2434,7 @@ nsXULScrollFrame::AddRemoveScrollbar(nsBoxLayoutState& aState,
|
||||||
return PR_FALSE;
|
return PR_FALSE;
|
||||||
|
|
||||||
nsSize vSize = mInner.mVScrollbarBox->GetPrefSize(aState);
|
nsSize vSize = mInner.mVScrollbarBox->GetPrefSize(aState);
|
||||||
|
nsBox::AddMargin(mInner.mVScrollbarBox, vSize);
|
||||||
|
|
||||||
mInner.SetScrollbarVisibility(mInner.mVScrollbarBox, aAdd);
|
mInner.SetScrollbarVisibility(mInner.mVScrollbarBox, aAdd);
|
||||||
|
|
||||||
|
@ -2945,11 +2955,9 @@ nsGfxScrollFrameInner::LayoutScrollbars(nsBoxLayoutState& aState,
|
||||||
nsRect vRect(mScrollPort);
|
nsRect vRect(mScrollPort);
|
||||||
vRect.width = aContentArea.width - mScrollPort.width;
|
vRect.width = aContentArea.width - mScrollPort.width;
|
||||||
vRect.x = IsScrollbarOnRight() ? mScrollPort.XMost() : aContentArea.x;
|
vRect.x = IsScrollbarOnRight() ? mScrollPort.XMost() : aContentArea.x;
|
||||||
#ifdef DEBUG
|
|
||||||
nsMargin margin;
|
nsMargin margin;
|
||||||
mVScrollbarBox->GetMargin(margin);
|
mVScrollbarBox->GetMargin(margin);
|
||||||
NS_ASSERTION(margin == nsMargin(0,0,0,0), "Scrollbar margin not supported");
|
vRect.Deflate(margin);
|
||||||
#endif
|
|
||||||
AdjustScrollbarRect(mOuter, presContext, vRect, PR_TRUE);
|
AdjustScrollbarRect(mOuter, presContext, vRect, PR_TRUE);
|
||||||
LayoutAndInvalidate(aState, mVScrollbarBox, vRect);
|
LayoutAndInvalidate(aState, mVScrollbarBox, vRect);
|
||||||
}
|
}
|
||||||
|
@ -2959,11 +2967,9 @@ nsGfxScrollFrameInner::LayoutScrollbars(nsBoxLayoutState& aState,
|
||||||
nsRect hRect(mScrollPort);
|
nsRect hRect(mScrollPort);
|
||||||
hRect.height = aContentArea.height - mScrollPort.height;
|
hRect.height = aContentArea.height - mScrollPort.height;
|
||||||
hRect.y = PR_TRUE ? mScrollPort.YMost() : aContentArea.y;
|
hRect.y = PR_TRUE ? mScrollPort.YMost() : aContentArea.y;
|
||||||
#ifdef DEBUG
|
|
||||||
nsMargin margin;
|
nsMargin margin;
|
||||||
mHScrollbarBox->GetMargin(margin);
|
mHScrollbarBox->GetMargin(margin);
|
||||||
NS_ASSERTION(margin == nsMargin(0,0,0,0), "Scrollbar margin not supported");
|
hRect.Deflate(margin);
|
||||||
#endif
|
|
||||||
AdjustScrollbarRect(mOuter, presContext, hRect, PR_FALSE);
|
AdjustScrollbarRect(mOuter, presContext, hRect, PR_FALSE);
|
||||||
LayoutAndInvalidate(aState, mHScrollbarBox, hRect);
|
LayoutAndInvalidate(aState, mHScrollbarBox, hRect);
|
||||||
}
|
}
|
||||||
|
@ -3087,20 +3093,12 @@ nsGfxScrollFrameInner::GetScrolledRectInternal(const nsRect& aScrolledFrameOverf
|
||||||
}
|
}
|
||||||
|
|
||||||
nsMargin
|
nsMargin
|
||||||
nsGfxScrollFrameInner::GetActualScrollbarSizes() const
|
nsGfxScrollFrameInner::GetActualScrollbarSizes() const {
|
||||||
{
|
nsRect r = mOuter->GetPaddingRect() - mOuter->GetPosition();
|
||||||
nsMargin result(0, 0, 0, 0);
|
|
||||||
if (mVScrollbarBox) {
|
return nsMargin(mScrollPort.x - r.x, mScrollPort.y - r.y,
|
||||||
if (IsScrollbarOnRight()) {
|
r.XMost() - mScrollPort.XMost(),
|
||||||
result.right = mVScrollbarBox->GetRect().width;
|
r.YMost() - mScrollPort.YMost());
|
||||||
} else {
|
|
||||||
result.left = mVScrollbarBox->GetRect().width;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (mHScrollbarBox) {
|
|
||||||
result.bottom = mHScrollbarBox->GetRect().height;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Загрузка…
Ссылка в новой задаче