mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
[WebDriver] Add synchronization for key action (#37403)
Implement action synchronization for key event. Previously only done for pointer https://github.com/servo/servo/pull/36932 and wheel https://github.com/servo/servo/pull/37260. --------- Signed-off-by: PotatoCP <kenzieradityatirtarahardja18@gmail.com>
This commit is contained in:
parent
f97cdb4d12
commit
cdc8b45965
16 changed files with 171 additions and 118 deletions
|
@ -8,7 +8,7 @@ use std::path::PathBuf;
|
|||
use std::rc::Rc;
|
||||
|
||||
use euclid::Vector2D;
|
||||
use keyboard_types::{Key, KeyboardEvent, Modifiers, ShortcutMatcher};
|
||||
use keyboard_types::{Key, Modifiers, ShortcutMatcher};
|
||||
use log::{error, info};
|
||||
use servo::base::id::WebViewId;
|
||||
use servo::config::{opts, pref};
|
||||
|
@ -17,8 +17,8 @@ use servo::webrender_api::ScrollLocation;
|
|||
use servo::webrender_api::units::{DeviceIntPoint, DeviceIntSize};
|
||||
use servo::{
|
||||
AllowOrDenyRequest, AuthenticationRequest, FilterPattern, FormControl, GamepadHapticEffectType,
|
||||
LoadStatus, PermissionRequest, Servo, ServoDelegate, ServoError, SimpleDialog, TouchEventType,
|
||||
WebView, WebViewBuilder, WebViewDelegate,
|
||||
KeyboardEvent, LoadStatus, PermissionRequest, Servo, ServoDelegate, ServoError, SimpleDialog,
|
||||
TouchEventType, WebView, WebViewBuilder, WebViewDelegate,
|
||||
};
|
||||
use url::Url;
|
||||
|
||||
|
@ -314,7 +314,7 @@ impl RunningAppState {
|
|||
/// Handle servoshell key bindings that may have been prevented by the page in the focused webview.
|
||||
fn handle_overridable_key_bindings(&self, webview: ::servo::WebView, event: KeyboardEvent) {
|
||||
let origin = webview.rect().min.ceil().to_i32();
|
||||
ShortcutMatcher::from_event(event)
|
||||
ShortcutMatcher::from_event(event.event)
|
||||
.shortcut(CMD_OR_CONTROL, '=', || {
|
||||
webview.set_zoom(1.1);
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue