Open Bug 1216741 Opened 9 years ago Updated 2 years ago

scroll-behavior: smooth does not work on elements inside a scrolling="no" iframe

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

44 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: gordon, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36

Steps to reproduce:

It is not uncommon to need to use scrolling="no" on an iframe in order to hide the scrollbars.  While still wishing the root element inside the iframe to scrollable via javascript.

To reproduce:

1. Create an iframe with scrolling="no".
2. ensure the content of this iframe overflows.
3. Call window.scroll({top : 1000, left : 0, behavior : smooth}) from inside the iframe.


Actual results:

Nothing happens.  The content does not scroll at all.


Expected results:

The root element should still scroll correctly, with the smooth scrolling behavior.

Calling window.scroll(1000, 0) without "behavior : smooth" does indeed scroll the element correctly.  Surely the behaviors should match?

The same issue appears if you use the css version of scroll-behaviour : smooth.

We use this combination of scrolling="no" with a scrolling root element inside quite frequently for embeddable sliders and scrollers that should not have scrollbars.  If the intention is to make scrolling="no" iframes completely static, then another way of hiding the scrollbars on iframes would be required.

Also as a side note, in this instance APZ needs to be considered as it is obviously still desirable in such a case, despite the iframe being scrolling="no" and it appears likely to be disabled soon if https://bugzilla.mozilla.org/show_bug.cgi?id=740341 is anything to go by.
Component: Untriaged → Event Handling
Product: Firefox → Core
Component: Event Handling → User events and focus handling
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.