Implement #restore-scroll-position-data
Categories
(Core :: DOM: Navigation, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox145 | --- | fixed | 
People
(Reporter: farre, Assigned: keithamus)
References
(Blocks 2 open bugs)
Details
Attachments
(2 files)
Bug 1948249 implements #process-scroll-behavior, which uses #restore-scroll-position-data.
| Reporter | ||
          Updated•6 months ago
           
         | 
      
| Assignee | ||
          Comment 1•1 month ago
           
         | 
      ||
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).
| Assignee | ||
          Comment 2•1 month ago
           
         | 
      ||
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 | ||
          Updated•1 month ago
           
         | 
      
          Updated•1 month ago
           
         | 
      
          Comment 4•1 month ago
           
         | 
      ||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/9d1929e60c1d
https://hg.mozilla.org/mozilla-central/rev/7cd71026e377
https://hg.mozilla.org/mozilla-central/rev/d8c4a956de06
          Comment 5•29 days ago
           
         | 
      ||
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?
| Assignee | ||
          Comment 6•29 days ago
           
         | 
      ||
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.
          Comment 7•28 days ago
           
         | 
      ||
Thanks! I didn't realize that you've already filed the spec issue.
          Updated•20 days ago
           
         | 
      
Description
•