Closed Bug 369793 Opened 19 years ago Closed 19 years ago

DOMMouseScroll events not dispatched when they cause text zoom changes

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: myk, Assigned: smaug)

References

Details

Attachments

(2 files, 1 obsolete file)

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.
Attached file a testcase
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.
Attachment #254795 - Flags: review?(bzbarsky)
Comment on attachment 254795 [details] [diff] [review] Make DOMMouseScroll work more like other events Oops, this doesn't handle nsIDOMNSUIEvent::SCROLL_PAGE_DOWN properly.
Attachment #254795 - Flags: review?(bzbarsky)
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.
Attachment #254795 - Attachment is obsolete: true
Attachment #254810 - Flags: review?(bzbarsky)
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: 19 years ago
Resolution: --- → FIXED
Flags: in-testsuite?
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: