TextFieldInputType.h [plain text]
#ifndef TextFieldInputType_h
#define TextFieldInputType_h
#include "AutoFillButtonElement.h"
#include "InputType.h"
#include "SpinButtonElement.h"
namespace WebCore {
class FormDataList;
class TextControlInnerTextElement;
class TextFieldInputType : public InputType, protected SpinButtonElement::SpinButtonOwner, protected AutoFillButtonElement::AutoFillButtonOwner {
protected:
explicit TextFieldInputType(HTMLInputElement&);
virtual ~TextFieldInputType();
void handleKeydownEvent(KeyboardEvent*) override;
void handleKeydownEventForSpinButton(KeyboardEvent*);
HTMLElement* containerElement() const final;
HTMLElement* innerBlockElement() const final;
TextControlInnerTextElement* innerTextElement() const final;
HTMLElement* innerSpinButtonElement() const final;
HTMLElement* capsLockIndicatorElement() const final;
HTMLElement* autoFillButtonElement() const final;
protected:
virtual bool needsContainer() const;
void createShadowSubtree() override;
void destroyShadowSubtree() override;
void attributeChanged() final;
void disabledAttributeChanged() final;
void readonlyAttributeChanged() final;
bool supportsReadOnly() const final;
void handleFocusEvent(Node* oldFocusedNode, FocusDirection) final;
void handleBlurEvent() final;
void setValue(const String&, bool valueChanged, TextFieldEventBehavior) override;
void updateInnerTextValue() final;
String sanitizeValue(const String&) const override;
virtual String convertFromVisibleValue(const String&) const;
virtual void didSetValueByUserEdit();
private:
bool isKeyboardFocusable(KeyboardEvent*) const final;
bool isMouseFocusable() const final;
bool isTextField() const final;
bool isEmptyValue() const final;
bool valueMissing(const String&) const final;
void handleBeforeTextInsertedEvent(BeforeTextInsertedEvent*) final;
void forwardEvent(Event*) final;
bool shouldSubmitImplicitly(Event*) final;
RenderPtr<RenderElement> createInputRenderer(RenderStyle&&) override;
bool shouldUseInputMethod() const override;
bool shouldRespectListAttribute() override;
HTMLElement* placeholderElement() const final;
void updatePlaceholderText() final;
bool appendFormData(FormDataList&, bool multipart) const final;
void subtreeHasChanged() final;
void capsLockStateMayHaveChanged() final;
void updateAutoFillButton() final;
void focusAndSelectSpinButtonOwner() final;
bool shouldSpinButtonRespondToMouseEvents() final;
bool shouldSpinButtonRespondToWheelEvents() final;
void spinButtonStepDown() final;
void spinButtonStepUp() final;
void autoFillButtonElementWasClicked() final;
bool shouldHaveSpinButton() const;
bool shouldHaveCapsLockIndicator() const;
bool shouldDrawCapsLockIndicator() const;
bool shouldDrawAutoFillButton() const;
void createContainer();
void createAutoFillButton(AutoFillButtonType);
RefPtr<HTMLElement> m_container;
RefPtr<HTMLElement> m_innerBlock;
RefPtr<TextControlInnerTextElement> m_innerText;
RefPtr<HTMLElement> m_placeholder;
RefPtr<SpinButtonElement> m_innerSpinButton;
RefPtr<HTMLElement> m_capsLockIndicator;
RefPtr<HTMLElement> m_autoFillButton;
};
}
#endif // TextFieldInputType_h