mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:28:12 +00:00
LibWeb: Store the input image button's selected coordinates as integers
The spec has prose which states, e.g., "The x-component must be a valid integer".
This commit is contained in:
parent
3f3db34587
commit
7bee1c9897
2 changed files with 7 additions and 3 deletions
|
@ -310,7 +310,11 @@ WebIDL::ExceptionOr<void> HTMLInputElement::run_input_activation_behavior(DOM::E
|
||||||
// coordinate to that coordinate.
|
// coordinate to that coordinate.
|
||||||
if (event.is_trusted() && is<UIEvents::MouseEvent>(event)) {
|
if (event.is_trusted() && is<UIEvents::MouseEvent>(event)) {
|
||||||
auto const& mouse_event = static_cast<UIEvents::MouseEvent const&>(event);
|
auto const& mouse_event = static_cast<UIEvents::MouseEvent const&>(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.
|
// 4. Submit the element's form owner from the element with userInvolvement set to event's user navigation involvement.
|
||||||
|
|
|
@ -105,8 +105,8 @@ public:
|
||||||
WebIDL::ExceptionOr<void> set_size(unsigned value);
|
WebIDL::ExceptionOr<void> set_size(unsigned value);
|
||||||
|
|
||||||
struct SelectedCoordinate {
|
struct SelectedCoordinate {
|
||||||
double x { 0.0 };
|
int x { 0 };
|
||||||
double y { 0.0 };
|
int y { 0 };
|
||||||
};
|
};
|
||||||
SelectedCoordinate selected_coordinate() const { return m_selected_coordinate; }
|
SelectedCoordinate selected_coordinate() const { return m_selected_coordinate; }
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue