LibWeb: Remove unnecessary const_casts from TextPaintable

This commit is contained in:
Jelle Raaijmakers 2025-01-31 11:12:20 +01:00 committed by Andreas Kling
parent cbe78454fc
commit e7add9abc6
Notes: github-actions[bot] 2025-01-31 12:38:14 +00:00

View file

@ -36,7 +36,7 @@ TextPaintable::DispatchEventOfSameName TextPaintable::handle_mousedown(Badge<Eve
if (!label)
return DispatchEventOfSameName::No;
const_cast<Layout::Label*>(label)->handle_mousedown_on_label({}, position, button);
const_cast<HTML::Navigable&>(*navigable()).event_handler().set_mouse_event_tracking_paintable(this);
navigable()->event_handler().set_mouse_event_tracking_paintable(this);
return DispatchEventOfSameName::Yes;
}
@ -47,7 +47,7 @@ TextPaintable::DispatchEventOfSameName TextPaintable::handle_mouseup(Badge<Event
return DispatchEventOfSameName::No;
const_cast<Layout::Label*>(label)->handle_mouseup_on_label({}, position, button);
const_cast<HTML::Navigable&>(*navigable()).event_handler().set_mouse_event_tracking_paintable(nullptr);
navigable()->event_handler().set_mouse_event_tracking_paintable(nullptr);
return DispatchEventOfSameName::Yes;
}