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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 void hideVisibleValidationMessage(); | 93 void hideVisibleValidationMessage(); |
94 bool checkValidity(WillBeHeapVector<RefPtrWillBeMember<HTMLFormControlElemen
t>>* unhandledInvalidControls = 0, CheckValidityEventBehavior = CheckValidityDis
patchInvalidEvent); | 94 bool checkValidity(WillBeHeapVector<RefPtrWillBeMember<HTMLFormControlElemen
t>>* unhandledInvalidControls = 0, CheckValidityEventBehavior = CheckValidityDis
patchInvalidEvent); |
95 bool reportValidity(); | 95 bool reportValidity(); |
96 // This must be called only after the caller check the element is focusable. | 96 // This must be called only after the caller check the element is focusable. |
97 void showValidationMessage(); | 97 void showValidationMessage(); |
98 // This must be called when a validation constraint or control value is chan
ged. | 98 // This must be called when a validation constraint or control value is chan
ged. |
99 void setNeedsValidityCheck(); | 99 void setNeedsValidityCheck(); |
100 void setCustomValidity(const String&) final; | 100 void setCustomValidity(const String&) final; |
101 void findCustomValidationMessageTextDirection(const String& message, TextDir
ection &messageDir, String& subMessage, TextDirection& subMessageDir); | 101 void findCustomValidationMessageTextDirection(const String& message, TextDir
ection &messageDir, String& subMessage, TextDirection& subMessageDir); |
102 | 102 |
103 bool isReadOnly() const { return m_isReadOnly; } | 103 bool isReadOnly() const; |
104 bool isDisabledOrReadOnly() const { return isDisabledFormControl() || m_isRe
adOnly; } | 104 bool isDisabledOrReadOnly() const; |
105 | 105 |
106 bool isAutofocusable() const; | 106 bool isAutofocusable() const; |
107 | 107 |
108 bool isAutofilled() const { return m_isAutofilled; } | 108 bool isAutofilled() const { return m_isAutofilled; } |
109 void setAutofilled(bool = true); | 109 void setAutofilled(bool = true); |
110 | 110 |
111 static HTMLFormControlElement* enclosingFormControlElement(Node*); | 111 static HTMLFormControlElement* enclosingFormControlElement(Node*); |
112 | 112 |
113 String nameForAutofill() const; | 113 String nameForAutofill() const; |
114 | 114 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 void updateAncestorDisabledState() const; | 167 void updateAncestorDisabledState() const; |
168 | 168 |
169 bool isValidationMessageVisible() const; | 169 bool isValidationMessageVisible() const; |
170 ValidationMessageClient* validationMessageClient() const; | 170 ValidationMessageClient* validationMessageClient() const; |
171 | 171 |
172 // Requests validity recalc for the form owner, if one exists. | 172 // Requests validity recalc for the form owner, if one exists. |
173 void formOwnerSetNeedsValidityCheck(); | 173 void formOwnerSetNeedsValidityCheck(); |
174 // Requests validity recalc for all ancestor fieldsets, if exist. | 174 // Requests validity recalc for all ancestor fieldsets, if exist. |
175 void fieldSetAncestorsSetNeedsValidityCheck(Node*); | 175 void fieldSetAncestorsSetNeedsValidityCheck(Node*); |
176 | 176 |
177 bool m_disabled : 1; | |
178 bool m_isAutofilled : 1; | |
179 bool m_isReadOnly : 1; | |
180 bool m_isRequired : 1; | |
181 bool m_hasValidationMessage : 1; | |
182 | |
183 enum AncestorDisabledState { AncestorDisabledStateUnknown, AncestorDisabledS
tateEnabled, AncestorDisabledStateDisabled }; | 177 enum AncestorDisabledState { AncestorDisabledStateUnknown, AncestorDisabledS
tateEnabled, AncestorDisabledStateDisabled }; |
184 mutable AncestorDisabledState m_ancestorDisabledState; | 178 mutable AncestorDisabledState m_ancestorDisabledState; |
185 enum DataListAncestorState { Unknown, InsideDataList, NotInsideDataList }; | 179 enum DataListAncestorState { Unknown, InsideDataList, NotInsideDataList }; |
186 mutable enum DataListAncestorState m_dataListAncestorState; | 180 mutable enum DataListAncestorState m_dataListAncestorState; |
187 | 181 |
| 182 bool m_isAutofilled : 1; |
| 183 bool m_hasValidationMessage : 1; |
188 // The initial value of m_willValidate depends on the derived class. We can'
t | 184 // The initial value of m_willValidate depends on the derived class. We can'
t |
189 // initialize it with a virtual function in the constructor. m_willValidate | 185 // initialize it with a virtual function in the constructor. m_willValidate |
190 // is not deterministic as long as m_willValidateInitialized is false. | 186 // is not deterministic as long as m_willValidateInitialized is false. |
191 mutable bool m_willValidateInitialized: 1; | 187 mutable bool m_willValidateInitialized: 1; |
192 mutable bool m_willValidate : 1; | 188 mutable bool m_willValidate : 1; |
193 | 189 |
194 // Cache of valid(). | 190 // Cache of valid(). |
195 bool m_isValid : 1; | 191 bool m_isValid : 1; |
196 bool m_validityIsDirty : 1; | 192 bool m_validityIsDirty : 1; |
197 | 193 |
198 bool m_wasChangedSinceLastFormControlChangeEvent : 1; | 194 bool m_wasChangedSinceLastFormControlChangeEvent : 1; |
199 bool m_wasFocusedByMouse : 1; | 195 bool m_wasFocusedByMouse : 1; |
200 }; | 196 }; |
201 | 197 |
202 inline bool isHTMLFormControlElement(const Element& element) | 198 inline bool isHTMLFormControlElement(const Element& element) |
203 { | 199 { |
204 return element.isFormControlElement(); | 200 return element.isFormControlElement(); |
205 } | 201 } |
206 | 202 |
207 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLFormControlElement); | 203 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLFormControlElement); |
208 DEFINE_TYPE_CASTS(HTMLFormControlElement, FormAssociatedElement, control, contro
l->isFormControlElement(), control.isFormControlElement()); | 204 DEFINE_TYPE_CASTS(HTMLFormControlElement, FormAssociatedElement, control, contro
l->isFormControlElement(), control.isFormControlElement()); |
209 | 205 |
210 } // namespace | 206 } // namespace |
211 | 207 |
212 #endif | 208 #endif |
OLD | NEW |