Closed Bug 1743959 Opened 2 years ago Closed 2 years ago

Refactor around mScrollPort and TryLayout in scroll frame implementation

Categories

(Core :: Layout: Scrolling and Overflow, task)

task

Tracking

()

RESOLVED FIXED
97 Branch
Tracking Status
firefox97 --- fixed

People

(Reporter: TYLin, Assigned: TYLin)

References

Details

Attachments

(3 files)

These patches are written when I investigate the scrollbar implementation for bug 1715112. All the patches are refactors, and shouldn't change the behavior.

This patch is inspired by ScrollFrameHelper::GetActualScrollbarSizes() that
uses a nsMargin to represent the space occupied by scrollbar.

In bug 1715112, TryLayout is going to consider the space occupied by the
scrollbar gutter. Hence the variable name with gutter in it just to avoid change
the variable name again.

Depends on D132662

The static AddRemoveScrollbar() helper is meant to adjust the scroll port and
test whether the scrollbar fits, but its interface is obscure. By expanding the
helper in-place, the code should now become easy to follow, and we can also
remove the wordaround that sets the bool:1 bitfield.

Pushed by tlin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f651c6b3310d
Part 0 - Remove static nsXULScrollFrame::AddRemoveScrollbar helper. r=hiro
https://hg.mozilla.org/integration/autoland/rev/9cd0be79e424
Part 1 - Make mScrollPort private, and add a getter and a setter for it. r=emilio
https://hg.mozilla.org/integration/autoland/rev/6ec8558fc869
Part 2 - Simplify the computation regarding the space occupied by scrollbars in TryLayout. r=hiro
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: