Ideally, the pref and complicated dispatchers will be removed/updated in m-c on end of July unless nobody can work on it at that time. See bug 1904279 <https://bugzilla.mozilla.org/show_bug.cgi?id=1904279>.

On 24/06/12 8:42, Masayuki Nakano wrote:
Note that the behavior is switchable with a new pref, |`dom.w3c_pointer_events.dispatch_click_as_pointer_event`|. Therefore, for a while, new event dispatchers in C++ need to do:
Maybe<WidgetPointerEvent> pointerEvent;
Maybe<WidgetMouseEvent> mouseEvent;
if (StaticPrefs::dom_w3c_pointer_events_dispatch_click_as_pointer_event()) {
   pointerEvent.emplace(true, ePointerClick, widget);
} else {
   mouseEvent.emplace(true, ePointerClick, widget, WidgetMouseEvent::eReal);
}
WidgetMouseEvent& mouseOrPointerEvent =
   pointerEvent.isSome() ? pointerEvent.ref() : mouseEvent.ref();
mouseOrPointerEvent.mSomething = something;
widget->DispatchInputEvent(mouseOrPointerEvent);

and chrome script and mochitest in chrome context need to do:

const ClickEventConstructor = SpecialPowers.getBoolPref(
   "dom.w3c_pointer_events.dispatch_click_as_pointer_event"
)
   ? PointerEvent
   : MouseEvent;
const clickEvent = new ClickEventConstructor("click", { bubbles: true, 
cancelable: true, ... });
target.dispatchEvent(clickEvent);

--
Masayuki Nakano<[email protected]>
Working on DOM, Events, editor and IME handling for Gecko

--
You received this message because you are subscribed to the Google Groups 
"[email protected]" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/4fc40d2c-c136-4a66-a738-3d62b361f08f%40d-toybox.com.

Reply via email to