Bug 1431000 - Introduce nsINode::InsertChildBefore, r=catalinb

This commit is contained in:
Andrea Marchesini
2018-01-25 15:59:42 +01:00
parent eee774394a
commit d7fcfacf9a
21 changed files with 212 additions and 1 deletions

View File

@@ -203,6 +203,22 @@ HTMLSelectElement::GetAutocompleteInfo(AutocompleteInfo& aInfo)
true);
}
nsresult
HTMLSelectElement::InsertChildBefore(nsIContent* aKid,
nsIContent* aBeforeThis,
bool aNotify)
{
int32_t index = aBeforeThis ? ComputeIndexOf(aBeforeThis) : GetChildCount();
SafeOptionListMutation safeMutation(this, this, aKid, index, aNotify);
nsresult rv =
nsGenericHTMLFormElementWithState::InsertChildBefore(aKid, aBeforeThis,
aNotify);
if (NS_FAILED(rv)) {
safeMutation.MutationFailed();
}
return rv;
}
nsresult
HTMLSelectElement::InsertChildAt_Deprecated(nsIContent* aKid,
uint32_t aIndex,