mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 21:59:07 +00:00
LibWeb: Don't move focus when setting input value
This commit is contained in:
parent
d29797f118
commit
1d9c404b8c
Notes:
github-actions[bot]
2024-09-12 09:46:32 +00:00
Author: https://github.com/Gingeh
Commit: 1d9c404b8c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1355
Reviewed-by: https://github.com/gmta ✅
Reviewed-by: https://github.com/trflynn89
7 changed files with 59 additions and 26 deletions
|
@ -122,6 +122,11 @@ private:
|
|||
bool m_parser_inserted { false };
|
||||
};
|
||||
|
||||
enum class SelectionSource {
|
||||
UI,
|
||||
DOM,
|
||||
};
|
||||
|
||||
class FormAssociatedTextControlElement : public FormAssociatedElement {
|
||||
public:
|
||||
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#concept-textarea/input-relevant-value
|
||||
|
@ -151,7 +156,7 @@ public:
|
|||
WebIDL::ExceptionOr<void> set_range_text(String const& replacement, WebIDL::UnsignedLong start, WebIDL::UnsignedLong end, Bindings::SelectionMode = Bindings::SelectionMode::Preserve);
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-textarea/input-setselectionrange
|
||||
void set_the_selection_range(Optional<WebIDL::UnsignedLong> start, Optional<WebIDL::UnsignedLong> end, SelectionDirection direction = SelectionDirection::None);
|
||||
void set_the_selection_range(Optional<WebIDL::UnsignedLong> start, Optional<WebIDL::UnsignedLong> end, SelectionDirection direction = SelectionDirection::None, SelectionSource source = SelectionSource::DOM);
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-textarea/input-setselectionrange
|
||||
WebIDL::ExceptionOr<void> set_selection_range(Optional<WebIDL::UnsignedLong> start, Optional<WebIDL::UnsignedLong> end, Optional<String> direction);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue