Closed
Bug 659549
Opened 13 years ago
Closed 13 years ago
Tab bar scrolling using arrow buttons should use mozRequestAnimationFrame
Categories
(Toolkit :: UI Widgets, enhancement)
Toolkit
UI Widgets
Tracking
()
RESOLVED
FIXED
mozilla7
People
(Reporter: ventnor.bugzilla, Assigned: ventnor.bugzilla)
Details
Attachments
(1 file, 1 obsolete file)
3.14 KB,
patch
|
dao
:
review+
|
Details | Diff | Splinter Review |
A while ago we adopted the tab smooth scrolling animation to our animation API, when a tab was selected offscreen. However, the scrolling used when you hold down the arrow buttons on either side was not updated, thus making it seem jerky in comparison. We should update that animation too.
Assignee | ||
Comment 1•13 years ago
|
||
Comment on attachment 534976 [details] [diff] [review] Patch Huh, the new bug form no longer lets you mark attachments as patches.
Attachment #534976 -
Flags: review?(dao)
Assignee | ||
Updated•13 years ago
|
Attachment #534976 -
Attachment is patch: true
Comment 2•13 years ago
|
||
Comment on attachment 534976 [details] [diff] [review] Patch >+ <field name="_arrowSmoothScroll"><![CDATA[({ "_arrowSmoothScrollAnim" or just "_arrowScrollAnim" for consistency with _scrollAnim? >+ stop: function arrowSmoothScroll_stop() { >+ window.removeEventListener("MozBeforePaint", this, false); >+ this.scrollbox.scrollByIndex(this.scrollbox._scrollIndex); >+ this.scrollbox._scrollIndex = 0; I think I'd prefer to keep the scrollByIndex call and _scrollIndex = 0 in the _stopScroll method. >+ handleEvent: function arrowSmoothScroll_handleEvent(event) { >+ const scrollIndex = this.scrollbox._scrollIndex; >+ const timePassed = event.timeStamp - this.lastFrameTime; >+ this.lastFrameTime = event.timeStamp; >+ >+ const scrollDelta = 0.5 * timePassed * scrollIndex; >+ this.scrollbox.scrollPosition += scrollDelta; >+ >+ if (scrollIndex != 0) >+ window.mozRequestAnimationFrame(); >+ } Why is "if (scrollIndex != 0)" needed?
Updated•13 years ago
|
Assignee: nobody → ventnor.bugzilla
Component: Tabbed Browser → XUL Widgets
Product: Firefox → Toolkit
QA Contact: tabbed.browser → xul.widgets
Updated•13 years ago
|
Severity: normal → enhancement
Version: unspecified → Trunk
Assignee | ||
Comment 3•13 years ago
|
||
(In reply to comment #2) > >+ handleEvent: function arrowSmoothScroll_handleEvent(event) { > >+ const scrollIndex = this.scrollbox._scrollIndex; > >+ const timePassed = event.timeStamp - this.lastFrameTime; > >+ this.lastFrameTime = event.timeStamp; > >+ > >+ const scrollDelta = 0.5 * timePassed * scrollIndex; > >+ this.scrollbox.scrollPosition += scrollDelta; > >+ > >+ if (scrollIndex != 0) > >+ window.mozRequestAnimationFrame(); > >+ } > > Why is "if (scrollIndex != 0)" needed? I thought that would be necessary to stop requesting frames when we stop the scrolling by setting the index to 0. But looking at it again, it does seem unnecessary so I removed it.
Attachment #534976 -
Attachment is obsolete: true
Attachment #534976 -
Flags: review?(dao)
Attachment #537533 -
Flags: review?(dao)
Updated•13 years ago
|
Attachment #537533 -
Flags: review?(dao) → review+
Assignee | ||
Comment 4•13 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/f4321cdcef37
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Updated•13 years ago
|
Target Milestone: --- → mozilla7
You need to log in
before you can comment on or make changes to this bug.
Description
•