Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLFormControlElement.h

Issue 1490973002: Remove HTMLFormControlElement::m_disabled, m_isReadOnly, and m_isRequired. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@attr-hook-2
Patch Set: apply review comments Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698