diff options
Diffstat (limited to 'Source/WebCore/html/FormAssociatedElement.h')
-rw-r--r-- | Source/WebCore/html/FormAssociatedElement.h | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/Source/WebCore/html/FormAssociatedElement.h b/Source/WebCore/html/FormAssociatedElement.h index ec9424064..66001504e 100644 --- a/Source/WebCore/html/FormAssociatedElement.h +++ b/Source/WebCore/html/FormAssociatedElement.h @@ -21,8 +21,7 @@ * */ -#ifndef FormAssociatedElement_h -#define FormAssociatedElement_h +#pragma once #include "FormNamedItem.h" #include <wtf/text/WTFString.h> @@ -72,27 +71,28 @@ public: bool badInput() const { return hasBadInput(); } bool customError() const; - // Implementations of patternMismatch, rangeOverflow, rangerUnderflow, stepMismatch, tooLong and valueMissing must call willValidate. + // Implementations of patternMismatch, rangeOverflow, rangerUnderflow, stepMismatch, tooShort, tooLong and valueMissing must call willValidate. virtual bool hasBadInput() const; virtual bool patternMismatch() const; virtual bool rangeOverflow() const; virtual bool rangeUnderflow() const; virtual bool stepMismatch() const; + virtual bool tooShort() const; virtual bool tooLong() const; virtual bool typeMismatch() const; virtual bool valueMissing() const; virtual String validationMessage() const; - bool valid() const; + virtual bool isValid() const; virtual void setCustomValidity(const String&); void formAttributeTargetChanged(); protected: - FormAssociatedElement(); + FormAssociatedElement(HTMLFormElement*); void insertedInto(ContainerNode&); void removedFrom(ContainerNode&); - void didMoveToNewDocument(Document* oldDocument); + void didMoveToNewDocument(Document& oldDocument); void setForm(HTMLFormElement*); void formAttributeChanged(); @@ -106,21 +106,18 @@ protected: String customValidationMessage() const; private: + virtual bool willValidate() const = 0; virtual void refFormAssociatedElement() = 0; virtual void derefFormAssociatedElement() = 0; void resetFormAttributeTargetObserver(); - virtual bool isFormAssociatedElement() const override final { return true; } + bool isFormAssociatedElement() const final { return true; } std::unique_ptr<FormAttributeTargetObserver> m_formAttributeTargetObserver; HTMLFormElement* m_form; + HTMLFormElement* m_formSetByParser; String m_customValidationMessage; }; -#define FORM_ASSOCIATED_ELEMENT_TYPE_CASTS(ToClassName, predicate) \ - TYPE_CASTS_BASE(ToClassName, FormAssociatedElement, element, element->predicate, element.predicate) - } // namespace - -#endif // FormAssociatedElement_h |