mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibWeb: Change where content selection via mouse is allowed
Previously, only DOM nodes with `is_editable()` allowed selection via the mouse. This had the unwanted consequence, that read-only input/textarea elements did not allow selection. Now, `EventHandler::handle_mousedown()` asks the node's non-shadow parent element over the new virtual method `is_child_node_selectable()`, if selection of the node is allowed. This method is overridden for `HTMLButtonElement` and `HTMLInputElement`, to disallow selection of buttons and placeholders. Fixes #579
This commit is contained in:
parent
a2e4259099
commit
6c9adf3dbc
Notes:
github-actions[bot]
2024-08-23 08:31:56 +00:00
Author: https://github.com/simonkrauter
Commit: 6c9adf3dbc
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1125
Reviewed-by: https://github.com/AtkinsSJ
5 changed files with 24 additions and 3 deletions
|
@ -70,6 +70,8 @@ public:
|
|||
virtual bool has_activation_behavior() const override;
|
||||
virtual void activation_behavior(DOM::Event const&) override;
|
||||
|
||||
virtual bool is_child_node_selectable(DOM::Node const&) const override { return false; }
|
||||
|
||||
private:
|
||||
virtual bool is_html_button_element() const override { return true; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue