Invalidate node list when associated form control element is removed
[WebKit.git] / Source / WebCore / html / HTMLFormElement.cpp
index dc6169c..09003d5 100644 (file)
@@ -552,6 +552,9 @@ void HTMLFormElement::removeFormElement(FormAssociatedElement* e)
     removeFromPastNamesMap(e);
     m_associatedElements.remove(index);
 
+    if (auto* nodeLists = this->nodeLists())
+        nodeLists->invalidateCaches();
+
     if (e == m_defaultButton)
         resetDefaultButton();
 }