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
reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 #include "core/html/FormAssociatedElement.h" | 27 #include "core/html/FormAssociatedElement.h" |
28 #include "core/html/LabelableElement.h" | 28 #include "core/html/LabelableElement.h" |
29 | 29 |
30 namespace WebCore { | 30 namespace WebCore { |
31 | 31 |
32 class FormDataList; | 32 class FormDataList; |
33 class HTMLFieldSetElement; | 33 class HTMLFieldSetElement; |
34 class HTMLFormElement; | 34 class HTMLFormElement; |
35 class HTMLLegendElement; | 35 class HTMLLegendElement; |
36 class ValidationMessage; | 36 class ValidationMessageClient; |
37 class ValidityState; | 37 class ValidityState; |
38 | 38 |
39 // HTMLFormControlElement is the default implementation of FormAssociatedElement
, | 39 // HTMLFormControlElement is the default implementation of FormAssociatedElement
, |
40 // and form-associated element implementations should use HTMLFormControlElement | 40 // and form-associated element implementations should use HTMLFormControlElement |
41 // unless there is a special reason. | 41 // unless there is a special reason. |
42 class HTMLFormControlElement : public LabelableElement, public FormAssociatedEle
ment { | 42 class HTMLFormControlElement : public LabelableElement, public FormAssociatedEle
ment { |
43 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLFormControlElement); | 43 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLFormControlElement); |
44 | 44 |
45 public: | 45 public: |
46 virtual ~HTMLFormControlElement(); | 46 virtual ~HTMLFormControlElement(); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 150 |
151 virtual bool isFormControlElement() const OVERRIDE FINAL { return true; } | 151 virtual bool isFormControlElement() const OVERRIDE FINAL { return true; } |
152 virtual bool alwaysCreateUserAgentShadowRoot() const OVERRIDE { return true;
} | 152 virtual bool alwaysCreateUserAgentShadowRoot() const OVERRIDE { return true;
} |
153 | 153 |
154 virtual short tabIndex() const OVERRIDE FINAL; | 154 virtual short tabIndex() const OVERRIDE FINAL; |
155 | 155 |
156 virtual bool isDefaultButtonForForm() const OVERRIDE FINAL; | 156 virtual bool isDefaultButtonForForm() const OVERRIDE FINAL; |
157 virtual bool isValidFormControlElement() OVERRIDE FINAL; | 157 virtual bool isValidFormControlElement() OVERRIDE FINAL; |
158 void updateAncestorDisabledState() const; | 158 void updateAncestorDisabledState() const; |
159 | 159 |
160 OwnPtr<ValidationMessage> m_validationMessage; | 160 bool isValidationMessageVisible() const; |
| 161 ValidationMessageClient* validationMessageClient() const; |
| 162 |
161 bool m_disabled : 1; | 163 bool m_disabled : 1; |
162 bool m_isAutofilled : 1; | 164 bool m_isAutofilled : 1; |
163 bool m_isReadOnly : 1; | 165 bool m_isReadOnly : 1; |
164 bool m_isRequired : 1; | 166 bool m_isRequired : 1; |
| 167 bool m_hasValidationMessage : 1; |
165 | 168 |
166 enum AncestorDisabledState { AncestorDisabledStateUnknown, AncestorDisabledS
tateEnabled, AncestorDisabledStateDisabled }; | 169 enum AncestorDisabledState { AncestorDisabledStateUnknown, AncestorDisabledS
tateEnabled, AncestorDisabledStateDisabled }; |
167 mutable AncestorDisabledState m_ancestorDisabledState; | 170 mutable AncestorDisabledState m_ancestorDisabledState; |
168 enum DataListAncestorState { Unknown, InsideDataList, NotInsideDataList }; | 171 enum DataListAncestorState { Unknown, InsideDataList, NotInsideDataList }; |
169 mutable enum DataListAncestorState m_dataListAncestorState; | 172 mutable enum DataListAncestorState m_dataListAncestorState; |
170 | 173 |
171 // The initial value of m_willValidate depends on the derived class. We can'
t | 174 // The initial value of m_willValidate depends on the derived class. We can'
t |
172 // initialize it with a virtual function in the constructor. m_willValidate | 175 // initialize it with a virtual function in the constructor. m_willValidate |
173 // is not deterministic as long as m_willValidateInitialized is false. | 176 // is not deterministic as long as m_willValidateInitialized is false. |
174 mutable bool m_willValidateInitialized: 1; | 177 mutable bool m_willValidateInitialized: 1; |
(...skipping 11 matching lines...) Expand all Loading... |
186 { | 189 { |
187 return element.isFormControlElement(); | 190 return element.isFormControlElement(); |
188 } | 191 } |
189 | 192 |
190 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLFormControlElement); | 193 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLFormControlElement); |
191 DEFINE_TYPE_CASTS(HTMLFormControlElement, FormAssociatedElement, control, contro
l->isFormControlElement(), control.isFormControlElement()); | 194 DEFINE_TYPE_CASTS(HTMLFormControlElement, FormAssociatedElement, control, contro
l->isFormControlElement(), control.isFormControlElement()); |
192 | 195 |
193 } // namespace | 196 } // namespace |
194 | 197 |
195 #endif | 198 #endif |
OLD | NEW |