зеркало из 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) {
|
||||
*aMin = aBox->GetMinSize(aState);
|
||||
nsBox::AddMargin(aBox, *aMin);
|
||||
}
|
||||
|
||||
if (aPref) {
|
||||
*aPref = aBox->GetPrefSize(aState);
|
||||
nsBox::AddMargin(aBox, *aPref);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -919,6 +921,7 @@ nsMargin nsGfxScrollFrameInner::GetDesiredScrollbarSizes(nsBoxLayoutState* aStat
|
|||
|
||||
if (mVScrollbarBox) {
|
||||
nsSize size = mVScrollbarBox->GetPrefSize(*aState);
|
||||
nsBox::AddMargin(mVScrollbarBox, size);
|
||||
if (IsScrollbarOnRight())
|
||||
result.left = size.width;
|
||||
else
|
||||
|
@ -927,6 +930,7 @@ 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;
|
||||
|
@ -1060,12 +1064,14 @@ 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;
|
||||
}
|
||||
|
||||
|
@ -1088,6 +1094,7 @@ 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;
|
||||
|
@ -1096,6 +1103,7 @@ 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;
|
||||
|
@ -2407,6 +2415,7 @@ nsXULScrollFrame::AddRemoveScrollbar(nsBoxLayoutState& aState,
|
|||
return PR_FALSE;
|
||||
|
||||
nsSize hSize = mInner.mHScrollbarBox->GetPrefSize(aState);
|
||||
nsBox::AddMargin(mInner.mHScrollbarBox, hSize);
|
||||
|
||||
mInner.SetScrollbarVisibility(mInner.mHScrollbarBox, aAdd);
|
||||
|
||||
|
@ -2425,6 +2434,7 @@ nsXULScrollFrame::AddRemoveScrollbar(nsBoxLayoutState& aState,
|
|||
return PR_FALSE;
|
||||
|
||||
nsSize vSize = mInner.mVScrollbarBox->GetPrefSize(aState);
|
||||
nsBox::AddMargin(mInner.mVScrollbarBox, vSize);
|
||||
|
||||
mInner.SetScrollbarVisibility(mInner.mVScrollbarBox, aAdd);
|
||||
|
||||
|
@ -2945,11 +2955,9 @@ 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);
|
||||
NS_ASSERTION(margin == nsMargin(0,0,0,0), "Scrollbar margin not supported");
|
||||
#endif
|
||||
vRect.Deflate(margin);
|
||||
AdjustScrollbarRect(mOuter, presContext, vRect, PR_TRUE);
|
||||
LayoutAndInvalidate(aState, mVScrollbarBox, vRect);
|
||||
}
|
||||
|
@ -2959,11 +2967,9 @@ 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);
|
||||
NS_ASSERTION(margin == nsMargin(0,0,0,0), "Scrollbar margin not supported");
|
||||
#endif
|
||||
hRect.Deflate(margin);
|
||||
AdjustScrollbarRect(mOuter, presContext, hRect, PR_FALSE);
|
||||
LayoutAndInvalidate(aState, mHScrollbarBox, hRect);
|
||||
}
|
||||
|
@ -3087,20 +3093,12 @@ nsGfxScrollFrameInner::GetScrolledRectInternal(const nsRect& aScrolledFrameOverf
|
|||
}
|
||||
|
||||
nsMargin
|
||||
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;
|
||||
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());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Загрузка…
Ссылка в новой задаче