Closed Bug 1452825 Opened 2 years ago Closed 2 years ago

[scroll-behavior] not honored on history traversal

Categories

(Core :: DOM: Navigation, defect)

61 Branch
defect
Not set

Tracking

()

VERIFIED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

(Reporter: hi, Assigned: smaug)

Details

Attachments

(4 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:61.0) Gecko/20100101 Firefox/61.0
Build ID: 20180404100127

Steps to reproduce:

"History Component" isn't available in the list, so "Document Navigation" is where I filed, though "Panning and Zooming" might be applicable as well.

1. Open test case
2. Click both the "top" and "bottom" links a few times noticing how the document smoothly scrolls between the top and bottom anchors.
3. Use the back and forward buttons in the browsers UI, notice how there is no smooth behavior.


Actual results:

No smooth scrolling when either using the browsers forward/back buttons OR programmatically interacting with the history interface, thought 'scroll-behavior: smooth' is set.


Expected results:

https://github.com/w3c/csswg-drafts/issues/2454

According to the spec and authors, all types of navigation, including history traversal should adhere to the value of the scroll-behavior property.
Attached patch wipSplinter Review
Need to write some test
Assignee: nobody → bugs
commit message would be,
"Bug 1452825, use smooth scrolling also for history navigations, r=bz"

The test is a tad ugly, but wpt wasn't playing too nicely with me so went with rather safe-and-dirty way. smoothHistoryNavigationTest fails without the patch.

remote: View your change here:
remote:   https://hg.mozilla.org/try/rev/918bc0971d39adfdf8f69282cf0b3cf263c1831f
remote: 
remote: Follow the progress of your build on Treeherder:
remote:   https://treeherder.mozilla.org/#/jobs?repo=try&revision=918bc0971d39adfdf8f69282cf0b3cf263c1831f
remote: recorded changegroup in replication log in 0.070s
Attachment #8966583 - Flags: review?(bzbarsky)
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Comment on attachment 8966583 [details] [diff] [review]
history_scroll_with_test.diff

ScrollTo() ends up checking ScrollBehaviorEnabled() already, so you shouldn't need to test it here, I would think...

We're going to need to rejigger this code some more when we fix bug 1442958, but that's ok.
Attachment #8966583 - Flags: review?(bzbarsky) → review+
I was just following the setup done elsewhere.
But I see we're inconsistent. I can drop the check.
Pushed by opettay@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/8bbe699e731a
use smooth scrolling also for history navigations, r=bz
Created web-platform-tests PR https://github.com/w3c/web-platform-tests/pull/10472 for changes under testing/web-platform/tests
https://hg.mozilla.org/mozilla-central/rev/8bbe699e731a
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Upstream PR merged
This works beatutifully in Firefox Nightly 63.0a1 (2018-08-06)! Thanks!
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.