[scroll-behavior] not honored on history traversal
Categories
(Core :: DOM: Navigation, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox61 | --- | fixed |
People
(Reporter: hi, Assigned: smaug)
Details
Attachments
(4 files)
|
10.34 KB,
text/html
|
Details | |
|
1.60 KB,
patch
|
Details | Diff | Splinter Review | |
|
5.18 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
|
4.62 KB,
patch
|
Details | Diff | Splinter Review |
| Assignee | ||
Comment 2•7 years ago
|
||
| Assignee | ||
Updated•7 years ago
|
Comment 3•7 years ago
|
||
| Assignee | ||
Comment 4•7 years ago
|
||
| Assignee | ||
Comment 5•7 years ago
|
||
| Assignee | ||
Comment 6•7 years ago
|
||
Comment 10•7 years ago
|
||
| bugherder | ||
| Reporter | ||
Comment 12•7 years ago
|
||
| Reporter | ||
Comment 13•5 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #1)
Actually I think I spoke too soon. :(
Though this issue is *mostly fixed, it seems to be fixed in a way that doesn't behave uniformly when new programmatic scrolling interactions overlap previous interactions?
Firefox Nightly 83.0a1 (2020-10-10) Mac 10.12.6
These two scenarios produce unspecified results in the original test case:
- Clicking an anchor link, then before the smooth scrolling behavior of that first anchor action finishes, click a different anchor link. This will cease the previous programmatic scrolling to the first anchor and instead scroll to the destination of the second anchor link. So far I believe this is both expected by users and matches specification. After these actions, now try to click on the browsers back button. Instead of it going back to the location of the first anchor, it will scroll you back to the scroll position when the second anchor had been clicked, all the while changing the hash of the url to the correct value, yet still being in inaccurate scroll position.
- Click both anchors back and forth a dozen times with enough time to scroll between both destinations. Then click on the browsers back and forward buttons quickly and repeatedly, you will eventually find that the page will stop at scroll positions not related either of the two anchors. Meaning scroll positions are being decided that do not at all match either of the hashes added to the url.
As far as user expectation goes for history traversal, I believe that when the hash of the url changes, the scroll position of the page will *eventually scroll a user to the position on the page that targets the value of the hash. Though these are edge cases, they are not what a user would expect and maybe this exposes some faulty logic underneath your implementation?
| Reporter | ||
Comment 14•4 years ago
|
||
(In reply to Cosmin Sabou [:CosminS] from comment #10)
Since my last comment may not have been seen, I figured I'd try to simplify.
AFAIKT, the behavior shown by the following steps is not what is expected by the spec.
- Load the case -> https://bugzilla.mozilla.org/attachment.cgi?id=8966431
- Immediately click the "bottom" link that's in the upper right up the page, see smooth scrolling behavior scroll the page down to the bottom.
- Using your mouse or trackpad, scroll to an arbitrary position in the middle of the page.
- Click the "top" link that's in the upper right of the page, see smooth scrolling behavior scroll the page up to the top.
- Use the browsers "back button" to navigate back to the last hash (#bottom). But now see scrolling bring the user to the previously arbitrary position halfway down the page, even though the url has in fact changed to append the "#bottom".
This seems especially suspect, when the user can copy/paste the now current url into a new window and then see the window scrolled to a different view/target than would be expected from the previous experience using the history/back button to reach the same exact url.
| Assignee | ||
Comment 15•2 years ago
|
||
That is how I'd expect the behavior to be. Store scrolling position when doing another fragment navigation.
Description
•