commit 2308a6c19b2e0cee0d5cf9e457018113e0ecc76c
parent c4e4daedd249e738e5e1d85aa41fa1c4dd72f0a6
Author: Edgar Chen <echen@mozilla.com>
Date: Mon, 5 Jan 2026 20:42:25 +0000
Bug 2002996 - Should not copy coalesced events when generating pointercapture events; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D277780
Diffstat:
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/dom/events/PointerEventHandler.cpp b/dom/events/PointerEventHandler.cpp
@@ -1532,7 +1532,8 @@ void PointerEventHandler::DispatchGotOrLostPointerCaptureEvent(
aIsGotCapture ? ePointerGotCapture : ePointerLostCapture,
aPointerEvent->mWidget);
- localEvent.AssignPointerEventData(*aPointerEvent, true);
+ localEvent.AssignPointerEventData(*aPointerEvent, /* aCopyTargets */ true,
+ /* aCopyCoalescedEvents */ false);
DebugOnly<nsresult> rv = presShell->HandleEventWithTarget(
&localEvent, aCaptureTarget->GetPrimaryFrame(), aCaptureTarget, &status);
diff --git a/widget/MouseEvents.h b/widget/MouseEvents.h
@@ -412,9 +412,10 @@ class WidgetMouseEvent : public WidgetMouseEventBase,
*/
Maybe<uint64_t> mCallbackId;
- void AssignMouseEventData(const WidgetMouseEvent& aEvent, bool aCopyTargets) {
+ void AssignMouseEventData(const WidgetMouseEvent& aEvent, bool aCopyTargets,
+ bool aCopyCoalescedEvents = true) {
AssignMouseEventBaseData(aEvent, aCopyTargets);
- AssignPointerHelperData(aEvent, /* aCopyCoalescedEvents */ true);
+ AssignPointerHelperData(aEvent, aCopyCoalescedEvents);
AssignMouseEventDataOnly(aEvent);
}
@@ -919,8 +920,9 @@ class WidgetPointerEvent : public WidgetMouseEvent {
// XXX Not tested by test_assign_event_data.html
void AssignPointerEventData(const WidgetPointerEvent& aEvent,
- bool aCopyTargets) {
- AssignMouseEventData(aEvent, aCopyTargets);
+ bool aCopyTargets,
+ bool aCopyCoalescedEvents = true) {
+ AssignMouseEventData(aEvent, aCopyTargets, aCopyCoalescedEvents);
mWidth = aEvent.mWidth;
mHeight = aEvent.mHeight;