Bug 1318576. Remove entries from a form's past names map when an element is removed from the form, even if that element doesn't have a name or id anymore. r=baku
This commit is contained in:
@@ -1791,13 +1791,11 @@ nsGenericHTMLFormElement::ClearForm(bool aRemoveFromForm)
|
||||
mForm->RemoveElement(this, true);
|
||||
|
||||
if (!nameVal.IsEmpty()) {
|
||||
mForm->RemoveElementFromTable(this, nameVal,
|
||||
HTMLFormElement::ElementRemoved);
|
||||
mForm->RemoveElementFromTable(this, nameVal);
|
||||
}
|
||||
|
||||
if (!idVal.IsEmpty()) {
|
||||
mForm->RemoveElementFromTable(this, idVal,
|
||||
HTMLFormElement::ElementRemoved);
|
||||
mForm->RemoveElementFromTable(this, idVal);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1934,8 +1932,7 @@ nsGenericHTMLFormElement::BeforeSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||
GetAttr(kNameSpaceID_None, aName, tmp);
|
||||
|
||||
if (!tmp.IsEmpty()) {
|
||||
mForm->RemoveElementFromTable(this, tmp,
|
||||
HTMLFormElement::AttributeUpdated);
|
||||
mForm->RemoveElementFromTable(this, tmp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1943,15 +1940,13 @@ nsGenericHTMLFormElement::BeforeSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||
GetAttr(kNameSpaceID_None, nsGkAtoms::name, tmp);
|
||||
|
||||
if (!tmp.IsEmpty()) {
|
||||
mForm->RemoveElementFromTable(this, tmp,
|
||||
HTMLFormElement::AttributeUpdated);
|
||||
mForm->RemoveElementFromTable(this, tmp);
|
||||
}
|
||||
|
||||
GetAttr(kNameSpaceID_None, nsGkAtoms::id, tmp);
|
||||
|
||||
if (!tmp.IsEmpty()) {
|
||||
mForm->RemoveElementFromTable(this, tmp,
|
||||
HTMLFormElement::AttributeUpdated);
|
||||
mForm->RemoveElementFromTable(this, tmp);
|
||||
}
|
||||
|
||||
mForm->RemoveElement(this, false);
|
||||
|
||||
Reference in New Issue
Block a user