Bug 1904279 - Get rid of dom.w3c_pointer_events.dispatch_click_as_pointer_event pref r=smaug,pip-reviewers,search-reviewers,devtools-reviewers,urlbar-reviewers,nchevobbe,dao,jteow,mconley

Keep supporting the pref makes a lot of `click`, `auxclick` and `contextmenu`
event creators complicated (and look messy).  So, let's delete it as soon as
possible.

Differential Revision: https://phabricator.services.mozilla.com/D217225
This commit is contained in:
Masayuki Nakano
2024-07-30 06:49:42 +00:00
parent f649fec27f
commit 528d09c312
30 changed files with 41 additions and 256 deletions

View File

@@ -2983,15 +2983,7 @@ void HTMLInputElement::MaybeSubmitForm(nsPresContext* aPresContext) {
// Get the default submit element
if (RefPtr<nsGenericHTMLFormElement> submitContent =
mForm->GetDefaultSubmitElement()) {
Maybe<WidgetPointerEvent> pointerEvent;
Maybe<WidgetMouseEvent> mouseEvent;
if (StaticPrefs::dom_w3c_pointer_events_dispatch_click_as_pointer_event()) {
pointerEvent.emplace(true, ePointerClick, nullptr);
} else {
mouseEvent.emplace(true, ePointerClick, nullptr, WidgetMouseEvent::eReal);
}
WidgetMouseEvent& event =
pointerEvent.isSome() ? pointerEvent.ref() : mouseEvent.ref();
WidgetPointerEvent event(true, ePointerClick, nullptr);
event.mInputSource = MouseEvent_Binding::MOZ_SOURCE_KEYBOARD;
// pointerId definition in Pointer Events:
// > The pointerId value of -1 MUST be reserved and used to indicate events