1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:17:36 +00:00

LibWeb: Fix up constructing the form entry list

In particular:
- Don't include none submitter buttons.
- Use type_state() instead type() to avoid direct string comparisons
- Support the hidden _charset_ input
- Get form associated element's value directly instead of via the value
  attribute
- Split line break normalization into a separate function so that it
  can also be used by form submission.
This commit is contained in:
Luke Wilde 2023-06-18 15:08:15 +01:00 committed by Andreas Kling
parent f154446a9f
commit c9c1ddd0bb
8 changed files with 101 additions and 30 deletions

View file

@ -6,6 +6,7 @@
#pragma once
#include <AK/DeprecatedString.h>
#include <AK/WeakPtr.h>
#include <LibWeb/Forward.h>
@ -63,6 +64,14 @@ public:
// https://html.spec.whatwg.org/multipage/forms.html#category-autocapitalize
virtual bool is_auto_capitalize_inheriting() const { return false; }
// https://html.spec.whatwg.org/multipage/forms.html#concept-button
virtual bool is_button() const { return false; }
// https://html.spec.whatwg.org/multipage/forms.html#concept-submit-button
virtual bool is_submit_button() const { return false; }
virtual DeprecatedString value() const { return DeprecatedString::empty(); }
virtual HTMLElement& form_associated_element_to_html_element() = 0;
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#concept-form-reset-control