mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-03 15:26:07 +00:00
Bug 1734238 - Wheel event should be dispatched to the remote target that requests the pointer lock; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D127810
This commit is contained in:
parent
57ac363238
commit
92b7c2a045
@ -1524,6 +1524,10 @@ void EventStateManager::DispatchCrossProcessEvent(WidgetEvent* aEvent,
|
||||
return;
|
||||
}
|
||||
case eWheelEventClass: {
|
||||
if (BrowserParent* pointerLockedRemote =
|
||||
PointerLockManager::GetLockedRemoteTarget()) {
|
||||
remote = pointerLockedRemote;
|
||||
}
|
||||
remote->SendMouseWheelEvent(*aEvent->AsWheelEvent());
|
||||
return;
|
||||
}
|
||||
|
@ -85,6 +85,16 @@ async function start() {
|
||||
}, { once: true });
|
||||
});
|
||||
|
||||
// Mouse wheel event should be dispatched to locked element.
|
||||
synthesizeWheel(iframe, 10, 10, { deltaY: 3.0, deltaMode: WheelEvent.DOM_DELTA_LINE });
|
||||
await new Promise((aResolve) => {
|
||||
document.addEventListener("wheel", function(e) {
|
||||
info("Got wheel");
|
||||
is(e.target, target, "event.target");
|
||||
aResolve();
|
||||
}, { once: true });
|
||||
});
|
||||
|
||||
// Pointer lock requested in iframe should be rejected.
|
||||
let win = iframe.contentWindow;
|
||||
win.focus()
|
||||
|
Loading…
x
Reference in New Issue
Block a user