LibWeb: Handle input element value setting & getting closer to the spec

We should not set the 'value' attribute when an input element's value is
changed (by the user or programmatically). Instead, we should track the
value internally and mark it with a dirty flag when it is changed.
This commit is contained in:
Timothy Flynn 2022-03-22 10:55:13 -04:00 committed by Andreas Kling
parent 31b24c2b29
commit 859a75fd4c
Notes: sideshowbarker 2024-07-17 16:54:56 +09:00
2 changed files with 36 additions and 10 deletions

View file

@ -119,11 +119,15 @@ private:
// https://html.spec.whatwg.org/multipage/input.html#concept-input-checked-dirty-flag
bool m_dirty_checkedness { false };
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#concept-fe-dirty
bool m_dirty_value { false };
// https://html.spec.whatwg.org/multipage/input.html#the-input-element:legacy-pre-activation-behavior
bool m_before_legacy_pre_activation_behavior_checked { false };
RefPtr<HTMLInputElement> m_legacy_pre_activation_behavior_checked_element_in_group;
TypeAttributeState m_type { TypeAttributeState::Text };
String m_value;
};
}