Chromium Code Reviews| Index: third_party/WebKit/Source/core/dom/Document.cpp |
| diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp |
| index ad88264a539403bfbcd9c8ec5e1ef51b405d080b..064a9a884132a9e8b6f5b2fc8bfc59b1ea24600b 100644 |
| --- a/third_party/WebKit/Source/core/dom/Document.cpp |
| +++ b/third_party/WebKit/Source/core/dom/Document.cpp |
| @@ -5737,9 +5737,9 @@ Document& Document::ensureTemplateDocument() |
| void Document::didAssociateFormControl(Element* element) |
| { |
| - if (!frame() || !frame()->page()) |
| + if (!frame() || !frame()->page() || !hasFinishedParsing()) |
|
tkent
2016/07/28 00:21:24
We should use !loadEventFinished() if this should
vasilii
2016/07/28 12:38:50
Done.
|
| return; |
| - m_associatedFormControls.add(element); |
| + |
| // We add a slight delay because this could be called rapidly. |
| if (!m_didAssociateFormControlsTimer.isActive()) |
| m_didAssociateFormControlsTimer.startOneShot(0.3, BLINK_FROM_HERE); |
| @@ -5747,12 +5747,6 @@ void Document::didAssociateFormControl(Element* element) |
| void Document::removeFormAssociation(Element* element) |
| { |
| - auto it = m_associatedFormControls.find(element); |
| - if (it == m_associatedFormControls.end()) |
| - return; |
| - m_associatedFormControls.remove(it); |
| - if (m_associatedFormControls.isEmpty()) |
| - m_didAssociateFormControlsTimer.stop(); |
| } |
| void Document::didAssociateFormControlsTimerFired(Timer<Document>* timer) |
| @@ -5761,11 +5755,7 @@ void Document::didAssociateFormControlsTimerFired(Timer<Document>* timer) |
| if (!frame() || !frame()->page()) |
| return; |
| - HeapVector<Member<Element>> associatedFormControls; |
| - copyToVector(m_associatedFormControls, associatedFormControls); |
| - |
| - frame()->page()->chromeClient().didAssociateFormControls(associatedFormControls, frame()); |
| - m_associatedFormControls.clear(); |
| + frame()->page()->chromeClient().didAssociateFormControls(frame()); |
| } |
| float Document::devicePixelRatio() const |
| @@ -5993,7 +5983,6 @@ DEFINE_TRACE(Document) |
| visitor->trace(m_registrationContext); |
| visitor->trace(m_customElementMicrotaskRunQueue); |
| visitor->trace(m_elementDataCache); |
| - visitor->trace(m_associatedFormControls); |
| visitor->trace(m_useElementsNeedingUpdate); |
| visitor->trace(m_layerUpdateSVGFilterElements); |
| visitor->trace(m_timers); |