diff options
author | redoste <jub.csc@gmail.com> | 2020-09-12 14:01:21 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-09-12 15:00:39 +0200 |
commit | ad031ec5d7974a961836b7e406ea57ea58fb9fc6 (patch) | |
tree | d99c47c5f647883b37c8c4553a28c801a15efaf2 /Libraries/LibWeb | |
parent | 8d574c736397c645deb53b4997468acd069a45d3 (diff) | |
download | serenity-ad031ec5d7974a961836b7e406ea57ea58fb9fc6.zip |
LibWeb: Do not handle mouse events on disabled checkboxes
Diffstat (limited to 'Libraries/LibWeb')
-rw-r--r-- | Libraries/LibWeb/Layout/LayoutCheckBox.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Libraries/LibWeb/Layout/LayoutCheckBox.cpp b/Libraries/LibWeb/Layout/LayoutCheckBox.cpp index f1d76c3352..b63137b2b0 100644 --- a/Libraries/LibWeb/Layout/LayoutCheckBox.cpp +++ b/Libraries/LibWeb/Layout/LayoutCheckBox.cpp @@ -65,7 +65,7 @@ void LayoutCheckBox::paint(PaintContext& context, PaintPhase phase) 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; 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) { - if (!m_tracking_mouse || button != GUI::MouseButton::Left) + if (!m_tracking_mouse || button != GUI::MouseButton::Left || !node().enabled()) return; // 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) { - if (!m_tracking_mouse) + if (!m_tracking_mouse || !node().enabled()) return; bool is_inside = enclosing_int_rect(absolute_rect()).contains(position); |