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 { return fastHasAttribute(HTMLNames::readonlyAttr); } |
kochi
2015/12/03 03:38:59
isRequired() is just { return fastHasAttribute(...
tkent
2015/12/03 04:05:29
Ok, I took out-of-line.
| |
104 bool isDisabledOrReadOnly() const { return isDisabledFormControl() || m_isRe adOnly; } | 104 bool isDisabledOrReadOnly() const { return isDisabledFormControl() || isRead Only(); } |
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; | 177 bool m_isAutofilled : 1; |
kochi
2015/12/03 03:38:59
Can these 2 bitfields move to below so that it cou
tkent
2015/12/03 04:05:29
Good suggestion. Done.
| |
179 bool m_isReadOnly : 1; | |
180 bool m_isRequired : 1; | |
181 bool m_hasValidationMessage : 1; | 178 bool m_hasValidationMessage : 1; |
182 | 179 |
183 enum AncestorDisabledState { AncestorDisabledStateUnknown, AncestorDisabledS tateEnabled, AncestorDisabledStateDisabled }; | 180 enum AncestorDisabledState { AncestorDisabledStateUnknown, AncestorDisabledS tateEnabled, AncestorDisabledStateDisabled }; |
184 mutable AncestorDisabledState m_ancestorDisabledState; | 181 mutable AncestorDisabledState m_ancestorDisabledState; |
185 enum DataListAncestorState { Unknown, InsideDataList, NotInsideDataList }; | 182 enum DataListAncestorState { Unknown, InsideDataList, NotInsideDataList }; |
186 mutable enum DataListAncestorState m_dataListAncestorState; | 183 mutable enum DataListAncestorState m_dataListAncestorState; |
187 | 184 |
188 // The initial value of m_willValidate depends on the derived class. We can' t | 185 // 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 | 186 // initialize it with a virtual function in the constructor. m_willValidate |
190 // is not deterministic as long as m_willValidateInitialized is false. | 187 // is not deterministic as long as m_willValidateInitialized is false. |
(...skipping 12 matching lines...) Expand all Loading... | |
203 { | 200 { |
204 return element.isFormControlElement(); | 201 return element.isFormControlElement(); |
205 } | 202 } |
206 | 203 |
207 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLFormControlElement); | 204 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLFormControlElement); |
208 DEFINE_TYPE_CASTS(HTMLFormControlElement, FormAssociatedElement, control, contro l->isFormControlElement(), control.isFormControlElement()); | 205 DEFINE_TYPE_CASTS(HTMLFormControlElement, FormAssociatedElement, control, contro l->isFormControlElement(), control.isFormControlElement()); |
209 | 206 |
210 } // namespace | 207 } // namespace |
211 | 208 |
212 #endif | 209 #endif |
OLD | NEW |