Backed out changeset 51619d94e92d (bug 1809630) for causing reftest failures on percent-height-overflowing-image-1.html CLOSED TREE

This commit is contained in:
Cristian Tuns 2023-01-13 01:11:46 -05:00
Родитель 4dc70bafa2
Коммит 3d3df76b69
2 изменённых файлов: 7 добавлений и 38 удалений

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

@ -442,19 +442,6 @@ ScrollReflowInput::ScrollReflowInput(nsHTMLScrollFrame* aFrame,
GetScrollbarMetrics(mBoxState, hScrollbarBox, &mHScrollbarMinSize,
&mHScrollbarPrefSize);
// A zero minimum size is a bug with non-overlay scrollbars. That
// means we'll always try to place the scrollbar, even if it will ultimately
// not fit, see bug 1809630. XUL collapsing is the exception because the
// front-end uses it.
MOZ_ASSERT(aFrame->PresContext()->UseOverlayScrollbars() ||
hScrollbarBox->IsXULCollapsed() ||
(mHScrollbarMinSize.width && mHScrollbarMinSize.height),
"Shouldn't have a zero horizontal min-scrollbar-size");
MOZ_ASSERT(mHScrollbarPrefSize.width >= mHScrollbarMinSize.width &&
mHScrollbarPrefSize.height >= mHScrollbarMinSize.height,
"Scrollbar pref size should be >= min size");
} else {
mHScrollbar = ShowScrollbar::Never;
mHScrollbarAllowedForScrollingVVInsideLV = false;
@ -465,15 +452,6 @@ ScrollReflowInput::ScrollReflowInput(nsHTMLScrollFrame* aFrame,
GetScrollbarMetrics(mBoxState, vScrollbarBox, &mVScrollbarMinSize,
&mVScrollbarPrefSize);
// See above.
MOZ_ASSERT(aFrame->PresContext()->UseOverlayScrollbars() ||
vScrollbarBox->IsXULCollapsed() ||
(mVScrollbarMinSize.width && mVScrollbarMinSize.height),
"Shouldn't have a zero vertical min-size");
MOZ_ASSERT(mVScrollbarPrefSize.width >= mVScrollbarMinSize.width &&
mVScrollbarPrefSize.height >= mVScrollbarMinSize.height,
"Scrollbar pref size should be >= min size");
} else {
mVScrollbar = ShowScrollbar::Never;
mVScrollbarAllowedForScrollingVVInsideLV = false;

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

@ -33,6 +33,11 @@ LayoutDeviceIntSize ScrollbarDrawingWin::GetMinimumWidgetSize(
case StyleAppearance::ScrollbarHorizontal:
case StyleAppearance::ScrollbarthumbVertical:
case StyleAppearance::ScrollbarthumbHorizontal: {
if ((aAppearance == StyleAppearance::ScrollbarHorizontal ||
aAppearance == StyleAppearance::ScrollbarVertical) &&
!aPresContext->UseOverlayScrollbars()) {
return LayoutDeviceIntSize{};
}
// TODO: for short scrollbars it could be nice if the thumb could shrink
// under this size.
auto sizes = GetScrollbarSizes(aPresContext, aFrame);
@ -41,22 +46,8 @@ LayoutDeviceIntSize ScrollbarDrawingWin::GetMinimumWidgetSize(
aAppearance == StyleAppearance::ScrollbarthumbHorizontal ||
aAppearance == StyleAppearance::ScrollbarbuttonLeft ||
aAppearance == StyleAppearance::ScrollbarbuttonRight;
const auto relevantSize =
isHorizontal ? sizes.mHorizontal : sizes.mVertical;
auto size = LayoutDeviceIntSize{relevantSize, relevantSize};
if (aAppearance == StyleAppearance::ScrollbarHorizontal ||
aAppearance == StyleAppearance::ScrollbarVertical) {
// Always reserve some space in the right direction. Historically we've
// reserved 3 times the size in the other axis (one for the thumb, two
// for the buttons). We do this even when painting thin scrollbars just
// for consistency, though there just one would probably do.
if (isHorizontal) {
size.width *= 3;
} else {
size.height *= 3;
}
}
return size;
const auto size = isHorizontal ? sizes.mHorizontal : sizes.mVertical;
return LayoutDeviceIntSize{size, size};
}
default:
return LayoutDeviceIntSize{};