Open Bug 176800 Opened 22 years ago Updated 2 years ago

Avoid sending coords for mouse wheel events when no move occurs

Categories

(Core :: XUL, defect)

x86
Windows XP
defect

Tracking

()

People

(Reporter: hyatt, Unassigned)

Details

Attachments

(1 file, 1 obsolete file)

An optimization.  The point on a mouse scroll event becomes irrelevant if you're
in the middle of wheeling (it's only relevant for the first of several wheels).

Speeds up mouse wheeling pretty substantially for me on some pages.
Attached patch Patch. (obsolete) — Splinter Review
Does this change the way these events are viewed in the DOM too?  Or do we not
usefully expose them in the DOM yet?
Attachment #104201 - Attachment is obsolete: true
Comment on attachment 104204 [details] [diff] [review]
Better patch. Make it a global var.

Lose the unneeded whitespace changes and r=bryner.
Attachment #104204 - Flags: review+
Comment on attachment 104204 [details] [diff] [review]
Better patch. Make it a global var.

sr=bzbarsky if bryner's happy.
Attachment #104204 - Flags: superreview+
Status: NEW → ASSIGNED
Summary: Avoid sending coords for mouse wheel events when no move occurs → [trunk approval] Avoid sending coords for mouse wheel events when no move occurs
Target Milestone: --- → mozilla1.2final
hyatt, can you check this patch in?
taking.
Assignee: hyatt → bryner
Status: ASSIGNED → NEW
Bringing jkeiser in since he's been doing heavy lifting with mouse events
lately.  The basic idea is that the only reason an event coordinate would be
important for a mousewheel event is to clear the hover state on the content that
the mouse pointer was previously over.  Since we don't set :hover on any new
content until the mouse is moved, there's no benefit to setting an event
coordinate for subsequent scroll events without a move event, and it lets us
avoid a potentially expensive GetFrameForPoint lookup.  This works because
scrolling views have widgets, so event coordinates anywhere within that widget
will give you the same scrolling view.

One thing I don't think we took into account is that we dispatch a
DOMMouseScroll event (in nsEventStateManager::DoWheelScroll).  This patch may
cause the target of that event to be incorrect; we should check whether that
breaks anything.  It looks like XUL trees, listboxes, and tooltips make use of
this event.  No DOM event spec mentions this event, however, IE does fire a
mousewheel event (see
http://msdn.microsoft.com/workshop/author/dhtml/reference/events/onmousewheel.asp )

I'd like to either get this in or decide that it's not a valid optimization and
wontfix it.
Status: NEW → ASSIGNED
Summary: [trunk approval] Avoid sending coords for mouse wheel events when no move occurs → Avoid sending coords for mouse wheel events when no move occurs
Target Milestone: mozilla1.2final → mozilla1.4alpha
Assignee: bryner → jag
Status: ASSIGNED → NEW
QA Contact: jrgmorrison → xptoolkit.widgets
Target Milestone: mozilla1.4alpha → ---
Assignee: jag → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: