mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-24 09:52:31 +00:00
LibWeb: Don't propagate key events that are handled by the media player
If a key is pressed when the media player is in focus, which causes the media player to perform some action, that key event is no longer propagated further.
This commit is contained in:
parent
f1395a2c38
commit
63231fd276
Notes:
github-actions[bot]
2024-09-04 14:00:50 +00:00
Author: https://github.com/tcl3
Commit: 63231fd276
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1273
Reviewed-by: https://github.com/trflynn89 ✅
3 changed files with 6 additions and 5 deletions
|
@ -1914,7 +1914,7 @@ void HTMLMediaElement::reject_pending_play_promises(ReadonlySpan<JS::NonnullGCPt
|
|||
WebIDL::reject_promise(realm, promise, error);
|
||||
}
|
||||
|
||||
WebIDL::ExceptionOr<void> HTMLMediaElement::handle_keydown(Badge<Web::EventHandler>, UIEvents::KeyCode key)
|
||||
WebIDL::ExceptionOr<bool> HTMLMediaElement::handle_keydown(Badge<Web::EventHandler>, UIEvents::KeyCode key)
|
||||
{
|
||||
switch (key) {
|
||||
case UIEvents::KeyCode::Key_Space:
|
||||
|
@ -1961,10 +1961,10 @@ WebIDL::ExceptionOr<void> HTMLMediaElement::handle_keydown(Badge<Web::EventHandl
|
|||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
return false;
|
||||
}
|
||||
|
||||
return {};
|
||||
return true;
|
||||
}
|
||||
|
||||
void HTMLMediaElement::set_layout_display_time(Badge<Painting::MediaPaintable>, Optional<double> display_time)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue