LibWeb: Implement input/textarea selection APIs

For both types of elements, `.selectionStart`, `.selectionEnd`,
`.selectionDirection`, `.setSelectionRange()`, `.select()` and the
`select` event are now implemented.
This commit is contained in:
Jelle Raaijmakers 2024-08-22 15:20:24 +02:00 committed by Tim Flynn
commit 814ca3267e
Notes: github-actions[bot] 2024-08-27 11:13:02 +00:00
12 changed files with 436 additions and 142 deletions

View file

@ -2,6 +2,7 @@
* Copyright (c) 2018-2022, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2022, Adam Hodgen <ant1441@gmail.com>
* Copyright (c) 2023, Bastiaan van der Plaat <bastiaan.v.d.plaat@gmail.com>
* Copyright (c) 2024, Jelle Raaijmakers <jelle@gmta.nl>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -137,9 +138,6 @@ public:
WebIDL::ExceptionOr<bool> report_validity();
void set_custom_validity(String const&);
WebIDL::ExceptionOr<void> select();
WebIDL::ExceptionOr<void> set_selection_range(u32 start, u32 end, Optional<String> const& direction = {});
WebIDL::ExceptionOr<void> show_picker();
// ^DOM::EditableTextNodeOwner
@ -198,14 +196,9 @@ public:
bool value_as_number_applies() const;
bool step_applies() const;
bool step_up_or_down_applies() const;
bool select_applies() const;
bool selection_or_range_applies() const;
WebIDL::ExceptionOr<void> set_selection_start_for_bindings(Optional<WebIDL::UnsignedLong> const&);
Optional<WebIDL::UnsignedLong> selection_start_for_bindings() const;
WebIDL::ExceptionOr<void> set_selection_end_for_bindings(Optional<WebIDL::UnsignedLong> const&);
Optional<WebIDL::UnsignedLong> selection_end_for_bindings() const;
private:
HTMLInputElement(DOM::Document&, DOM::QualifiedName);