1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:38:12 +00:00

LibWeb: Update the stored textarea value upon change

And fire the "input" event upon change. This is needed to submit a
comment on GitHub; otherwise, GitHub thinks the textarea value is empty.
This commit is contained in:
Timothy Flynn 2024-03-06 15:14:20 -05:00 committed by Alexander Kalenik
parent 50d3f85f75
commit ed13793110
4 changed files with 39 additions and 0 deletions

View file

@ -12,6 +12,7 @@
#include <LibWeb/DOM/Text.h>
#include <LibWeb/HTML/FormAssociatedElement.h>
#include <LibWeb/HTML/HTMLElement.h>
#include <LibWeb/Platform/Timer.h>
#include <LibWeb/WebIDL/Types.h>
namespace Web::HTML {
@ -109,6 +110,8 @@ private:
void handle_readonly_attribute(Optional<String> const& value);
void handle_maxlength_attribute();
void queue_firing_input_event();
void update_placeholder_visibility();
JS::GCPtr<DOM::Element> m_placeholder_element;
JS::GCPtr<DOM::Text> m_placeholder_text_node;
@ -116,6 +119,8 @@ private:
JS::GCPtr<DOM::Element> m_inner_text_element;
JS::GCPtr<DOM::Text> m_text_node;
RefPtr<Web::Platform::Timer> m_input_event_timer;
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#concept-fe-dirty
bool m_dirty_value { false };