mirror of
https://github.com/servo/servo.git
synced 2025-09-30 00:29:14 +01:00
script: Remove duplicate context menu trigger (#38669)
#38584 moves input event handling to new `DocumentEventHandler`, but probably reintroduced some removed code when resolving conflict with #38589. Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
This commit is contained in:
parent
97a114b248
commit
cd3d982a2a
1 changed files with 1 additions and 8 deletions
|
@ -589,8 +589,7 @@ impl DocumentEventHandler {
|
|||
|
||||
// Step 9. If mbutton is the secondary mouse button, then
|
||||
// Maybe show context menu with native, target.
|
||||
if let (MouseButtonAction::Down, MouseButton::Right) = (event.action, event.button)
|
||||
{
|
||||
if let MouseButton::Right = event.button {
|
||||
self.maybe_show_context_menu(
|
||||
node.upcast(),
|
||||
&hit_test_result,
|
||||
|
@ -611,12 +610,6 @@ impl DocumentEventHandler {
|
|||
dom_event.dispatch(node.upcast(), false, can_gc);
|
||||
},
|
||||
}
|
||||
|
||||
// When the contextmenu event is triggered by right mouse button
|
||||
// the contextmenu event MUST be dispatched after the mousedown event.
|
||||
if let (MouseButtonAction::Down, MouseButton::Right) = (event.action, event.button) {
|
||||
self.maybe_show_context_menu(node.upcast(), &hit_test_result, input_event, can_gc);
|
||||
}
|
||||
}
|
||||
|
||||
/// <https://www.w3.org/TR/uievents/#maybe-show-context-menu>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue