Closed Bug 607464 Opened 14 years ago Closed 13 years ago

Smooth scrolling + pixel scrolling + inertia = fail

Categories

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

All
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla2.0b12

People

(Reporter: tommybxp, Assigned: mstange)

References

(Depends on 1 open bug)

Details

(Keywords: regression)

Attachments

(1 file, 2 obsolete files)

User-Agent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b6) Gecko/20100101 Firefox/4.0b6
Build Identifier: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b6) Gecko/20100101 Firefox/4.0b6

scrolling with the page up and page down with smooth scrolling is very nice, but this causes problems with the magic mouse since it already does smooth scrolling automatically.
Turning smooth scrolling off fixes the magic mouse problems, but the keyboards scrolling no longer has smooth scrolling.

need option to turn them on/off individually

Reproducible: Always

Steps to Reproduce:
1.turn on smooth scrolling
2.scroll with magic mouse up and down
3.
Actual Results:  
scrolling with the magic mouse not fluid.

Expected Results:  
more fluid scrolling.
Severity: major → normal
Component: Preferences → Widget: Cocoa
Product: Firefox → Core
QA Contact: preferences → cocoa
Version: unspecified → Trunk
Assignee: nobody → mstange
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Summary: smooth scrolling with keyboard shortcuts on, but not mouse wheel → Smooth scrolling + pixel scrolling + inertia = fail
This is a regression from bug 526394. At the moment there's nothing that checks for nsIScrollableFrame::SMOOTH at all...
Blocks: 526394
Keywords: regression
Oh, because INSTANT is now considered the inverse of SMOOTH.
We need a third scroll mode.
Attached patch v1 (obsolete) — Splinter Review
Attachment #505785 - Flags: review?(roc)
Comment on attachment 505785 [details] [diff] [review]
v1

Thanks Markus!

     PRBool noDefer = aMouseEvent->scrollFlags & nsMouseScrollEvent::kNoDefer;
+    PRBool smooth = aScrollQuantity != nsIScrollableFrame::DEVICE_PIXELS;
     nsIntPoint overflow;
     frameToScroll->ScrollBy(nsIntPoint(scrollX, scrollY), aScrollQuantity,
                             noDefer ? nsIScrollableFrame::INSTANT
-                                    : nsIScrollableFrame::SMOOTH,
+                                    : (smooth ? nsIScrollableFrame::SMOOTH
+                                              : nsIScrollableFrame::NORMAL),

Instead of this nested ternary operator, how about something more like
  PRUint32 flags;
  if (aMouseEvent->scrollFlags & nsMouseScrollEvent::kNoDefer) {
    flags = nsIScrollableFrame::INSTANT;
  } else if (aScrollQuantity != nsIScrollableFrame::DEVICE_PIXELS) {
    flags = nsIScrollableFrame::SMOOTH;
  } else {
    flags = nsIScrollableFrame::NORMAL;
  }
Attachment #505785 - Flags: review?(roc) → review+
Attached patch for checkin (obsolete) — Splinter Review
Attachment #505785 - Attachment is obsolete: true
Attachment #506350 - Flags: approval2.0?
Component: Widget: Cocoa → Event Handling
QA Contact: cocoa → events
Comment on attachment 506350 [details] [diff] [review]
for checkin

I think we're better off taking this after 2.0 is out the door. If you strongly disagree please renominate and make a case for taking this change this late in this release.
Attachment #506350 - Flags: approval2.0? → approval2.0-
Attached patch with testSplinter Review
Re-requesting approval: This patch fixes a regression from Firefox 3.6 that makes scrolling with Mac touchpads needlessly sluggish if smooth scrolling is turned on. It's very small and only restores logic that was inadvertently removed in bug 526394, so it's very low-risk. It also has a test (as of now).
Attachment #506350 - Attachment is obsolete: true
Attachment #509370 - Flags: approval2.0?
Roc, you cool with approving this for 2.0?
... and actually cc:ing roc. roc, please see previous comments.
Comment on attachment 509370 [details] [diff] [review]
with test

Yes.
Attachment #509370 - Flags: approval2.0? → approval2.0+
http://hg.mozilla.org/mozilla-central/rev/59642a869419
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b12
Depends on: 726468
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: