Closed Bug 1743959 Opened 8 months ago Closed 8 months ago

Refactor around mScrollPort and TryLayout in scroll frame implementation


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




97 Branch
Tracking Status
firefox97 --- fixed


(Reporter: TYLin, Assigned: TYLin)




(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 ports the mScrollPort refactor Boris wrote in with my tweaks.

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
Part 0 - Remove static nsXULScrollFrame::AddRemoveScrollbar helper. r=hiro
Part 1 - Make mScrollPort private, and add a getter and a setter for it. r=emilio
Part 2 - Simplify the computation regarding the space occupied by scrollbars in TryLayout. r=hiro
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 97 Branch
You need to log in before you can comment on or make changes to this bug.