chromium/third_party/blink/renderer/core/html/forms/html_form_element.cc

/*
 * Copyright (C) 1999 Lars Knoll ([email protected])
 *           (C) 1999 Antti Koivisto ([email protected])
 *           (C) 2001 Dirk Mueller ([email protected])
 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
 * reserved.
 *           (C) 2006 Alexey Proskuryakov ([email protected])
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public License
 * along with this library; see the file COPYING.LIB.  If not, write to
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 *
 */

#include "third_party/blink/renderer/core/html/forms/html_form_element.h"

#include <limits>

#include "base/auto_reset.h"
#include "third_party/blink/public/common/security_context/insecure_request_policy.h"
#include "third_party/blink/public/mojom/security_context/insecure_request_policy.mojom-blink.h"
#include "third_party/blink/public/web/web_form_related_change_type.h"
#include "third_party/blink/renderer/bindings/core/v8/script_controller.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_submit_event_init.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_union_element_radionodelist.h"
#include "third_party/blink/renderer/core/dom/attribute.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/event.h"
#include "third_party/blink/renderer/core/dom/events/scoped_event_queue.h"
#include "third_party/blink/renderer/core/dom/node_lists_node_data.h"
#include "third_party/blink/renderer/core/dom/shadow_root.h"
#include "third_party/blink/renderer/core/frame/csp/content_security_policy.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/local_frame_client.h"
#include "third_party/blink/renderer/core/frame/remote_frame.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/form_controller.h"
#include "third_party/blink/renderer/core/html/forms/form_data.h"
#include "third_party/blink/renderer/core/html/forms/form_data_event.h"
#include "third_party/blink/renderer/core/html/forms/html_form_controls_collection.h"
#include "third_party/blink/renderer/core/html/forms/html_input_element.h"
#include "third_party/blink/renderer/core/html/forms/radio_node_list.h"
#include "third_party/blink/renderer/core/html/forms/submit_event.h"
#include "third_party/blink/renderer/core/html/html_collection.h"
#include "third_party/blink/renderer/core/html/html_dialog_element.h"
#include "third_party/blink/renderer/core/html/html_image_element.h"
#include "third_party/blink/renderer/core/html/html_object_element.h"
#include "third_party/blink/renderer/core/html/rel_list.h"
#include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/core/input_type_names.h"
#include "third_party/blink/renderer/core/inspector/console_message.h"
#include "third_party/blink/renderer/core/layout/layout_object.h"
#include "third_party/blink/renderer/core/loader/form_submission.h"
#include "third_party/blink/renderer/core/loader/mixed_content_checker.h"
#include "third_party/blink/renderer/core/page/chrome_client.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/wtf/text/atomic_string.h"

namespace blink {

FormControlType;

namespace {

// Invalidates the cache of all form elements that are ancestors of
// `starting_node` or `starting_node` itself.
void InvalidateShadowIncludingAncestorForms(ContainerNode* starting_node) {}

}  // namespace

HTMLFormElement::HTMLFormElement(Document& document)
    :{}

HTMLFormElement::~HTMLFormElement() = default;

void HTMLFormElement::Trace(Visitor* visitor) const {}

bool HTMLFormElement::MatchesValidityPseudoClasses() const {}

bool HTMLFormElement::IsValidElement() {}

Node::InsertionNotificationRequest HTMLFormElement::InsertedInto(
    ContainerNode& insertion_point) {}

template <class T>
void NotifyFormRemovedFromTree(const T& elements, Node& root) {}

void HTMLFormElement::RemovedFrom(ContainerNode& insertion_point) {}

void HTMLFormElement::HandleLocalEvents(Event& event) {}

unsigned HTMLFormElement::length() const {}

HTMLElement* HTMLFormElement::item(unsigned index) {}

void HTMLFormElement::SubmitImplicitly(const Event& event,
                                       bool from_implicit_submission_trigger) {}

bool HTMLFormElement::ValidateInteractively() {}

void HTMLFormElement::PrepareForSubmission(
    const Event* event,
    HTMLFormControlElement* submit_button) {}

void HTMLFormElement::submitFromJavaScript() {}

void HTMLFormElement::requestSubmit(ExceptionState& exception_state) {}

// https://html.spec.whatwg.org/multipage/forms.html#dom-form-requestsubmit
void HTMLFormElement::requestSubmit(HTMLElement* submitter,
                                    ExceptionState& exception_state) {}

void HTMLFormElement::SubmitDialog(FormSubmission* form_submission) {}

void HTMLFormElement::ScheduleFormSubmission(
    const Event* event,
    HTMLFormControlElement* submit_button) {}

FormData* HTMLFormElement::ConstructEntryList(
    HTMLFormControlElement* submit_button,
    const WTF::TextEncoding& encoding) {}

void HTMLFormElement::reset() {}

void HTMLFormElement::AttachLayoutTree(AttachContext& context) {}

void HTMLFormElement::DetachLayoutTree(bool performing_reattach) {}

void HTMLFormElement::ParseAttribute(
    const AttributeModificationParams& params) {}

void HTMLFormElement::Associate(ListedElement& e) {}

void HTMLFormElement::Disassociate(ListedElement& e) {}

bool HTMLFormElement::IsURLAttribute(const Attribute& attribute) const {}

bool HTMLFormElement::HasLegalLinkAttribute(const QualifiedName& name) const {}

void HTMLFormElement::Associate(HTMLImageElement& e) {}

void HTMLFormElement::Disassociate(HTMLImageElement& e) {}

void HTMLFormElement::DidAssociateByParser() {}

HTMLFormControlsCollection* HTMLFormElement::elements() {}

void HTMLFormElement::CollectListedElements(
    const Node* root,
    ListedElement::List& elements,
    ListedElement::List* elements_including_shadow_trees,
    bool in_shadow_tree) const {}

// This function should be const conceptually. However we update some fields
// because of lazy evaluation.
const ListedElement::List& HTMLFormElement::ListedElements(
    bool include_shadow_trees) const {}

void HTMLFormElement::CollectImageElements(
    Node& root,
    HeapVector<Member<HTMLImageElement>>& elements) {}

const HeapVector<Member<HTMLImageElement>>& HTMLFormElement::ImageElements() {}

String HTMLFormElement::GetName() const {}

bool HTMLFormElement::NoValidate() const {}

String HTMLFormElement::action() const {}

void HTMLFormElement::setAction(const AtomicString& value) {}

void HTMLFormElement::setEnctype(const AtomicString& value) {}

String HTMLFormElement::method() const {}

void HTMLFormElement::setMethod(const AtomicString& value) {}

HTMLFormControlElement* HTMLFormElement::FindDefaultButton() const {}

bool HTMLFormElement::checkValidity() {}

bool HTMLFormElement::CheckInvalidControlsAndCollectUnhandled(
    ListedElement::List* unhandled_invalid_controls) {}

bool HTMLFormElement::reportValidity() {}

Element* HTMLFormElement::ElementFromPastNamesMap(
    const AtomicString& past_name) {}

void HTMLFormElement::AddToPastNamesMap(Element* element,
                                        const AtomicString& past_name) {}

void HTMLFormElement::RemoveFromPastNamesMap(HTMLElement& element) {}

void HTMLFormElement::GetNamedElements(
    const AtomicString& name,
    HeapVector<Member<Element>>& named_items) {}

bool HTMLFormElement::HasNamedElements(const AtomicString& name) {}

bool HTMLFormElement::ShouldAutocomplete() const {}

DOMTokenList& HTMLFormElement::relList() const {}

bool HTMLFormElement::HasRel(RelAttribute relation) const {}

void HTMLFormElement::FinishParsingChildren() {}

V8UnionElementOrRadioNodeList* HTMLFormElement::AnonymousNamedGetter(
    const AtomicString& name) {}

bool HTMLFormElement::NamedPropertyQuery(const AtomicString& name,
                                         ExceptionState&) {}

void HTMLFormElement::InvalidateDefaultButtonStyle() const {}

void HTMLFormElement::InvalidateListedElementsIncludingShadowTrees() {}

void HTMLFormElement::UseCountPropertyAccess(
    v8::Local<v8::Name>& v8_property_name,
    const v8::PropertyCallbackInfo<v8::Value>& info) {}

}  // namespace blink