Closed Bug 481768 Opened 11 years ago Closed 11 years ago

mouse wheel scrolls too far when viewport is smallish

Categories

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

x86
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla1.9.2a1

People

(Reporter: karlt, Assigned: karlt)

Details

Attachments

(4 files, 1 obsolete file)

Attached file testcase
STR:
mouse over the textarea in the testcase, and move the scroll wheel one
notch down.

Actual results:
hij3 is aligned with the top of the textarea.
(Much of hij2 and hij5 is never visible when scrolling up and down with the
wheel.)

Expected results:
hij2 or at least the bottom part of it to scroll into view.

Although the mouse wheel is set to scroll 3 lines, this should be limited by
the page scroll amount.
Attached patch patch (obsolete) — Splinter Review
Attachment #365813 - Flags: review?(Olli.Pettay)
What is the behavior in other browsers? Or elsewhere?
Is this possible something which depends on the OS?

I agree "limited by the page scroll amount" does make sense, but
if that is not what happens elsewhere...
Ok, I can't find any consistency in browsers.
Karl, what do you think about this?
This makes scrolling to work more like what happens when scrollbar's
arrow buttons are pressed, at least with your testcase.
Attachment #365902 - Flags: review?(mozbugz)
Attachment #365813 - Attachment is obsolete: true
Attachment #365813 - Flags: review?(Olli.Pettay)
Attachment #365902 - Flags: review?(mozbugz) → review+
Comment on attachment 365902 [details] [diff] [review]
alternative patch

> Karl, what do you think about this?

Yes, I like that.  (I had wondered whether that behavior might be better.)

>+          nscoord maxLines = (pageScroll / lineHeight);

These parentheses can be removed.
Attachment #365902 - Flags: superreview?(roc)
Attachment #365902 - Flags: superreview?(roc) → superreview+
http://hg.mozilla.org/mozilla-central/rev/797e33c3e909

(Passed locally mouse scroll related tests.)
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
sounds related:

*** 78368 ERROR TEST-UNEXPECTED-FAIL | /tests/toolkit/content/tests/widgets/test_mousescroll.xul | mouse-scroll of 'richlistbox' vertical starting 2 delta 100 eventType DOMMouseScroll hasPixels false - got 4, expected 5
Backed out.
I guess the testcase needs to be modified a bit.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
This modifies the test to check for scrolling in the correct direction.

Being specific about the item that will be at the top of the richlistbox would involve assumptions about the line-heights of the fonts involved and the height of each richlistitem.  ("mouse-scroll of 'richlistbox' vertical starting 2 delta 100 eventType DOMMouseScroll hasPixels false" gets 3 not 4 on my system.)
Attachment #366231 - Flags: review?(roc)
http://hg.mozilla.org/mozilla-central/rev/da366d419dbc
Status: REOPENED → RESOLVED
Closed: 11 years ago11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.2a1
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.