mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 00:15:08 +00:00
LibWeb: Do not handle mouse events on disabled checkboxes
This commit is contained in:
parent
8d574c7363
commit
ad031ec5d7
1 changed files with 3 additions and 3 deletions
|
@ -65,7 +65,7 @@ void LayoutCheckBox::paint(PaintContext& context, PaintPhase phase)
|
||||||
|
|
||||||
void LayoutCheckBox::handle_mousedown(Badge<EventHandler>, const Gfx::IntPoint&, unsigned button, unsigned)
|
void LayoutCheckBox::handle_mousedown(Badge<EventHandler>, const Gfx::IntPoint&, unsigned button, unsigned)
|
||||||
{
|
{
|
||||||
if (button != GUI::MouseButton::Left)
|
if (button != GUI::MouseButton::Left || !node().enabled())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_being_pressed = true;
|
m_being_pressed = true;
|
||||||
|
@ -77,7 +77,7 @@ void LayoutCheckBox::handle_mousedown(Badge<EventHandler>, const Gfx::IntPoint&,
|
||||||
|
|
||||||
void LayoutCheckBox::handle_mouseup(Badge<EventHandler>, const Gfx::IntPoint& position, unsigned button, unsigned)
|
void LayoutCheckBox::handle_mouseup(Badge<EventHandler>, const Gfx::IntPoint& position, unsigned button, unsigned)
|
||||||
{
|
{
|
||||||
if (!m_tracking_mouse || button != GUI::MouseButton::Left)
|
if (!m_tracking_mouse || button != GUI::MouseButton::Left || !node().enabled())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// NOTE: Changing the checked state of the DOM node may run arbitrary JS, which could disappear this node.
|
// NOTE: Changing the checked state of the DOM node may run arbitrary JS, which could disappear this node.
|
||||||
|
@ -94,7 +94,7 @@ void LayoutCheckBox::handle_mouseup(Badge<EventHandler>, const Gfx::IntPoint& po
|
||||||
|
|
||||||
void LayoutCheckBox::handle_mousemove(Badge<EventHandler>, const Gfx::IntPoint& position, unsigned, unsigned)
|
void LayoutCheckBox::handle_mousemove(Badge<EventHandler>, const Gfx::IntPoint& position, unsigned, unsigned)
|
||||||
{
|
{
|
||||||
if (!m_tracking_mouse)
|
if (!m_tracking_mouse || !node().enabled())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bool is_inside = enclosing_int_rect(absolute_rect()).contains(position);
|
bool is_inside = enclosing_int_rect(absolute_rect()).contains(position);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue