1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 07:07:45 +00:00

LibWeb: Partially implement MouseEvent.movementX/movementY

Currently doesn't handle the mouse leaving and entering the window per
the spec, and uses clientX/Y instead of screenX/Y. See FIXMEs.
This commit is contained in:
circl 2023-08-24 17:47:13 +02:00 committed by Andrew Kaster
parent ebb7079795
commit e0e67a2b27
5 changed files with 51 additions and 8 deletions

View file

@ -44,6 +44,7 @@ private:
bool fire_keyboard_event(FlyString const& event_name, HTML::BrowsingContext& browsing_context, KeyCode key, unsigned modifiers, u32 code_point);
CSSPixelPoint compute_mouse_event_client_offset(CSSPixelPoint event_page_position) const;
CSSPixelPoint compute_mouse_event_page_offset(CSSPixelPoint event_client_offset) const;
CSSPixelPoint compute_mouse_event_movement(CSSPixelPoint event_client_offset) const;
struct Target {
JS::GCPtr<Painting::Paintable> paintable;
@ -63,6 +64,8 @@ private:
NonnullOwnPtr<EditEventHandler> m_edit_event_handler;
WeakPtr<DOM::EventTarget> m_mousedown_target;
Optional<CSSPixelPoint> m_mousemove_previous_client_offset;
};
}