Closed Bug 2059794 Opened 4 months ago Closed 3 months ago

Use native scrolling in vertical arrowscrollboxes

Categories

(Toolkit :: UI Widgets, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
155 Branch
Tracking Status
firefox155 --- fixed

People

(Reporter: dao, Assigned: dao)

References

(Blocks 1 open bug, Regressed 1 open bug)

Details

Attachments

(1 external file)

arrowscrollbox already delegates the actual scrolling to the platform (scrollBy, scrollIntoView, scroll-behavior), but it calls preventDefault() on every wheel and touchmove event and drives the scroll offset from script. So the tab strip and menus get neither APZ momentum nor the OS wheel settings, and there are two sources of truth for the scroll offset.

Hand vertical mode over to the browser: give the inner <scrollbox> a real overflow while it is [overflowing] so it becomes a scroll container, and stop consuming wheel and touch events there.

Note that a wheel notch then scrolls the OS line count times the font line height rather than a whole tab row, and the platform caps a single wheel event at one page.

Horizontal mode is not covered here, since it needs platform work first: the per-element mousewheel autodir opt-in from bug 1749825 only takes effect on the APZ path, and APZ does not autodir pan gestures at all.

This is the vertical half of bug 1970536.

The widget already delegates the actual scrolling to the platform (scrollBy,
scrollIntoView, scroll-behavior), but it intercepts every wheel and touchmove
event and drives the offset from script, so the tab strip and menus get neither
APZ momentum nor the OS wheel settings.

Vertical mode is the part we can hand over today: give the scrollbox a real
overflow so it becomes a scroll container, and stop consuming input there.
Horizontal mode still needs platform work -- the mousewheel autodir opt-in only
takes effect on the APZ path, and APZ doesn't autodir pan gestures at all -- so
it keeps scrolling from script.

Worth checking:

  • The scrollbox only becomes a scroll container while [overflowing]. That keeps
    the widget's "don't consume the event if we can't scroll" semantics, and keeps
    every menu that fits on screen from getting an APZ scroll frame.

  • overscroll-behavior stops a menu or the tab strip from chaining its overscroll
    to an ancestor.

  • A wheel notch now scrolls the OS line count times the font line height, not a
    whole tab row, and the platform caps one event at one page. That is the point
    of the bug, but it does make wheel scrolling finer; the two tests that asserted
    the old script-computed distances are updated accordingly. Item-boundary
    alignment survives on the paths that are still script-driven: the scroll arrows
    and keyboard paging.

  • switchByScrolling relied on the widget consuming the wheel event. Preventing
    the legacy scroll event's default action propagates back to the wheel event it
    came from, which is what keeps the tabs from scrolling as well as switching.

Assignee: nobody → dao+bmo
Status: NEW → ASSIGNED
See Also: → 2059800
Pushed by dgottwald@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/ed3204e22fce https://hg.mozilla.org/integration/autoland/rev/ddc26dcdaa5c Use native scrolling in vertical arrowscrollboxes. r=tabbrowser-reviewers,hiro,kcochrane
Regressions: 2060706
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 155 Branch
Regressions: 2062682
QA Whiteboard: [qa-triage-done-c156/b155]
Regressions: 2067366
Regressions: 2069604
Regressions: 2070990
Blocks: 1977184
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: