mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-06 16:19:23 +00:00
LibWeb: Allow keyboard input to alter email inputs
Previously, the`HTMLInputElement.selectinStart` and `HTMLInputElement.selectionEnd` IDL setters, and the `setRangeText()` IDL method were used when updating an input's value on keyboard input. These methods can't be used for this purpose, since selection doesn't apply to email type inputs. Therefore, this change introduces internal-use only methods that don't check whether selection applies to the given input.
This commit is contained in:
parent
79da6d48c1
commit
db24440403
Notes:
github-actions[bot]
2024-12-30 10:05:12 +00:00
Author: https://github.com/tcl3
Commit: db24440403
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3065
Reviewed-by: https://github.com/Gingeh ✅
8 changed files with 83 additions and 40 deletions
|
@ -143,12 +143,14 @@ public:
|
|||
WebIDL::ExceptionOr<void> select();
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-textarea/input-selectionstart
|
||||
Optional<WebIDL::UnsignedLong> selection_start() const;
|
||||
WebIDL::ExceptionOr<void> set_selection_start(Optional<WebIDL::UnsignedLong> const&);
|
||||
Optional<WebIDL::UnsignedLong> selection_start_binding() const;
|
||||
WebIDL::ExceptionOr<void> set_selection_start_binding(Optional<WebIDL::UnsignedLong> const&);
|
||||
WebIDL::UnsignedLong selection_start() const;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-textarea/input-selectionend
|
||||
Optional<WebIDL::UnsignedLong> selection_end() const;
|
||||
WebIDL::ExceptionOr<void> set_selection_end(Optional<WebIDL::UnsignedLong> const&);
|
||||
Optional<WebIDL::UnsignedLong> selection_end_binding() const;
|
||||
WebIDL::ExceptionOr<void> set_selection_end_binding(Optional<WebIDL::UnsignedLong> const&);
|
||||
WebIDL::UnsignedLong selection_end() const;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-textarea/input-selectiondirection
|
||||
Optional<String> selection_direction() const;
|
||||
|
@ -157,7 +159,8 @@ public:
|
|||
SelectionDirection selection_direction_state() const { return m_selection_direction; }
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-textarea/input-setrangetext
|
||||
WebIDL::ExceptionOr<void> set_range_text(String const& replacement);
|
||||
WebIDL::ExceptionOr<void> set_range_text_binding(String const& replacement);
|
||||
WebIDL::ExceptionOr<void> set_range_text_binding(String const& replacement, WebIDL::UnsignedLong start, WebIDL::UnsignedLong end, Bindings::SelectionMode = Bindings::SelectionMode::Preserve);
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue