From d6cfc735ae6cc2cc6fb55cfb73fc4be765273ae2 Mon Sep 17 00:00:00 2001 From: Luke Wilde Date: Sat, 5 Nov 2022 14:40:31 +0000 Subject: [PATCH] LibWeb: Expose MouseEvent.{screenX,screenY} These are currently the same as clientX and clientY, but it works for now. --- Userland/Libraries/LibWeb/UIEvents/MouseEvent.h | 4 ++++ Userland/Libraries/LibWeb/UIEvents/MouseEvent.idl | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/UIEvents/MouseEvent.h b/Userland/Libraries/LibWeb/UIEvents/MouseEvent.h index 88c9ec6b98..a1c3675c3a 100644 --- a/Userland/Libraries/LibWeb/UIEvents/MouseEvent.h +++ b/Userland/Libraries/LibWeb/UIEvents/MouseEvent.h @@ -37,6 +37,10 @@ public: double client_x() const { return m_client_x; } double client_y() const { return m_client_y; } + // FIXME: Make these actually different from clientX and clientY. + double screen_x() const { return m_client_x; } + double screen_y() const { return m_client_y; } + double x() const { return client_x(); } double y() const { return client_y(); } diff --git a/Userland/Libraries/LibWeb/UIEvents/MouseEvent.idl b/Userland/Libraries/LibWeb/UIEvents/MouseEvent.idl index eece02e965..94b2c67902 100644 --- a/Userland/Libraries/LibWeb/UIEvents/MouseEvent.idl +++ b/Userland/Libraries/LibWeb/UIEvents/MouseEvent.idl @@ -6,6 +6,8 @@ interface MouseEvent : UIEvent { readonly attribute double offsetY; readonly attribute double clientX; readonly attribute double clientY; + readonly attribute double screenX; + readonly attribute double screenY; readonly attribute double x; readonly attribute double y; @@ -23,4 +25,4 @@ dictionary MouseEventInit : EventModifierInit { short button = 0; -}; \ No newline at end of file +};