From 438c5bce6c133e22ae73c20508c964ed4dc79c10 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 7 Feb 2022 13:23:33 +0100 Subject: [PATCH] LibWeb: Add MouseEvent.x and MouseEvent.y Per the CSSOM View spec, these are aliases for clientX and clientY. --- Userland/Libraries/LibWeb/UIEvents/MouseEvent.h | 4 ++++ Userland/Libraries/LibWeb/UIEvents/MouseEvent.idl | 2 ++ 2 files changed, 6 insertions(+) diff --git a/Userland/Libraries/LibWeb/UIEvents/MouseEvent.h b/Userland/Libraries/LibWeb/UIEvents/MouseEvent.h index b8b8802967..2f3cd652fb 100644 --- a/Userland/Libraries/LibWeb/UIEvents/MouseEvent.h +++ b/Userland/Libraries/LibWeb/UIEvents/MouseEvent.h @@ -25,9 +25,13 @@ public: double offset_x() const { return m_offset_x; } double offset_y() const { return m_offset_y; } + double client_x() const { return m_client_x; } double client_y() const { return m_client_y; } + double x() const { return client_x(); } + double y() const { return client_y(); } + protected: MouseEvent(const FlyString& event_name, double offset_x, double offset_y, double client_x, double client_y); diff --git a/Userland/Libraries/LibWeb/UIEvents/MouseEvent.idl b/Userland/Libraries/LibWeb/UIEvents/MouseEvent.idl index b8538cea66..972c3a5476 100644 --- a/Userland/Libraries/LibWeb/UIEvents/MouseEvent.idl +++ b/Userland/Libraries/LibWeb/UIEvents/MouseEvent.idl @@ -4,5 +4,7 @@ interface MouseEvent : UIEvent { readonly attribute double offsetY; readonly attribute double clientX; readonly attribute double clientY; + readonly attribute double x; + readonly attribute double y; };