/* * Copyright (c) 2025, Altomani Gianluca * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include namespace Web::HTML { #define AUTOCOMPLETE_ELEMENT(ElementBaseClass, ElementClass) \ private: \ virtual HTMLElement& autocomplete_element_to_html_element() override \ { \ static_assert(IsBaseOf); \ static_assert(IsBaseOf); \ return *this; \ } class AutocompleteElement { public: enum class AutofillMantle { Anchor, Expectation, }; AutofillMantle get_autofill_mantle() const; Vector autocomplete_tokens() const; String autocomplete() const; WebIDL::ExceptionOr set_autocomplete(String const&); // Each input element to which the autocomplete attribute applies [...] has // an autofill hint set, an autofill scope, an autofill field name, // a non-autofill credential type, and an IDL-exposed autofill value. struct AttributeDetails { Vector hint_set; Vector scope; String field_name; Optional credential_type; String value; }; AttributeDetails parse_autocomplete_attribute() const; virtual HTMLElement& autocomplete_element_to_html_element() = 0; HTMLElement const& autocomplete_element_to_html_element() const { return const_cast(*this).autocomplete_element_to_html_element(); } protected: AutocompleteElement() = default; virtual ~AutocompleteElement() = default; }; }