| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef BaseTextInputType_h | 31 #ifndef BaseTextInputType_h |
| 32 #define BaseTextInputType_h | 32 #define BaseTextInputType_h |
| 33 | 33 |
| 34 #include "core/html/forms/TextFieldInputType.h" | 34 #include "core/html/forms/TextFieldInputType.h" |
| 35 | 35 |
| 36 namespace blink { | 36 namespace blink { |
| 37 | 37 |
| 38 class ScriptRegexp; |
| 39 |
| 38 // Base of email, password, search, tel, text, and URL types. | 40 // Base of email, password, search, tel, text, and URL types. |
| 39 // They support maxlength, selection functions, and so on. | 41 // They support maxlength, selection functions, and so on. |
| 40 class BaseTextInputType : public TextFieldInputType { | 42 class BaseTextInputType : public TextFieldInputType { |
| 41 protected: | 43 protected: |
| 42 BaseTextInputType(HTMLInputElement& element) : TextFieldInputType(element) {
} | 44 BaseTextInputType(HTMLInputElement&); |
| 45 ~BaseTextInputType() override; |
| 43 | 46 |
| 44 private: | 47 private: |
| 45 bool tooLong(const String&, HTMLTextFormControlElement::NeedsToCheckDirtyFla
g) const final; | 48 bool tooLong(const String&, HTMLTextFormControlElement::NeedsToCheckDirtyFla
g) const final; |
| 46 bool tooShort(const String&, HTMLTextFormControlElement::NeedsToCheckDirtyFl
ag) const final; | 49 bool tooShort(const String&, HTMLTextFormControlElement::NeedsToCheckDirtyFl
ag) const final; |
| 47 int maxLength() const final; | 50 int maxLength() const final; |
| 48 int minLength() const final; | 51 int minLength() const final; |
| 49 bool patternMismatch(const String&) const final; | 52 bool patternMismatch(const String&) const final; |
| 50 bool supportsPlaceholder() const final; | 53 bool supportsPlaceholder() const final; |
| 51 bool supportsSelectionAPI() const override; | 54 bool supportsSelectionAPI() const override; |
| 52 bool supportsAutocapitalize() const override; | 55 bool supportsAutocapitalize() const override; |
| 56 |
| 57 // m_regexp and m_patternForRegexp are mutable because they are kinds of |
| 58 // cache. |
| 59 mutable std::unique_ptr<ScriptRegexp> m_regexp; |
| 60 mutable AtomicString m_patternForRegexp; |
| 53 }; | 61 }; |
| 54 | 62 |
| 55 } // namespace blink | 63 } // namespace blink |
| 56 | 64 |
| 57 #endif // BaseTextInputType_h | 65 #endif // BaseTextInputType_h |
| OLD | NEW |