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

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

Issue 126793004: Update HTML classes to use OVERRIDE / FINAL when needed (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 months 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
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 void setFormMethod(const AtomicString&); 49 void setFormMethod(const AtomicString&);
50 bool formNoValidate() const; 50 bool formNoValidate() const;
51 51
52 void ancestorDisabledStateWasChanged(); 52 void ancestorDisabledStateWasChanged();
53 53
54 void reset(); 54 void reset();
55 55
56 virtual bool formControlValueMatchesRenderer() const { return m_valueMatches Renderer; } 56 virtual bool formControlValueMatchesRenderer() const { return m_valueMatches Renderer; }
57 virtual void setFormControlValueMatchesRenderer(bool b) { m_valueMatchesRend erer = b; } 57 virtual void setFormControlValueMatchesRenderer(bool b) { m_valueMatchesRend erer = b; }
58 58
59 virtual bool wasChangedSinceLastFormControlChangeEvent() const; 59 virtual bool wasChangedSinceLastFormControlChangeEvent() const OVERRIDE FINA L;
60 virtual void setChangedSinceLastFormControlChangeEvent(bool); 60 virtual void setChangedSinceLastFormControlChangeEvent(bool) OVERRIDE FINAL;
61 61
62 virtual void dispatchFormControlChangeEvent(); 62 virtual void dispatchFormControlChangeEvent() OVERRIDE;
63 virtual void dispatchFormControlInputEvent(); 63 void dispatchFormControlInputEvent();
64 64
65 virtual HTMLFormElement* formOwner() const OVERRIDE; 65 virtual HTMLFormElement* formOwner() const OVERRIDE FINAL;
66 66
67 virtual bool isDisabledFormControl() const OVERRIDE; 67 virtual bool isDisabledFormControl() const OVERRIDE;
68 68
69 virtual bool isEnumeratable() const { return false; } 69 virtual bool isEnumeratable() const OVERRIDE { return false; }
70 70
71 bool isRequired() const; 71 bool isRequired() const;
72 72
73 const AtomicString& type() const { return formControlType(); } 73 const AtomicString& type() const { return formControlType(); }
74 74
75 virtual const AtomicString& formControlType() const OVERRIDE = 0; 75 virtual const AtomicString& formControlType() const OVERRIDE = 0;
76 76
77 virtual bool canTriggerImplicitSubmission() const { return false; } 77 virtual bool canTriggerImplicitSubmission() const { return false; }
78 78
79 // Override in derived classes to get the encoded name=value pair for submit ting. 79 // Override in derived classes to get the encoded name=value pair for submit ting.
80 // Return true for a successful control (see HTML4-17.13.2). 80 // Return true for a successful control (see HTML4-17.13.2).
81 virtual bool appendFormData(FormDataList&, bool) { return false; } 81 virtual bool appendFormData(FormDataList&, bool) OVERRIDE { return false; }
82 virtual String resultForDialogSubmit(); 82 virtual String resultForDialogSubmit();
83 83
84 virtual bool canBeSuccessfulSubmitButton() const { return false; } 84 virtual bool canBeSuccessfulSubmitButton() const { return false; }
85 bool isSuccessfulSubmitButton() const; 85 bool isSuccessfulSubmitButton() const;
86 virtual bool isActivatedSubmit() const { return false; } 86 virtual bool isActivatedSubmit() const { return false; }
87 virtual void setActivatedSubmit(bool) { } 87 virtual void setActivatedSubmit(bool) { }
88 88
89 enum CheckValidityDispatchEvents { CheckValidityDispatchEventsAllowed, Check ValidityDispatchEventsNone }; 89 enum CheckValidityDispatchEvents { CheckValidityDispatchEventsAllowed, Check ValidityDispatchEventsNone };
90 90
91 virtual bool willValidate() const; 91 virtual bool willValidate() const OVERRIDE;
92 void updateVisibleValidationMessage(); 92 void updateVisibleValidationMessage();
93 void hideVisibleValidationMessage(); 93 void hideVisibleValidationMessage();
94 bool checkValidity(Vector<RefPtr<FormAssociatedElement> >* unhandledInvalidC ontrols = 0, CheckValidityDispatchEvents = CheckValidityDispatchEventsAllowed); 94 bool checkValidity(Vector<RefPtr<FormAssociatedElement> >* unhandledInvalidC ontrols = 0, CheckValidityDispatchEvents = CheckValidityDispatchEventsAllowed);
95 // This must be called when a validation constraint or control value is chan ged. 95 // This must be called when a validation constraint or control value is chan ged.
96 void setNeedsValidityCheck(); 96 void setNeedsValidityCheck();
97 virtual void setCustomValidity(const String&) OVERRIDE; 97 virtual void setCustomValidity(const String&) OVERRIDE FINAL;
98 98
99 bool isReadOnly() const { return m_isReadOnly; } 99 bool isReadOnly() const { return m_isReadOnly; }
100 bool isDisabledOrReadOnly() const { return isDisabledFormControl() || m_isRe adOnly; } 100 bool isDisabledOrReadOnly() const { return isDisabledFormControl() || m_isRe adOnly; }
101 101
102 bool hasAutofocused() const { return m_hasAutofocused; } 102 bool hasAutofocused() const { return m_hasAutofocused; }
103 void setAutofocused() { m_hasAutofocused = true; } 103 void setAutofocused() { m_hasAutofocused = true; }
104 bool isAutofocusable() const; 104 bool isAutofocusable() const;
105 105
106 bool isAutofilled() const { return m_isAutofilled; } 106 bool isAutofilled() const { return m_isAutofilled; }
107 void setAutofilled(bool = true); 107 void setAutofilled(bool = true);
(...skipping 12 matching lines...) Expand all
120 virtual void requiredAttributeChanged(); 120 virtual void requiredAttributeChanged();
121 virtual void disabledAttributeChanged(); 121 virtual void disabledAttributeChanged();
122 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; 122 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE;
123 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; 123 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE;
124 virtual void removedFrom(ContainerNode*) OVERRIDE; 124 virtual void removedFrom(ContainerNode*) OVERRIDE;
125 virtual void didMoveToNewDocument(Document& oldDocument) OVERRIDE; 125 virtual void didMoveToNewDocument(Document& oldDocument) OVERRIDE;
126 126
127 virtual bool supportsFocus() const OVERRIDE; 127 virtual bool supportsFocus() const OVERRIDE;
128 virtual bool isKeyboardFocusable() const OVERRIDE; 128 virtual bool isKeyboardFocusable() const OVERRIDE;
129 virtual bool shouldShowFocusRingOnMouseFocus() const; 129 virtual bool shouldShowFocusRingOnMouseFocus() const;
130 virtual bool shouldHaveFocusAppearance() const OVERRIDE; 130 virtual bool shouldHaveFocusAppearance() const OVERRIDE FINAL;
131 virtual void dispatchFocusEvent(Element* oldFocusedElement, FocusDirection) OVERRIDE; 131 virtual void dispatchFocusEvent(Element* oldFocusedElement, FocusDirection) OVERRIDE;
132 virtual void dispatchBlurEvent(Element* newFocusedElement) OVERRIDE; 132 virtual void dispatchBlurEvent(Element* newFocusedElement) OVERRIDE;
133 virtual void willCallDefaultEventHandler(const Event&) OVERRIDE; 133 virtual void willCallDefaultEventHandler(const Event&) OVERRIDE FINAL;
134 134
135 virtual void didRecalcStyle(StyleRecalcChange) OVERRIDE; 135 virtual void didRecalcStyle(StyleRecalcChange) OVERRIDE FINAL;
136 136
137 // This must be called any time the result of willValidate() has changed. 137 // This must be called any time the result of willValidate() has changed.
138 void setNeedsWillValidateCheck(); 138 void setNeedsWillValidateCheck();
139 virtual bool recalcWillValidate() const; 139 virtual bool recalcWillValidate() const;
140 140
141 virtual void resetImpl() { } 141 virtual void resetImpl() { }
142 142
143 private: 143 private:
144 virtual void refFormAssociatedElement() { ref(); } 144 virtual void refFormAssociatedElement() OVERRIDE FINAL { ref(); }
145 virtual void derefFormAssociatedElement() { deref(); } 145 virtual void derefFormAssociatedElement() OVERRIDE FINAL { deref(); }
146 146
147 virtual bool isFormControlElement() const { return true; } 147 virtual bool isFormControlElement() const OVERRIDE FINAL { return true; }
148 virtual bool alwaysCreateUserAgentShadowRoot() const OVERRIDE { return true; } 148 virtual bool alwaysCreateUserAgentShadowRoot() const OVERRIDE { return true; }
149 149
150 virtual short tabIndex() const; 150 virtual short tabIndex() const OVERRIDE FINAL;
151 151
152 virtual bool isDefaultButtonForForm() const; 152 virtual bool isDefaultButtonForForm() const OVERRIDE FINAL;
153 virtual bool isValidFormControlElement(); 153 virtual bool isValidFormControlElement() OVERRIDE FINAL;
154 void updateAncestorDisabledState() const; 154 void updateAncestorDisabledState() const;
155 155
156 OwnPtr<ValidationMessage> m_validationMessage; 156 OwnPtr<ValidationMessage> m_validationMessage;
157 bool m_disabled : 1; 157 bool m_disabled : 1;
158 bool m_isAutofilled : 1; 158 bool m_isAutofilled : 1;
159 bool m_isReadOnly : 1; 159 bool m_isReadOnly : 1;
160 bool m_isRequired : 1; 160 bool m_isRequired : 1;
161 bool m_valueMatchesRenderer : 1; 161 bool m_valueMatchesRenderer : 1;
162 162
163 enum AncestorDisabledState { AncestorDisabledStateUnknown, AncestorDisabledS tateEnabled, AncestorDisabledStateDisabled }; 163 enum AncestorDisabledState { AncestorDisabledStateUnknown, AncestorDisabledS tateEnabled, AncestorDisabledStateDisabled };
(...skipping 20 matching lines...) Expand all
184 { 184 {
185 return node.isElementNode() && toElement(node).isFormControlElement(); 185 return node.isElementNode() && toElement(node).isFormControlElement();
186 } 186 }
187 187
188 DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(HTMLFormControlElement); 188 DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(HTMLFormControlElement);
189 DEFINE_TYPE_CASTS(HTMLFormControlElement, FormAssociatedElement, control, contro l->isFormControlElement(), control.isFormControlElement()); 189 DEFINE_TYPE_CASTS(HTMLFormControlElement, FormAssociatedElement, control, contro l->isFormControlElement(), control.isFormControlElement());
190 190
191 } // namespace 191 } // namespace
192 192
193 #endif 193 #endif
OLDNEW
« no previous file with comments | « Source/core/html/HTMLFieldSetElement.h ('k') | Source/core/html/HTMLFormControlElementWithState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698