mirror of
https://github.com/servo/servo.git
synced 2025-09-27 23:30:08 +01:00
script/compositor: Send mouseleave
events when cursor moves between <iframe>
s (#38539)
Properly send `mouseleave` events when the cursor moves between `<iframe>`s. This allows a better handling of cursor changes and status text updates. Specifically, we do not need to continuously update the cursor and the value can be cached in the `Document`. In addition, status updates can now be sent properly when moving focus between `<iframe>`s. Note that style updates for `:hover` values are still broken, but less so than before. Now the hover state on the `Node` is updated, but for some reason the restyle isn't taking place properly. This maintains the status quo as far as behavior goes when hover moves between `<iframe>`s. This change also adds a helper data structure to `Document` which will eventually be responsible for event handling. Testing: Cursor and status change are currently very hard to test as the API test harness makes this difficult at the moment. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
82ca2b92cd
commit
b75c3feb97
11 changed files with 307 additions and 210 deletions
|
@ -43,7 +43,7 @@ impl InputEvent {
|
|||
InputEvent::Keyboard(..) => None,
|
||||
InputEvent::MouseButton(event) => Some(event.point),
|
||||
InputEvent::MouseMove(event) => Some(event.point),
|
||||
InputEvent::MouseLeave(event) => Some(event.point),
|
||||
InputEvent::MouseLeave(_) => None,
|
||||
InputEvent::Touch(event) => Some(event.point),
|
||||
InputEvent::Wheel(event) => Some(event.point),
|
||||
InputEvent::Scroll(..) => None,
|
||||
|
@ -218,15 +218,9 @@ impl MouseMoveEvent {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
|
||||
#[derive(Clone, Copy, Debug, Default, Deserialize, Serialize)]
|
||||
pub struct MouseLeaveEvent {
|
||||
pub point: DevicePoint,
|
||||
}
|
||||
|
||||
impl MouseLeaveEvent {
|
||||
pub fn new(point: DevicePoint) -> Self {
|
||||
Self { point }
|
||||
}
|
||||
pub focus_moving_to_another_iframe: bool,
|
||||
}
|
||||
|
||||
/// The type of input represented by a multi-touch event.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue