Bug 1656802. Add a comment explaining how overlay scrollbars work with their negative margin. r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D85703
This commit is contained in:
Timothy Nikkel 2020-08-08 07:07:57 +00:00
Родитель 0a37053b5b
Коммит a7100c9def
1 изменённых файлов: 8 добавлений и 0 удалений

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

@ -6593,6 +6593,10 @@ void ScrollFrameHelper::LayoutScrollbars(nsBoxLayoutState& aState,
: mScrollPort.x + compositionSize.width;
if (mHasVerticalScrollbar) {
nsMargin margin;
// For overlay scrollbars the margin returned from this GetXULMargin call
// is a negative margin that moves the scrollbar from just outside the
// scrollport (and hence not visible) to just inside the scrollport (and
// hence visible). For non-overlay scrollbars it is a 0 margin.
mVScrollbarBox->GetXULMargin(margin);
vRect.Deflate(margin);
}
@ -6611,6 +6615,10 @@ void ScrollFrameHelper::LayoutScrollbars(nsBoxLayoutState& aState,
hRect.y = mScrollPort.y + compositionSize.height;
if (mHasHorizontalScrollbar) {
nsMargin margin;
// For overlay scrollbars the margin returned from this GetXULMargin call
// is a negative margin that moves the scrollbar from just outside the
// scrollport (and hence not visible) to just inside the scrollport (and
// hence visible). For non-overlay scrollbars it is a 0 margin.
mHScrollbarBox->GetXULMargin(margin);
hRect.Deflate(margin);
}