mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
LibWeb: Make input type state change handling specification compliant
This change ensures that the value sanitization algorithm is run and the text cursor is set to the correct position when the type attribute of an input is changed.
This commit is contained in:
parent
2d7547921b
commit
1b74104c17
Notes:
github-actions[bot]
2024-09-10 15:13:57 +00:00
Author: https://github.com/tcl3
Commit: 1b74104c17
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1360
Reviewed-by: https://github.com/trflynn89 ✅
6 changed files with 138 additions and 13 deletions
|
@ -205,12 +205,16 @@ public:
|
|||
bool select_applies() const;
|
||||
bool selection_or_range_applies() const;
|
||||
|
||||
static bool selection_or_range_applies_for_type_state(TypeAttributeState);
|
||||
|
||||
protected:
|
||||
void selection_was_changed(size_t selection_start, size_t selection_end) override;
|
||||
|
||||
private:
|
||||
HTMLInputElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
void type_attribute_changed(TypeAttributeState old_state, TypeAttributeState new_state);
|
||||
|
||||
// ^DOM::Node
|
||||
virtual bool is_html_input_element() const final { return true; }
|
||||
|
||||
|
@ -280,6 +284,7 @@ private:
|
|||
DefaultOn,
|
||||
Filename,
|
||||
};
|
||||
static ValueAttributeMode value_attribute_mode_for_type_state(TypeAttributeState);
|
||||
ValueAttributeMode value_attribute_mode() const;
|
||||
|
||||
void update_placeholder_visibility();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue