Closed Bug 369793 Opened 16 years ago Closed 16 years ago
Scroll events not dispatched when they cause text zoom changes
nsEventStateManager::DoScrollTextsize doesn't dispatch events, so when nsEventStateManager::PostHandleEvent calls it to change the text zoom, event listeners don't get notified about the DOMMouseScroll event. Contrast with nsEventStateManager::DoScrollText, which does dispatch events. Seems like DoScrollTextsize should dispatch events just like DoScrollText does, so listeners who care about text zoom changes can find out about them.
The testcase shows that currently DOMMouseScroll is also targeted wrongly.Event target shouldn't be [object Text], which it is currently if mouse is over some text.
Assignee: events → Olli.Pettay
Status: NEW → ASSIGNED
This removes explicit DOMMouseScroll dispatching, because there is already NS_MOUSE_SCROLL event being dispatched. event->detail is now updated in ESM::PreHandleEvent so that it has the right value during the actual event dispatching.
Comment on attachment 254795 [details] [diff] [review] Make DOMMouseScroll work more like other events Oops, this doesn't handle nsIDOMNSUIEvent::SCROLL_PAGE_DOWN properly.
This adds 2 calls to Get***Pref comparing to the current code, but mouse wheel events aren't dispatched that often (comparing to mouse move, for example). The reason for those 2 calls is that PreHandleEvent needs to know whether to useSysNumLines and what is the action for the mousewheel event. Those same values are then needed in PostHandleEvent. The patch fixes the event targeting bug, because DOMMouseScroll is now handled like any other event.
I'm not going to be able to review this quickly... Please ask someone else if you want a review in the next few weeks?
Attachment #254810 - Flags: review?(bzbarsky) → review?(jst)
Comment on attachment 254810 [details] [diff] [review] handles nsIDOMNSUIEvent::SCROLL_PAGE_UP/DOWN r=jst
Attachment #254810 - Flags: review?(jst) → review+
Attachment #254810 - Flags: superreview?(peterv)
Comment on attachment 254810 [details] [diff] [review] handles nsIDOMNSUIEvent::SCROLL_PAGE_UP/DOWN I wonder if it wouldn't be cheaper to use AppendLiteral instead of NS_LITERAL_CSTRING/Append. Either way, sr=peterv.
Attachment #254810 - Flags: superreview?(peterv) → superreview+
Writing a mochitest would require (an enhanced version of ) bug 364508.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.