Changeset 146919 in webkit
- Timestamp:
- Mar 26, 2013, 12:41:45 PM (12 years ago)
- Location:
- branches/chromium/1453/Source
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/chromium/1453/Source/WebCore/dom/Document.cpp
r146891 r146919 497 497 , m_fontloader(0) 498 498 #endif 499 , m_didAssociateFormControlsTimer(this, &Document::didAssociateFormControlsTimerFired)500 499 { 501 500 m_printing = false; … … 6161 6160 #endif 6162 6161 6163 void Document::didAssociateFormControl(Element* element)6164 {6165 if (!frame() || !frame()->page() || !frame()->page()->chrome()->client()->shouldNotifyOnFormChanges())6166 return;6167 m_associatedFormControls.add(element);6168 if (!m_didAssociateFormControlsTimer.isActive())6169 m_didAssociateFormControlsTimer.startOneShot(0);6170 }6171 6172 void Document::didAssociateFormControlsTimerFired(Timer<Document>* timer)6173 {6174 ASSERT_UNUSED(timer, timer == &m_didAssociateFormControlsTimer);6175 if (!frame() || !frame()->page())6176 return;6177 6178 Vector<Element*> associatedFormControls;6179 copyToVector(m_associatedFormControls, associatedFormControls);6180 6181 frame()->page()->chrome()->client()->didAssociateFormControls(associatedFormControls);6182 m_associatedFormControls.clear();6183 }6184 6185 6162 } // namespace WebCore -
branches/chromium/1453/Source/WebCore/dom/Document.h
r146891 r146919 53 53 #include <wtf/Deque.h> 54 54 #include <wtf/FixedArray.h> 55 #include <wtf/HashSet.h>56 55 #include <wtf/OwnPtr.h> 57 56 #include <wtf/PassOwnPtr.h> … … 1211 1210 #endif 1212 1211 1213 void didAssociateFormControl(Element*);1214 1215 1212 virtual void addConsoleMessage(MessageSource, MessageLevel, const String& message, unsigned long requestIdentifier = 0); 1216 1213 … … 1300 1297 void addListenerType(ListenerType listenerType) { m_listenerTypes |= listenerType; } 1301 1298 void addMutationEventListenerTypeIfEnabled(ListenerType); 1302 1303 void didAssociateFormControlsTimerFired(Timer<Document>*);1304 1299 1305 1300 void styleResolverThrowawayTimerFired(Timer<Document>*); … … 1598 1593 RefPtr<FontLoader> m_fontloader; 1599 1594 #endif 1600 1601 Timer<Document> m_didAssociateFormControlsTimer;1602 HashSet<Element*> m_associatedFormControls;1603 1604 1595 }; 1605 1596 -
branches/chromium/1453/Source/WebCore/html/FormAssociatedElement.cpp
r146672 r146919 26 26 #include "FormAssociatedElement.h" 27 27 28 #include "EditorClient.h"29 28 #include "FormController.h" 30 #include "Frame.h"31 29 #include "HTMLFormControlElement.h" 32 30 #include "HTMLFormElement.h" … … 160 158 void FormAssociatedElement::resetFormOwner() 161 159 { 162 HTMLFormElement* originalForm = m_form;163 160 setForm(findAssociatedForm(toHTMLElement(this), m_form)); 164 HTMLElement* element = toHTMLElement(this);165 if (m_form && m_form != originalForm && m_form->inDocument())166 element->document()->didAssociateFormControl(element);167 161 } 168 162 … … 172 166 if (!element->fastHasAttribute(formAttr)) { 173 167 // The form attribute removed. We need to reset form owner here. 174 HTMLFormElement* originalForm = m_form;175 168 setForm(element->findFormAncestor()); 176 HTMLElement* element = toHTMLElement(this);177 if (m_form && m_form != originalForm && m_form->inDocument())178 element->document()->didAssociateFormControl(element);179 169 m_formAttributeTargetObserver = nullptr; 180 170 } else { -
branches/chromium/1453/Source/WebCore/html/HTMLFormElement.cpp
r146672 r146919 140 140 { 141 141 HTMLElement::insertedInto(insertionPoint); 142 if (insertionPoint->inDocument())143 this->document()->didAssociateFormControl(this);144 142 return InsertionDone; 145 143 } -
branches/chromium/1453/Source/WebCore/loader/EmptyClients.h
r146672 r146919 209 209 210 210 virtual bool isEmptyChromeClient() const { return true; } 211 212 virtual void didAssociateFormControls(const Vector<Element*>&) { }213 virtual bool shouldNotifyOnFormChanges() { return false; }214 211 }; 215 212 -
branches/chromium/1453/Source/WebCore/page/ChromeClient.h
r146672 r146919 383 383 virtual bool shouldAutoscrollForDragAndDrop(RenderBox*) const { return false; } 384 384 385 virtual void didAssociateFormControls(const Vector<Element*>&) { };386 virtual bool shouldNotifyOnFormChanges() { return false; };387 388 385 protected: 389 386 virtual ~ChromeClient() { } -
branches/chromium/1453/Source/WebKit/chromium/public/WebAutofillClient.h
r146672 r146919 40 40 class WebNode; 41 41 class WebString; 42 43 template <typename T> class WebVector;44 42 45 43 class WebAutofillClient { … … 96 94 virtual void setIgnoreTextChanges(bool ignore) { } 97 95 98 virtual void didAssociateFormControls(const WebVector<WebNode>&) { }99 100 96 protected: 101 97 virtual ~WebAutofillClient() { } -
branches/chromium/1453/Source/WebKit/chromium/src/ChromeClientImpl.cpp
r146672 r146919 78 78 #include "TextFieldDecorationElement.h" 79 79 #include "WebAccessibilityObject.h" 80 #include "WebAutofillClient.h"81 80 #if ENABLE(INPUT_TYPE_COLOR) 82 81 #include "WebColorChooser.h" … … 1146 1145 #endif 1147 1146 1148 void ChromeClientImpl::didAssociateFormControls(const Vector<Element*>& elements)1149 {1150 if (!m_webView->autofillClient())1151 return;1152 WebVector<WebNode> elementVector(static_cast<size_t>(elements.size()));1153 size_t elementsCount = elements.size();1154 for (size_t i = 0; i < elementsCount; ++i)1155 elementVector[i] = elements[i];1156 m_webView->autofillClient()->didAssociateFormControls(elementVector);1157 }1158 1159 bool ChromeClientImpl::shouldNotifyOnFormChanges()1160 {1161 return true;1162 }1163 1164 1147 #if ENABLE(NAVIGATOR_CONTENT_UTILS) 1165 1148 PassOwnPtr<NavigatorContentUtilsClientImpl> NavigatorContentUtilsClientImpl::create(WebViewImpl* webView) -
branches/chromium/1453/Source/WebKit/chromium/src/ChromeClientImpl.h
r146672 r146919 235 235 #endif 236 236 237 virtual void didAssociateFormControls(const Vector<WebCore::Element*>&) OVERRIDE;238 virtual bool shouldNotifyOnFormChanges() OVERRIDE;239 240 237 private: 241 238 WebNavigationPolicy getNavigationPolicy();
Note:
See TracChangeset
for help on using the changeset viewer.