#include "third_party/blink/renderer/core/html/forms/html_select_list_element.h"
#include "third_party/blink/public/strings/grit/blink_strings.h"
#include "third_party/blink/renderer/core/css/properties/longhand.h"
#include "third_party/blink/renderer/core/css/properties/longhands.h"
#include "third_party/blink/renderer/core/css/resolver/style_resolver.h"
#include "third_party/blink/renderer/core/dom/events/event.h"
#include "third_party/blink/renderer/core/dom/flat_tree_traversal.h"
#include "third_party/blink/renderer/core/dom/focus_params.h"
#include "third_party/blink/renderer/core/dom/shadow_root.h"
#include "third_party/blink/renderer/core/dom/synchronous_mutation_observer.h"
#include "third_party/blink/renderer/core/dom/text.h"
#include "third_party/blink/renderer/core/events/keyboard_event.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/web_feature.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/html_button_element.h"
#include "third_party/blink/renderer/core/html/forms/html_form_element.h"
#include "third_party/blink/renderer/core/html/forms/html_listbox_element.h"
#include "third_party/blink/renderer/core/html/forms/html_opt_group_element.h"
#include "third_party/blink/renderer/core/html/forms/html_option_element.h"
#include "third_party/blink/renderer/core/html/forms/select_list_part_traversal.h"
#include "third_party/blink/renderer/core/html/html_collection.h"
#include "third_party/blink/renderer/core/html/html_div_element.h"
#include "third_party/blink/renderer/core/html/html_slot_element.h"
#include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/core/inspector/console_message.h"
#include "third_party/blink/renderer/core/keywords.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/core/style/computed_style.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/keyboard_codes.h"
#include "third_party/blink/renderer/platform/text/platform_locale.h"
#include "third_party/blink/renderer/platform/wtf/text/unicode.h"
namespace blink {
FormControlType;
namespace {
class PreviewPopoverInnerElement : public HTMLDivElement { … };
}
class HTMLSelectListElement::SelectMutationCallback
: public GarbageCollected<HTMLSelectListElement::SelectMutationCallback>,
public SynchronousMutationObserver { … };
HTMLSelectListElement::SelectMutationCallback::SelectMutationCallback(
HTMLSelectListElement& select)
: … { … }
void HTMLSelectListElement::SelectMutationCallback::Trace(
Visitor* visitor) const { … }
void HTMLSelectListElement::SelectMutationCallback::DidChangeChildren(
const ContainerNode& container,
const ContainerNode::ChildrenChange& change) { … }
void HTMLSelectListElement::SelectMutationCallback::AttributeChanged(
const Element& target,
const QualifiedName& name,
const AtomicString& old_value,
const AtomicString& new_value) { … }
template <typename StringType>
void HTMLSelectListElement::SelectMutationCallback::PartInserted(
const StringType& part_name,
HTMLElement* element) { … }
template <typename StringType>
void HTMLSelectListElement::SelectMutationCallback::PartRemoved(
const StringType& part_name,
HTMLElement* element) { … }
template <typename StringType>
void HTMLSelectListElement::SelectMutationCallback::SlotChanged(
const StringType& slot_name) { … }
HTMLSelectListElement::HTMLSelectListElement(Document& document)
: … { … }
namespace {
bool HasOptionElementDescendant(Element* element) { … }
}
void HTMLSelectListElement::ManuallyAssignSlots() { … }
HTMLSelectListElement::PartType HTMLSelectListElement::AssignedPartType(
Node* node) const { … }
const HTMLSelectListElement::ListItems& HTMLSelectListElement::GetListItems()
const { … }
void HTMLSelectListElement::DidAddUserAgentShadowRoot(ShadowRoot& root) { … }
void HTMLSelectListElement::DidMoveToNewDocument(Document& old_document) { … }
void HTMLSelectListElement::DisabledAttributeChanged() { … }
String HTMLSelectListElement::value() const { … }
void HTMLSelectListElement::setValueForBinding(const String& value) { … }
void HTMLSelectListElement::setValue(const String& value,
bool send_events,
WebAutofillState autofill_state) { … }
bool HTMLSelectListElement::open() const { … }
void HTMLSelectListElement::SetAutofillValue(const String& value,
WebAutofillState autofill_state) { … }
String HTMLSelectListElement::SuggestedValue() const { … }
void HTMLSelectListElement::SetSuggestedValue(const String& value) { … }
void HTMLSelectListElement::OpenListbox() { … }
void HTMLSelectListElement::CloseListbox() { … }
bool HTMLSelectListElement::TypeAheadFind(const KeyboardEvent& event,
int charCode) { … }
void HTMLSelectListElement::ListboxWasClosed() { … }
void HTMLSelectListElement::ResetTypeAheadSessionForTesting() { … }
bool HTMLSelectListElement::SetListboxPart(HTMLElement* new_listbox_part) { … }
bool HTMLSelectListElement::IsValidButtonPart(const Node* node,
bool show_warning) const { … }
bool HTMLSelectListElement::IsValidListboxPart(const Node* node,
bool show_warning) const { … }
bool HTMLSelectListElement::IsValidOptionPart(const Node* node,
bool show_warning) const { … }
HTMLElement* HTMLSelectListElement::FirstValidButtonPart() const { … }
void HTMLSelectListElement::SetButtonPart(HTMLElement* new_button_part) { … }
void HTMLSelectListElement::ButtonPartInserted(HTMLElement* new_button_part) { … }
void HTMLSelectListElement::ButtonPartRemoved(HTMLElement* button_part) { … }
void HTMLSelectListElement::UpdateButtonPart() { … }
void HTMLSelectListElement::EnsureButtonPartIsValid() { … }
HTMLElement* HTMLSelectListElement::FirstValidSelectedValuePart() const { … }
void HTMLSelectListElement::SelectedValuePartInserted(
HTMLElement* new_selected_value_part) { … }
void HTMLSelectListElement::SelectedValuePartRemoved(
HTMLElement* selected_value_part) { … }
void HTMLSelectListElement::UpdateSelectedValuePart() { … }
void HTMLSelectListElement::EnsureSelectedValuePartIsValid() { … }
HTMLElement* HTMLSelectListElement::FirstValidListboxPart() const { … }
void HTMLSelectListElement::ListboxPartInserted(HTMLElement* new_listbox_part) { … }
void HTMLSelectListElement::ListboxPartRemoved(HTMLElement* listbox_part) { … }
void HTMLSelectListElement::UpdateListboxPart() { … }
void HTMLSelectListElement::EnsureListboxPartIsValid() { … }
void HTMLSelectListElement::QueueCheckForMissingParts() { … }
void HTMLSelectListElement::ResetOptionParts() { … }
void HTMLSelectListElement::DispatchInputAndChangeEventsIfNeeded() { … }
void HTMLSelectListElement::OptionPartInserted(
HTMLOptionElement* new_option_part) { … }
void HTMLSelectListElement::OptionPartRemoved(HTMLOptionElement* option_part) { … }
HTMLOptionElement* HTMLSelectListElement::FirstOptionPart() const { … }
void HTMLSelectListElement::OptionSelectionStateChanged(
HTMLOptionElement* option,
bool option_is_selected) { … }
void HTMLSelectListElement::DidFinishLifecycleUpdate(
const LocalFrameView& local_frame_view) { … }
int HTMLSelectListElement::IndexOfSelectedOption() const { … }
int HTMLSelectListElement::OptionCount() const { … }
String HTMLSelectListElement::OptionAtIndex(int index) const { … }
HTMLOptionElement* HTMLSelectListElement::selectedOption() const { … }
void HTMLSelectListElement::SetSelectedOption(
HTMLOptionElement* selected_option,
bool send_events,
WebAutofillState autofill_state) { … }
void HTMLSelectListElement::OptionElementChildrenChanged(
const HTMLOptionElement& option) { … }
void HTMLSelectListElement::OptionElementValueChanged(
const HTMLOptionElement& option) { … }
void HTMLSelectListElement::SelectNextOption() { … }
void HTMLSelectListElement::SelectPreviousOption() { … }
void HTMLSelectListElement::SetSuggestedOption(HTMLOptionElement* option) { … }
void HTMLSelectListElement::UpdateSelectedValuePartContents() { … }
void HTMLSelectListElement::RecalcListItems() const { … }
HTMLOptionElement* HTMLSelectListElement::OptionAtListIndex(
int list_index) const { … }
void HTMLSelectListElement::ButtonPartEventListener::Invoke(ExecutionContext*,
Event* event) { … }
void HTMLSelectListElement::HandleButtonEvent(Event& event) { … }
void HTMLSelectListElement::ButtonPartEventListener::AddEventListeners(
HTMLElement* button_part) { … }
void HTMLSelectListElement::ButtonPartEventListener::RemoveEventListeners(
HTMLElement* button_part) { … }
bool HTMLSelectListElement::HandleButtonKeyboardEvent(KeyboardEvent& event) { … }
void HTMLSelectListElement::OptionPartEventListener::Invoke(ExecutionContext*,
Event* event) { … }
void HTMLSelectListElement::OptionPartEventListener::AddEventListeners(
HTMLOptionElement* option_part) { … }
void HTMLSelectListElement::OptionPartEventListener::RemoveEventListeners(
HTMLOptionElement* option_part) { … }
bool HTMLSelectListElement::OptionPartEventListener::HandleKeyboardEvent(
const KeyboardEvent& event) { … }
FormControlType HTMLSelectListElement::FormControlType() const { … }
const AtomicString& HTMLSelectListElement::FormControlTypeAsString() const { … }
void HTMLSelectListElement::DefaultEventHandler(Event& event) { … }
bool HTMLSelectListElement::MayTriggerVirtualKeyboard() const { … }
void HTMLSelectListElement::AppendToFormData(FormData& form_data) { … }
FormControlState HTMLSelectListElement::SaveFormControlState() const { … }
void HTMLSelectListElement::RestoreFormControlState(
const FormControlState& state) { … }
bool HTMLSelectListElement::IsRequiredFormControl() const { … }
bool HTMLSelectListElement::IsOptionalFormControl() const { … }
bool HTMLSelectListElement::IsLabelable() const { … }
bool HTMLSelectListElement::ValueMissing() const { … }
void HTMLSelectListElement::CloneNonAttributePropertiesFrom(
const Element& source,
NodeCloningData& data) { … }
void HTMLSelectListElement::ResetImpl() { … }
void HTMLSelectListElement::ResetToDefaultSelection() { … }
String HTMLSelectListElement::validationMessage() const { … }
void HTMLSelectListElement::Trace(Visitor* visitor) const { … }
constexpr char HTMLSelectListElement::kButtonPartName[];
constexpr char HTMLSelectListElement::kSelectedValuePartName[];
constexpr char HTMLSelectListElement::kListboxPartName[];
}