mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-30 13:19:47 +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:
@@ -204,6 +204,8 @@ public:
|
||||
WebIDL::ExceptionOr<void> set_selection_end_for_bindings(Optional<WebIDL::UnsignedLong> const&);
|
||||
Optional<WebIDL::UnsignedLong> selection_end_for_bindings() const;
|
||||
|
||||
virtual bool is_child_node_selectable(DOM::Node const&) const override;
|
||||
|
||||
private:
|
||||
HTMLInputElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user