#include "third_party/blink/renderer/core/html/forms/form_controller.h"
#include <memory>
#include <utility>
#include "base/memory/ptr_util.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/element_traversal.h"
#include "third_party/blink/renderer/core/dom/events/scoped_event_queue.h"
#include "third_party/blink/renderer/core/html/custom/custom_element.h"
#include "third_party/blink/renderer/core/html/custom/element_internals.h"
#include "third_party/blink/renderer/core/html/forms/file_chooser.h"
#include "third_party/blink/renderer/core/html/forms/html_form_element.h"
#include "third_party/blink/renderer/core/html/forms/html_input_element.h"
#include "third_party/blink/renderer/core/html/forms/listed_element.h"
#include "third_party/blink/renderer/platform/wtf/deque.h"
#include "third_party/blink/renderer/platform/wtf/hash_table_deleted_value_type.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
namespace blink {
namespace {
inline HTMLFormElement* OwnerFormForState(const ListedElement& control) { … }
const AtomicString& ControlType(const ListedElement& control) { … }
bool IsDirtyControl(const ListedElement& control) { … }
}
void FormControlState::SerializeTo(Vector<String>& state_vector) const { … }
FormControlState FormControlState::Deserialize(
const Vector<String>& state_vector,
wtf_size_t& index) { … }
class ControlKey { … };
ControlKey::ControlKey(StringImpl* name, StringImpl* type)
: … { … }
ControlKey::~ControlKey() { … }
ControlKey::ControlKey(const ControlKey& other)
: … { … }
ControlKey& ControlKey::operator=(const ControlKey& other) { … }
void ControlKey::Ref() const { … }
void ControlKey::Deref() const { … }
inline bool operator==(const ControlKey& a, const ControlKey& b) { … }
struct ControlKeyHashTraits : SimpleClassHashTraits<ControlKey> { … };
class SavedFormState { … };
static bool IsNotFormControlTypeCharacter(UChar ch) { … }
std::unique_ptr<SavedFormState> SavedFormState::Deserialize(
const Vector<String>& state_vector,
wtf_size_t& index) { … }
void SavedFormState::SerializeTo(Vector<String>& state_vector) const { … }
void SavedFormState::AppendControlState(const AtomicString& name,
const AtomicString& type,
const FormControlState& state) { … }
FormControlState SavedFormState::TakeControlState(const AtomicString& name,
const AtomicString& type) { … }
Vector<String> SavedFormState::GetReferencedFilePaths() const { … }
class FormKeyGenerator final : public GarbageCollected<FormKeyGenerator> { … };
static inline void RecordFormStructure(const HTMLFormElement& form,
StringBuilder& builder) { … }
String FormSignature(const HTMLFormElement& form) { … }
const AtomicString& FormKeyGenerator::FormKey(const ListedElement& control) { … }
void FormKeyGenerator::WillDeleteForm(HTMLFormElement* form) { … }
DocumentState::DocumentState(Document& document) : … { … }
void DocumentState::Trace(Visitor* visitor) const { … }
void DocumentState::InvalidateControlList() { … }
const DocumentState::ControlList& DocumentState::GetControlList() { … }
static String FormStateSignature() { … }
Vector<String> DocumentState::ToStateVector() { … }
FormController::FormController(Document& document)
: … { … }
FormController::~FormController() = default;
void FormController::Trace(Visitor* visitor) const { … }
DocumentState* FormController::ControlStates() const { … }
void FormController::SetStateForNewControls(
const Vector<String>& state_vector) { … }
bool FormController::HasControlStates() const { … }
FormControlState FormController::TakeStateForControl(
const ListedElement& control) { … }
void FormController::ControlStatesFromStateVector(
const Vector<String>& state_vector,
SavedFormStateMap& map) { … }
void FormController::WillDeleteForm(HTMLFormElement* form) { … }
void FormController::RestoreControlStateFor(ListedElement& control) { … }
void FormController::RestoreControlStateIn(HTMLFormElement& form) { … }
void FormController::RestoreControlStateInternal(ListedElement& control) { … }
void FormController::RestoreControlStateOnUpgrade(ListedElement& control) { … }
void FormController::ScheduleRestore() { … }
void FormController::RestoreImmediately() { … }
void FormController::RestoreAllControlsInDocumentOrder() { … }
Vector<String> FormController::GetReferencedFilePaths(
const Vector<String>& state_vector) { … }
void FormController::InvalidateStatefulFormControlList() { … }
}