FormControlInfrastructure.h 840 B

1234567891011121314151617181920212223
  1. /*
  2. * Copyright (c) 2023, Kenneth Myhra <kennethmyhra@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/XHR/FormData.h>
  8. namespace Web::HTML {
  9. struct SerializedFormData {
  10. String boundary;
  11. ByteBuffer serialized_data;
  12. };
  13. WebIDL::ExceptionOr<XHR::FormDataEntry> create_entry(JS::Realm& realm, String const& name, Variant<JS::NonnullGCPtr<FileAPI::Blob>, String> const& value, Optional<String> const& filename = {});
  14. WebIDL::ExceptionOr<Optional<Vector<XHR::FormDataEntry>>> construct_entry_list(JS::Realm&, HTMLFormElement&, JS::GCPtr<HTMLElement> submitter = nullptr, Optional<String> encoding = Optional<String> {});
  15. ErrorOr<String> normalize_line_breaks(StringView value);
  16. ErrorOr<SerializedFormData> serialize_to_multipart_form_data(Vector<XHR::FormDataEntry> const& entry_list);
  17. }