Closed Bug 1743959 Opened 8 months ago Closed 8 months 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 ports the mScrollPort refactor Boris wrote in
https://phabricator.services.mozilla.com/D129100 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 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
Status: NEW → RESOLVED
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.