| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights |
| 6 * reserved. | 6 * reserved. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| 11 * version 2 of the License, or (at your option) any later version. | 11 * version 2 of the License, or (at your option) any later version. |
| 12 * | 12 * |
| 13 * This library is distributed in the hope that it will be useful, | 13 * This library is distributed in the hope that it will be useful, |
| 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 * Library General Public License for more details. | 16 * Library General Public License for more details. |
| 17 * | 17 * |
| 18 * You should have received a copy of the GNU Library General Public License | 18 * You should have received a copy of the GNU Library General Public License |
| 19 * along with this library; see the file COPYING.LIB. If not, write to | 19 * along with this library; see the file COPYING.LIB. If not, write to |
| 20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 21 * Boston, MA 02110-1301, USA. | 21 * Boston, MA 02110-1301, USA. |
| 22 * | 22 * |
| 23 */ | 23 */ |
| 24 | 24 |
| 25 #ifndef HTMLFormControlElement_h | 25 #ifndef HTMLFormControlElement_h |
| 26 #define HTMLFormControlElement_h | 26 #define HTMLFormControlElement_h |
| 27 | 27 |
| 28 #include "core/CoreExport.h" | 28 #include "core/CoreExport.h" |
| 29 #include "core/html/FormAssociated.h" |
| 29 #include "core/html/LabelableElement.h" | 30 #include "core/html/LabelableElement.h" |
| 30 #include "core/html/ListedElement.h" | 31 #include "core/html/ListedElement.h" |
| 31 | 32 |
| 32 namespace blink { | 33 namespace blink { |
| 33 | 34 |
| 34 class HTMLFormElement; | 35 class HTMLFormElement; |
| 35 class ValidationMessageClient; | 36 class ValidationMessageClient; |
| 36 | 37 |
| 37 enum CheckValidityEventBehavior { | 38 enum CheckValidityEventBehavior { |
| 38 CheckValidityDispatchNoEvent, | 39 CheckValidityDispatchNoEvent, |
| 39 CheckValidityDispatchInvalidEvent | 40 CheckValidityDispatchInvalidEvent |
| 40 }; | 41 }; |
| 41 | 42 |
| 42 // HTMLFormControlElement is the default implementation of | 43 // HTMLFormControlElement is the default implementation of |
| 43 // ListedElement, and listed element implementations should use | 44 // ListedElement, and listed element implementations should use |
| 44 // HTMLFormControlElement unless there is a special reason. | 45 // HTMLFormControlElement unless there is a special reason. |
| 45 class CORE_EXPORT HTMLFormControlElement : public LabelableElement, | 46 class CORE_EXPORT HTMLFormControlElement : public LabelableElement, |
| 46 public ListedElement { | 47 public ListedElement, |
| 48 public FormAssociated { |
| 47 USING_GARBAGE_COLLECTED_MIXIN(HTMLFormControlElement); | 49 USING_GARBAGE_COLLECTED_MIXIN(HTMLFormControlElement); |
| 48 | 50 |
| 49 public: | 51 public: |
| 50 ~HTMLFormControlElement() override; | 52 ~HTMLFormControlElement() override; |
| 51 DECLARE_VIRTUAL_TRACE(); | 53 DECLARE_VIRTUAL_TRACE(); |
| 52 | 54 |
| 53 String formAction() const; | 55 String formAction() const; |
| 54 void setFormAction(const AtomicString&); | 56 void setFormAction(const AtomicString&); |
| 55 String formEnctype() const; | 57 String formEnctype() const; |
| 56 void setFormEnctype(const AtomicString&); | 58 void setFormEnctype(const AtomicString&); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 | 122 |
| 121 bool isAutofilled() const { return m_isAutofilled; } | 123 bool isAutofilled() const { return m_isAutofilled; } |
| 122 void setAutofilled(bool = true); | 124 void setAutofilled(bool = true); |
| 123 | 125 |
| 124 static HTMLFormControlElement* enclosingFormControlElement(Node*); | 126 static HTMLFormControlElement* enclosingFormControlElement(Node*); |
| 125 | 127 |
| 126 String nameForAutofill() const; | 128 String nameForAutofill() const; |
| 127 | 129 |
| 128 void copyNonAttributePropertiesFromElement(const Element&) override; | 130 void copyNonAttributePropertiesFromElement(const Element&) override; |
| 129 | 131 |
| 132 FormAssociated* toFormAssociatedOrNull() override { return this; }; |
| 133 void associateWith(HTMLFormElement*) override; |
| 134 |
| 130 protected: | 135 protected: |
| 131 HTMLFormControlElement(const QualifiedName& tagName, | 136 HTMLFormControlElement(const QualifiedName& tagName, |
| 132 Document&, | 137 Document&, |
| 133 HTMLFormElement*); | 138 HTMLFormElement*); |
| 134 | 139 |
| 135 void parseAttribute(const QualifiedName&, | 140 void parseAttribute(const QualifiedName&, |
| 136 const AtomicString&, | 141 const AtomicString&, |
| 137 const AtomicString&) override; | 142 const AtomicString&) override; |
| 138 virtual void requiredAttributeChanged(); | 143 virtual void requiredAttributeChanged(); |
| 139 virtual void disabledAttributeChanged(); | 144 virtual void disabledAttributeChanged(); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLFormControlElement); | 219 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLFormControlElement); |
| 215 DEFINE_TYPE_CASTS(HTMLFormControlElement, | 220 DEFINE_TYPE_CASTS(HTMLFormControlElement, |
| 216 ListedElement, | 221 ListedElement, |
| 217 control, | 222 control, |
| 218 control->isFormControlElement(), | 223 control->isFormControlElement(), |
| 219 control.isFormControlElement()); | 224 control.isFormControlElement()); |
| 220 | 225 |
| 221 } // namespace blink | 226 } // namespace blink |
| 222 | 227 |
| 223 #endif | 228 #endif |
| OLD | NEW |