LibWeb: Send InputEvent with right .inputType on insert and delete

Applies to `<input>` and `<textarea>`. Editing commands in
`contenteditable` already sent the right events and input types.

Fixes #7668
This commit is contained in:
Jelle Raaijmakers
2026-01-29 09:54:27 +01:00
committed by Jelle Raaijmakers
parent c9108a2ad5
commit e05503dbcb
Notes: github-actions[bot] 2026-02-06 10:55:26 +00:00
12 changed files with 133 additions and 58 deletions

View File

@@ -2,7 +2,7 @@
* Copyright (c) 2020, the SerenityOS developers.
* Copyright (c) 2022, Luke Wilde <lukew@serenityos.org>
* Copyright (c) 2024, Bastiaan van der Plaat <bastiaan.v.d.plaat@gmail.com>
* Copyright (c) 2024, Jelle Raaijmakers <jelle@ladybird.org>
* Copyright (c) 2024-2026, Jelle Raaijmakers <jelle@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -125,7 +125,7 @@ public:
void set_dirty_value_flag(Badge<FormAssociatedElement>, bool flag) { m_dirty_value = flag; }
// ^FormAssociatedTextControlElement
virtual void did_edit_text_node() override;
virtual void did_edit_text_node(FlyString const& input_type) override;
virtual GC::Ptr<DOM::Text> form_associated_element_to_text_node() override { return m_text_node; }
// https://html.spec.whatwg.org/multipage/form-elements.html#the-textarea-element%3Asuffering-from-being-missing
@@ -164,6 +164,7 @@ private:
GC::Ptr<DOM::Text> m_text_node;
RefPtr<Core::Timer> m_input_event_timer;
FlyString m_pending_input_event_type;
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#concept-fe-dirty
bool m_dirty_value { false };