Closed Bug 1088700 Opened 10 years ago Closed 10 years ago

Pressing the home button on the home screen instantly returns to the top of the home screen instead of smoothly scrolling

Categories

(Firefox OS Graveyard :: Gaia::Homescreen, defect)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
2.1 S8 (7Nov)

People

(Reporter: cwiiis, Assigned: kgrandon)

References

Details

(Keywords: regression, Whiteboard: [systemsfe])

Attachments

(1 file)

Pressing the home button on the home screen should (and used to, about a week ago and all times prior) smoothly scroll to the top of the screen. It now instantly jumps to the top of the screen.

I believe this is a platform regression, probably from bug 1010538. It could be that we need to alter something in the homescreen code, but let's get the regression window first so we know what to look at.
Kip - did anything change here recently? Do we now need a pref for this to enable smooth scrolling?
Depends on: 1010538
Flags: needinfo?(kgilbert)
(In reply to Kevin Grandon :kgrandon from comment #1)
> Kip - did anything change here recently? Do we now need a pref for this to
> enable smooth scrolling?
The home button has always scrolled smoothly to the top, so there is no need for a preference.

Originally this was implemented in Javascript, but was a bit janky.  This was updated to use the CSSOM-View Smooth Scrolling DOM methods for a smoother result.  The CSSOM-View Smooth Scrolling specification has since evolved -- I have landed an update in Gecko that updates to the new specification.  This breaks the one-line piece of code added to the home screen app, resulting in instant scrolling when it should be smooth.

app.js in the verticalhome app should be updated from:

window.scrollTo(0, 0, {behavior: 'smooth'});

To:

window.scrollTo({left: 0, top: 0, behavior: 'smooth'});

I believe this is the only instance of using the CSSOM-View smooth scrolling DOM methods prior to the updated CSSOM-View specification.
Flags: needinfo?(kgilbert)
Thanks for the quick reply Kip! This seems like an easy fix, so I'll go ahead and make the updates now.
Assignee: nobody → kgrandon
Status: NEW → ASSIGNED
Whiteboard: [systemsfe]
It seems to work fine and is quite simple. R=me to save people time on review cycles since people are busy fixing blockers.
Attachment #8512880 - Flags: review+
In master: https://github.com/mozilla-b2g/gaia/commit/03ea336114d7623a1e5f0ee3e67f04c61f91fb71
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.1 S8 (7Nov)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: