Closed Bug 1955947 Opened 7 months ago Closed 1 month ago

Implement #restore-scroll-position-data

Categories

(Core :: DOM: Navigation, task)

task

Tracking

()

RESOLVED FIXED
145 Branch
Tracking Status
firefox145 --- fixed

People

(Reporter: farre, Assigned: keithamus)

References

(Blocks 2 open bugs)

Details

Attachments

(2 files)

Blocks: 1890755
Assignee: nobody → jjaschke

This change replaces the Document::HasBeenScrolled method, introducing
Document::HasBeenScrolledByUser. This method delegates to
ScrollContainerFrame::HasBeenScrolledByUser which is a new boolean in
ScrollContainerFrame that marks when scrolls occur outside of a JS Stack
Frame.

This change is required because Navigations that cause scrolling should
(such as prior .scroll() calls, or navigating to an anchor and
navigating back) should properly restore scroll position, which won't
occur if we simply track whether or not a frame has been scrolled (since
those APIs can scroll).

This implements the basics of RestoreScrollPositionData as per spec;
introducing the new method nsDocShell::RestoreScrollPosFromActiveSHE
which will set the scroll position to the position stored by the active
session history entry.

It does not pass all scroll-behavior tests, as some rely on an unspecced
behaviour whereby the scroll restoration is deferred until the active
navigation interception promise has settled. We can resolve this in
another bug because this behaviour is not detailed in the spec.

Assignee: jjaschke → mozilla
Attachment #9516565 - Attachment description: Bug 1955947 - Part 1: Implement Document::HasBeenScrolledByUser, replacing Document::HasBeenScrolled r?#dom-core,farre → Bug 1955947 - Part 1: Implement Document::HasBeenScrolledSince, replacing Document::HasBeenScrolled r?#dom-core,farre

Keith, would you mind filing a follow-up bug to implement HasBeenScrolledByUser? Whether we need it for shipping navigation-api or need it for enabling navigation-api on nightly, we will have to implement it, right?

Flags: needinfo?(mozilla)
Blocks: 1992713

Yes I still contend it might be the wrong thing to implement (see https://github.com/whatwg/html/issues/11732 for more), but bug 1992713 can follow this.

No longer blocks: 1992713
Flags: needinfo?(mozilla)
Blocks: 1992713

Thanks! I didn't realize that you've already filed the spec issue.

QA Whiteboard: [qa-triage-done-c146/b145]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: