LibWeb: Deduplicate the firing of input events in HTMLInputElement

Input elements without a defined user-interaction behavior need to fire
an input event when the user changes the element's value in some way.
This change moves the code to do this into its own function and adds
some spec text to explain what is being done.

(cherry picked from commit a3d12e569c88d0dae530657e5bddc18699fb9c9b)
This commit is contained in:
Tim Ledbetter
2024-05-18 05:45:13 +01:00
committed by Nico Weber
parent 582305fdc3
commit c219ebc0db
2 changed files with 29 additions and 36 deletions

View File

@@ -257,6 +257,8 @@ private:
void handle_readonly_attribute(Optional<String> const& value);
WebIDL::ExceptionOr<void> handle_src_attribute(String const& value);
void user_interaction_did_change_input_value();
// https://html.spec.whatwg.org/multipage/input.html#value-sanitization-algorithm
String value_sanitization_algorithm(String const&) const;