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:
Boris Zbarsky
2016-11-21 12:34:02 -05:00
parent b59fc632ad
commit ab063f5422
6 changed files with 147 additions and 69 deletions

View File

@@ -380,8 +380,7 @@ HTMLImageElement::BeforeSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
GetAttr(kNameSpaceID_None, aName, tmp);
if (!tmp.IsEmpty()) {
mForm->RemoveImageElementFromTable(this, tmp,
HTMLFormElement::AttributeUpdated);
mForm->RemoveImageElementFromTable(this, tmp);
}
}
@@ -882,13 +881,11 @@ HTMLImageElement::ClearForm(bool aRemoveFromForm)
mForm->RemoveImageElement(this);
if (!nameVal.IsEmpty()) {
mForm->RemoveImageElementFromTable(this, nameVal,
HTMLFormElement::ElementRemoved);
mForm->RemoveImageElementFromTable(this, nameVal);
}
if (!idVal.IsEmpty()) {
mForm->RemoveImageElementFromTable(this, idVal,
HTMLFormElement::ElementRemoved);
mForm->RemoveImageElementFromTable(this, idVal);
}
}