Closed Bug 1746098 Opened 3 years ago Closed 3 years ago

Reduce the number of reflow for scrolled frame if scrollbar-gutter is not auto

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
97 Branch
Tracking Status
firefox97 --- fixed

People

(Reporter: TYLin, Assigned: TYLin)

References

Details

Attachments

(1 file)

Bug 1715112 focused on the correctness of scrollbar-gutter layout. This bug is a follow-up to think about the opportunity to reduce the number of calls of ReflowScrolledFrame().

Assume the scroll frame has the following style:

writing-mode: horizontal-tb;
direction: ltr;
overflow: auto;
scrollbar-gutter: stable

Then it has a vertical scrollbar gutter occupied the space at inline-end during the first reflow of the inner scrolled frame. So even if the inner scrolled frame overflows the scrollport's height and requires showing the vertical scrollbar, it doesn't an require extra reflow due to the change of the vertical scrollbar visibility.

We now support scrollbar-gutter property. So for example, assume the scroll
container has "scrollbar-gutter:stable". When toggling the visibility of
inline-end scrollbar, we can skip the reflow for the scroll inner frame because
the available inline-size for it cannot change.

This patch teaches TryLayout() to consider the sizes of scrollbar gutter rather
than the (assumed) visibility of scrollbars when deciding the need to call
ReflowScrolledFrame().

Also, TryLayout() doesn't need to report an inconsistent layout unless
the (showHScrollbar, showVScrollbar) pair changes the sizes of scrollbar
gutters.

Assignee: nobody → aethanyc
Status: NEW → ASSIGNED
Pushed by aethanyc@gmail.com: https://hg.mozilla.org/integration/autoland/rev/71b638648721 Reflow scrolled inner frame in TryLayout() only when sizes of scrollbar gutter change. r=emilio
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 97 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: