mirror of
https://github.com/servo/servo.git
synced 2025-09-27 15:20:09 +01:00
Rename InputEvent::MouseLeave
to InputEvent::MouseLeftViewport
(#38695)
1. `InputEvent::MouseLeave` indicates that mouse has left the viewport (fired by embedder) or iframe (synthesized in Constellationf24f225db8/components/constellation/constellation_webview.rs (L119-L122)
). Its handler in script is named as `handle_mouse_leave_event`, which is very misleading as we have DOM event [mouseleave](https://w3c.github.io/uievents/#event-type-mouseleave). I rename it to `MouseLeftViewport` to be consistent with `WindowEvent::CursorLeft`:f24f225db8/ports/servoshell/desktop/headed_window.rs (L632-L638)
2. Add doc and rename function, such as `handle_mouse_move_event` to `handle_native_mouse_move_event` to be closer to [spec](https://w3c.github.io/uievents/#handle-native-mouse-move). Testing: Just renaming + skipping unnecessary hit-test in simple case. Fixes: Nothing but preparing for #38670 and #38435. --------- Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
This commit is contained in:
parent
8b574539d1
commit
494493ceb7
6 changed files with 33 additions and 27 deletions
|
@ -355,7 +355,7 @@ impl WebViewRenderer {
|
|||
InputEvent::MouseMove(_) => {
|
||||
self.global.borrow_mut().last_mouse_move_position = event_point;
|
||||
},
|
||||
InputEvent::MouseLeave(_) => {
|
||||
InputEvent::MouseLeftViewport(_) => {
|
||||
self.global.borrow_mut().last_mouse_move_position = None;
|
||||
},
|
||||
InputEvent::MouseButton(_) | InputEvent::Wheel(_) => {},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue