Closed Bug 156312 Opened 23 years ago Closed 22 years ago

onscroll events fire when scroll doesn't happen

Categories

(Core :: DOM: Events, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.2beta

People

(Reporter: dean_tessman, Assigned: radha)

References

()

Details

(Keywords: testcase)

Attachments

(1 file)

From bug 35011 comment 69: Looking at http://www.hixie.ch/tests/adhoc/dom/level0/001.html We get onscroll events even when a scroll hasn't happened. For example, drag the vertical scrollbar up beyond its bounds. The event counter keeps incrementing. In IE6, the counter only increments if an actual scroll occurs.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.2beta
Keywords: testcase
Attached patch Initial patch (deleted) — Splinter Review
The patch makes sure that there was indeed a change in the scrollbar positionbefore firing the onScroll event. Because of this change onScroll event will not fire if you resize the window and the resize lead to a change in the size of the slider and/or the top position of the slider.
Comment on attachment 99899 [details] [diff] [review] Initial patch Nit of the day: if (presShell && targetFrame && targetContent) presShell->HandleEventWithTarget(&event, targetFrame, targetContent, NS_EVENT_FLAG_INIT, &status); - nsIScrollableView* s = GetScrollableView(mOuter->mPresContext); + s->RemoveScrollPositionListener(this); ScrollbarChanged(mOuter->mPresContext, x*mOnePixel, y*mOnePixel); s->AddScrollPositionListener(this); How about removing the whole line where you're removing the code above, and then also remove the empty line below it. No need to space things out this much IMO. Other than that, this looks great. sr=jst
Attachment #99899 - Flags: superreview+
Comment on attachment 99899 [details] [diff] [review] Initial patch Looks good to me, r=saari
Attachment #99899 - Flags: review+
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
verifying build 2003-01-17-04-trunk
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: