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

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

Issue 656723005: Use C++11 features in core/html (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: use nullptr Created 6 years, 1 month 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 class HTMLFormElement final : public HTMLElement { 44 class HTMLFormElement final : public HTMLElement {
45 DEFINE_WRAPPERTYPEINFO(); 45 DEFINE_WRAPPERTYPEINFO();
46 public: 46 public:
47 static PassRefPtrWillBeRawPtr<HTMLFormElement> create(Document&); 47 static PassRefPtrWillBeRawPtr<HTMLFormElement> create(Document&);
48 virtual ~HTMLFormElement(); 48 virtual ~HTMLFormElement();
49 virtual void trace(Visitor*) override; 49 virtual void trace(Visitor*) override;
50 50
51 void setNeedsValidityCheck(); 51 void setNeedsValidityCheck();
52 52
53 PassRefPtrWillBeRawPtr<HTMLFormControlsCollection> elements(); 53 PassRefPtrWillBeRawPtr<HTMLFormControlsCollection> elements();
54 void getNamedElements(const AtomicString&, WillBeHeapVector<RefPtrWillBeMemb er<Element> >&); 54 void getNamedElements(const AtomicString&, WillBeHeapVector<RefPtrWillBeMemb er<Element>>&);
55 55
56 unsigned length() const; 56 unsigned length() const;
57 HTMLElement* item(unsigned index); 57 HTMLElement* item(unsigned index);
58 58
59 String enctype() const { return m_attributes.encodingType(); } 59 String enctype() const { return m_attributes.encodingType(); }
60 void setEnctype(const AtomicString&); 60 void setEnctype(const AtomicString&);
61 61
62 String encoding() const { return m_attributes.encodingType(); } 62 String encoding() const { return m_attributes.encodingType(); }
63 void setEncoding(const AtomicString& value) { setEnctype(value); } 63 void setEncoding(const AtomicString& value) { setEnctype(value); }
64 64
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 109
110 void requestAutocomplete(); 110 void requestAutocomplete();
111 void finishRequestAutocomplete(AutocompleteResult); 111 void finishRequestAutocomplete(AutocompleteResult);
112 112
113 DEFINE_ATTRIBUTE_EVENT_LISTENER(autocomplete); 113 DEFINE_ATTRIBUTE_EVENT_LISTENER(autocomplete);
114 DEFINE_ATTRIBUTE_EVENT_LISTENER(autocompleteerror); 114 DEFINE_ATTRIBUTE_EVENT_LISTENER(autocompleteerror);
115 115
116 RadioButtonGroupScope& radioButtonGroupScope() { return m_radioButtonGroupSc ope; } 116 RadioButtonGroupScope& radioButtonGroupScope() { return m_radioButtonGroupSc ope; }
117 117
118 const FormAssociatedElement::List& associatedElements() const; 118 const FormAssociatedElement::List& associatedElements() const;
119 const WillBeHeapVector<RawPtrWillBeMember<HTMLImageElement> >& imageElements (); 119 const WillBeHeapVector<RawPtrWillBeMember<HTMLImageElement>>& imageElements( );
120 120
121 void anonymousNamedGetter(const AtomicString& name, RadioNodeListOrElement&) ; 121 void anonymousNamedGetter(const AtomicString& name, RadioNodeListOrElement&) ;
122 122
123 private: 123 private:
124 explicit HTMLFormElement(Document&); 124 explicit HTMLFormElement(Document&);
125 125
126 virtual bool rendererIsNeeded(const RenderStyle&) override; 126 virtual bool rendererIsNeeded(const RenderStyle&) override;
127 virtual InsertionNotificationRequest insertedInto(ContainerNode*) override; 127 virtual InsertionNotificationRequest insertedInto(ContainerNode*) override;
128 virtual void removedFrom(ContainerNode*) override; 128 virtual void removedFrom(ContainerNode*) override;
129 virtual void finishParsingChildren() override; 129 virtual void finishParsingChildren() override;
130 130
131 virtual void handleLocalEvents(Event*) override; 131 virtual void handleLocalEvents(Event*) override;
132 132
133 virtual void attributeWillChange(const QualifiedName&, const AtomicString& o ldValue, const AtomicString& newValue) override; 133 virtual void attributeWillChange(const QualifiedName&, const AtomicString& o ldValue, const AtomicString& newValue) override;
134 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr ide; 134 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr ide;
135 virtual bool isURLAttribute(const Attribute&) const override; 135 virtual bool isURLAttribute(const Attribute&) const override;
136 virtual bool hasLegalLinkAttribute(const QualifiedName&) const override; 136 virtual bool hasLegalLinkAttribute(const QualifiedName&) const override;
137 137
138 virtual bool shouldRegisterAsNamedItem() const override { return true; } 138 virtual bool shouldRegisterAsNamedItem() const override { return true; }
139 139
140 virtual void copyNonAttributePropertiesFromElement(const Element&) override; 140 virtual void copyNonAttributePropertiesFromElement(const Element&) override;
141 141
142 void submitDialog(PassRefPtrWillBeRawPtr<FormSubmission>); 142 void submitDialog(PassRefPtrWillBeRawPtr<FormSubmission>);
143 void submit(Event*, bool activateSubmitButton, bool processingUserGesture, F ormSubmissionTrigger); 143 void submit(Event*, bool activateSubmitButton, bool processingUserGesture, F ormSubmissionTrigger);
144 144
145 void scheduleFormSubmission(PassRefPtrWillBeRawPtr<FormSubmission>); 145 void scheduleFormSubmission(PassRefPtrWillBeRawPtr<FormSubmission>);
146 146
147 void collectAssociatedElements(Node& root, FormAssociatedElement::List&) con st; 147 void collectAssociatedElements(Node& root, FormAssociatedElement::List&) con st;
148 void collectImageElements(Node& root, WillBeHeapVector<RawPtrWillBeMember<HT MLImageElement> >&); 148 void collectImageElements(Node& root, WillBeHeapVector<RawPtrWillBeMember<HT MLImageElement>>&);
149 149
150 // Returns true if the submission should proceed. 150 // Returns true if the submission should proceed.
151 bool validateInteractively(); 151 bool validateInteractively();
152 152
153 // Validates each of the controls, and stores controls of which 'invalid' 153 // Validates each of the controls, and stores controls of which 'invalid'
154 // event was not canceled to the specified vector. Returns true if there 154 // event was not canceled to the specified vector. Returns true if there
155 // are any invalid controls in this form. 155 // are any invalid controls in this form.
156 bool checkInvalidControlsAndCollectUnhandled(WillBeHeapVector<RefPtrWillBeMe mber<HTMLFormControlElement> >*, CheckValidityEventBehavior); 156 bool checkInvalidControlsAndCollectUnhandled(WillBeHeapVector<RefPtrWillBeMe mber<HTMLFormControlElement>>*, CheckValidityEventBehavior);
157 157
158 Element* elementFromPastNamesMap(const AtomicString&); 158 Element* elementFromPastNamesMap(const AtomicString&);
159 void addToPastNamesMap(Element*, const AtomicString& pastName); 159 void addToPastNamesMap(Element*, const AtomicString& pastName);
160 void removeFromPastNamesMap(HTMLElement&); 160 void removeFromPastNamesMap(HTMLElement&);
161 161
162 typedef WillBeHeapHashMap<AtomicString, RawPtrWillBeMember<Element> > PastNa mesMap; 162 typedef WillBeHeapHashMap<AtomicString, RawPtrWillBeMember<Element>> PastNam esMap;
163 163
164 FormSubmission::Attributes m_attributes; 164 FormSubmission::Attributes m_attributes;
165 OwnPtrWillBeMember<PastNamesMap> m_pastNamesMap; 165 OwnPtrWillBeMember<PastNamesMap> m_pastNamesMap;
166 166
167 RadioButtonGroupScope m_radioButtonGroupScope; 167 RadioButtonGroupScope m_radioButtonGroupScope;
168 168
169 // Do not access m_associatedElements directly. Use associatedElements() ins tead. 169 // Do not access m_associatedElements directly. Use associatedElements() ins tead.
170 FormAssociatedElement::List m_associatedElements; 170 FormAssociatedElement::List m_associatedElements;
171 // Do not access m_imageElements directly. Use imageElements() instead. 171 // Do not access m_imageElements directly. Use imageElements() instead.
172 WillBeHeapVector<RawPtrWillBeMember<HTMLImageElement> > m_imageElements; 172 WillBeHeapVector<RawPtrWillBeMember<HTMLImageElement>> m_imageElements;
173 #if !ENABLE(OILPAN) 173 #if !ENABLE(OILPAN)
174 WeakPtrFactory<HTMLFormElement> m_weakPtrFactory; 174 WeakPtrFactory<HTMLFormElement> m_weakPtrFactory;
175 #endif 175 #endif
176 bool m_associatedElementsAreDirty : 1; 176 bool m_associatedElementsAreDirty : 1;
177 bool m_imageElementsAreDirty : 1; 177 bool m_imageElementsAreDirty : 1;
178 bool m_hasElementsAssociatedByParser : 1; 178 bool m_hasElementsAssociatedByParser : 1;
179 bool m_didFinishParsingChildren : 1; 179 bool m_didFinishParsingChildren : 1;
180 180
181 bool m_wasUserSubmitted : 1; 181 bool m_wasUserSubmitted : 1;
182 bool m_isSubmittingOrInUserJSSubmitEvent : 1; 182 bool m_isSubmittingOrInUserJSSubmitEvent : 1;
183 bool m_shouldSubmit : 1; 183 bool m_shouldSubmit : 1;
184 184
185 bool m_isInResetFunction : 1; 185 bool m_isInResetFunction : 1;
186 186
187 bool m_wasDemoted : 1; 187 bool m_wasDemoted : 1;
188 188
189 OwnPtrWillBeMember<GenericEventQueue> m_pendingAutocompleteEventsQueue; 189 OwnPtrWillBeMember<GenericEventQueue> m_pendingAutocompleteEventsQueue;
190 }; 190 };
191 191
192 } // namespace blink 192 } // namespace blink
193 193
194 #endif // HTMLFormElement_h 194 #endif // HTMLFormElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698