diff --git a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp
index 597caec823..e4fb38586b 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp
@@ -310,7 +310,11 @@ WebIDL::ExceptionOr HTMLInputElement::run_input_activation_behavior(DOM::E
// coordinate to that coordinate.
if (event.is_trusted() && is(event)) {
auto const& mouse_event = static_cast(event);
- m_selected_coordinate = { mouse_event.offset_x(), mouse_event.offset_y() };
+
+ CSSPixels x { mouse_event.offset_x() };
+ CSSPixels y { mouse_event.offset_y() };
+
+ m_selected_coordinate = { x.to_int(), y.to_int() };
}
// 4. Submit the element's form owner from the element with userInvolvement set to event's user navigation involvement.
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.h b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.h
index d7b60fb8aa..b0e0826e17 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.h
+++ b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.h
@@ -105,8 +105,8 @@ public:
WebIDL::ExceptionOr set_size(unsigned value);
struct SelectedCoordinate {
- double x { 0.0 };
- double y { 0.0 };
+ int x { 0 };
+ int y { 0 };
};
SelectedCoordinate selected_coordinate() const { return m_selected_coordinate; }