[Datalist] Add button to TextFieldInputs with a datalist
[WebKit-https.git] / Source / WebCore / html / TextFieldInputType.h
index 34081bb..1750d1d 100644 (file)
@@ -32,6 +32,7 @@
 #pragma once
 
 #include "AutoFillButtonElement.h"
+#include "DataListButtonElement.h"
 #include "DataListSuggestionPicker.h"
 #include "DataListSuggestionsClient.h"
 #include "InputType.h"
@@ -46,7 +47,7 @@ class TextControlInnerTextElement;
 // It supports not only the types for BaseTextInputType but also type=number.
 class TextFieldInputType : public InputType, protected SpinButtonElement::SpinButtonOwner, protected AutoFillButtonElement::AutoFillButtonOwner
 #if ENABLE(DATALIST_ELEMENT)
-    , private DataListSuggestionsClient
+    , private DataListSuggestionsClient, protected DataListButtonElement::DataListButtonOwner
 #endif
 {
 protected:
@@ -64,6 +65,9 @@ protected:
     HTMLElement* innerSpinButtonElement() const final;
     HTMLElement* capsLockIndicatorElement() const final;
     HTMLElement* autoFillButtonElement() const final;
+#if ENABLE(DATALIST_ELEMENT)
+    HTMLElement* dataListButtonElement() const final;
+#endif
 
     virtual bool needsContainer() const;
     void createShadowSubtree() override;
@@ -120,6 +124,8 @@ private:
     void createAutoFillButton(AutoFillButtonType);
 
 #if ENABLE(DATALIST_ELEMENT)
+    bool isShowingList() const override;
+    void listAttributeTargetChanged() final;
     void displaySuggestions(DataListSuggestionActivationType);
     void closeSuggestions();
 
@@ -129,6 +135,9 @@ private:
     void didSelectDataListOption(const String&) final;
     void didCloseSuggestions() final;
 
+    void dataListButtonElementWasClicked() final;
+    RefPtr<DataListButtonElement> m_dataListDropdownIndicator;
+
     std::unique_ptr<DataListSuggestionPicker> m_suggestionPicker;
 #endif