Last Comment Bug 1182012 - css `scroll-behavior: smooth` doesn't work when using back/forward button
: css `scroll-behavior: smooth` doesn't work when using back/forward button
Status: RESOLVED DUPLICATE of bug 391664
: reproducible, testcase
Product: Core
Classification: Components
Component: Untriaged (show other bugs)
: Trunk
: Unspecified Unspecified
-- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
Depends on:
  Show dependency treegraph
Reported: 2015-07-09 04:13 PDT by Keith
Modified: 2015-08-10 17:27 PDT (History)
4 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Description User image Keith 2015-07-09 04:13:53 PDT
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/600.6.3 (KHTML, like Gecko) Version/8.0.6 Safari/600.6.3

Steps to reproduce:

1. Visit
2. Click 'Slide 4', page should smooth scroll to slide 4
2. Click 'Slide 2', page should smooth scroll to slide 2
3. Click browser Back, page should smooth scroll to slide 4
4. Click browser Forward, page should smooth scroll to slide 2

Actual results:

Using the back/forward buttons does not trigger a scroll in this example

Expected results:

Page should have smooth scrolled to slides 4 and 2
Comment 1 User image :kip (Kearwood Gilbert) 2015-07-13 16:55:13 PDT
I have reproduced this using these instructions.  IMHO, this is a bug - users would expect the scrolling to be consistent when using the back/forward buttons to navigate between different hash URI's of the same page.
Comment 2 User image Nickolay_Ponomarev 2015-08-07 18:13:12 PDT
Thanks for the report! I can reproduce on OS X nightly.

This doesn't seem to be limited to `scroll-behavior: smooth`: if I remove that, the page still doesn't scroll on back/forward.

Any chance you could minimize the testcase even further, removing everything not required to reproduce the bug?
Comment 3 User image keith 2015-08-10 08:11:53 PDT
I've reduced the test case further:

It seems the problem occurs when an anchor is nested inside an element with the overflow property set.

In the demo above, comment out the `overflow` properties on lines 4 and 10 of the CSS to see the desired result.
Comment 4 User image Nickolay_Ponomarev 2015-08-10 17:27:58 PDT
Thanks for the testcase! Looks like this is a known bug...

*** This bug has been marked as a duplicate of bug 391664 ***

Note You need to log in before you can comment on or make changes to this bug.