Closed Bug 1745828 Opened 2 years ago Closed 2 years ago

Refactor ScrollFrameHelper::LayoutScrollbars

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

(4 files)

This is the last refactor preparation before implementing scrollbar-gutter. The goal of this bug is:

  1. Adjust the logic in ScrollFrameHelper::LayoutScrollbars() so that no behavior is changed of the current m-c.
  2. After adding scrollbar-gutter, ScrollFrameHelper::LayoutScrollbars() just works, and no need to do addition change to it.

Compute the actual vertical & horizontal scrollbars' rects (vRect & hRect) only
when we decide to show the scrollbars. The rationale is that after introducing
scrollbar-gutter in bug 1715112, mScrollPort is no longer equal to
aInsideBorderArea even if we don't show scrollbars, and we want scrollbar
rects remaining empty to avoid showing them.

Simplify hasVisualOnlyScrollbarsOnBothDirections and move it closer to its
first usage.

Revise vRect & hRect computation because the scrollbar gutter can be at both
inline start and inline end sides. For example, we can no longer use
aInsideBorderArea.width - mScrollPort.width to get the actual width of the
vertical scrollbar. We want to compute them in different ways.

Depends on D133691

HasResizer() is equivalent to mResizerBox and is used only within
ScrollFrameHelper, so no need to expose it. Also, remove some unreachable
if-branches.

Depends on D133692

This patch makes mResizerBox's rect computation independent of mScrollCornerBox
because we can show resizer without showing scroll corner (due to no scrollbar).

Depends on D133693

Pushed by aethanyc@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/cee242d9dbb3
Part 1 - Compute scrollbar rects only if they are shown. r=emilio
https://hg.mozilla.org/integration/autoland/rev/b6e73faa67cc
Part 2 - Revise computation of scrollbars' rects. r=emilio
https://hg.mozilla.org/integration/autoland/rev/23ec642d3879
Part 3 - Remove ScrollFrameHelper::HasResizer(). r=emilio
https://hg.mozilla.org/integration/autoland/rev/c812809957b9
Part 4 - Revise the computation of mScrollCornerBox and mResizerBox's rects. r=emilio
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: