mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02:00
LibWeb: Fire textarea input events immediately instead of debouncing
The 100ms debounce timer on textarea input events causes character
loss when JavaScript restores a previously captured value via
requestAnimationFrame. The text node mutation happens immediately
during input processing, but the input DOM event is delayed,
creating a window where stale rAF callbacks overwrite new input.
Remove the debounce timer and fire the input event immediately
via queue_an_element_task, matching HTMLInputElement behavior.
The spec notes this delay is optional ("User agents may wait").
Fixes #7793.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Notes:
github-actions[bot]
2026-03-30 17:18:58 +00:00
Author: https://github.com/exec Commit: https://github.com/LadybirdBrowser/ladybird/commit/c710ff5afa8 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8642 Reviewed-by: https://github.com/trflynn89 ✅
@@ -164,8 +164,6 @@ private:
|
||||
|
||||
void handle_maxlength_attribute();
|
||||
|
||||
void queue_firing_input_event();
|
||||
|
||||
void update_placeholder_visibility();
|
||||
|
||||
GC::Ptr<DOM::Element> m_placeholder_element;
|
||||
@@ -174,10 +172,6 @@ private:
|
||||
GC::Ptr<DOM::Element> m_inner_text_element;
|
||||
GC::Ptr<DOM::Text> m_text_node;
|
||||
|
||||
RefPtr<Core::Timer> m_input_event_timer;
|
||||
FlyString m_pending_input_event_type;
|
||||
Optional<Utf16String> m_pending_input_event_data;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#concept-fe-dirty
|
||||
bool m_dirty_value { false };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user